Back when I used Ubuntu (and even earlier, in Windows,) the console/terminal would display the current directory right behind the # sign. This was annoying at times, but overall much appreciated. Is there any way to get this working in urxvt?
I'd actually be perfectly fine with using a different Terminal program. So far, urxvt has been nothing but annoying. I just need another program that would work. At this point, I'd be ecstatic just to get LXTerm. (Pretty pathetic, huh?) With the clipboard annoyances, the difficulty in configuring it, and a few other things, I'd really like some sort of replacement.
How to make urvxt display current directory? (Solved)
- JamesTheAwesomeDude
- Posts: 99
- Joined: Tue 29 Jan 2013, 17:17
- Location: Classified
First you should find the command currently used to set the PS1 prompt. You can do that with this command:
To add the working directory to the prompt, you need to insert \w at the beginning of the value for PS1. You can try out your modified command in bash. For instance:
If you would prefer just the base name of the directory, and not the name of all of its ancestors, you can use a capital 'W', like this:
Here is an excerpt from a bash session that is an example of how to get the prompt to display the working directory:
Code: Select all
grep "^PS1=" /etc/profile
Code: Select all
PS1="\w # "
Code: Select all
PS1="\W # "
When you have the prompt the way you like it, you can make it permanent by editing the command used in your /etc/profile file.# grep "^PS1=" /etc/profile
PS1="# "
# PS1="\w # "
~/my-documents #
~/my-documents # PS1="\W # "
my-documents #
Last edited by npierce on Sun 10 Feb 2013, 21:37, edited 1 time in total.
- JamesTheAwesomeDude
- Posts: 99
- Joined: Tue 29 Jan 2013, 17:17
- Location: Classified
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: How to make urvxt display current directory?
JamesTheAwesomeDude wrote:...the console/terminal would display the current directory right behind the # sign. ...
Code: Select all
pwd