| Author |
Message |
JamesTheAwesomeDude

Joined: 29 Jan 2013 Posts: 99 Location: Classified
|
Posted: Sun 10 Feb 2013, 15:01 Post subject:
How to make urvxt display current directory? (Solved) |
|
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.
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 623
|
Posted: Sun 10 Feb 2013, 17:28 Post subject:
|
|
First you should find the command currently used to set the PS1 prompt. You can do that with this command:
| Code: | | grep "^PS1=" /etc/profile |
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:
| Quote: | # grep "^PS1=" /etc/profile
PS1="# "
# PS1="\w # "
~/my-documents #
~/my-documents # PS1="\W # "
my-documents # |
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.
Last edited by npierce on Sun 10 Feb 2013, 17:37; edited 1 time in total
|
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7017 Location: qld
|
Posted: Sun 10 Feb 2013, 17:32 Post subject:
|
|
Works just as well when inserted into ~/.bashrc
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
Semme
Joined: 07 Aug 2011 Posts: 2036 Location: World_Hub
|
Posted: Sun 10 Feb 2013, 19:55 Post subject:
|
|
Hi NPierce, as I'm sure James and I would prefer- how do we get Pup to honor this running LXTerminal?
If you know- great. If you don't, well.. you're still one of the better contributors on the forum. TIA..
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 623
|
Posted: Sun 10 Feb 2013, 21:18 Post subject:
|
|
I know nothing about LXTerminal, but PS1 is not terminal-specific; it is used by bash. I would expect it to work fine on any terminal. Try it. If it doesn't work for you, give a shout.
|
|
Back to top
|
|
 |
JamesTheAwesomeDude

Joined: 29 Jan 2013 Posts: 99 Location: Classified
|
Posted: Sun 10 Feb 2013, 23:40 Post subject:
|
|
Yes! It worked! Inserting the command into ~/.bashrc got everything set up, and now it looks great!
Thank you all for your suggestions!
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 623
|
Posted: Wed 13 Feb 2013, 15:16 Post subject:
|
|
You're welcome.
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1700 Location: Burghaslach, Germany
|
Posted: Thu 14 Feb 2013, 05:51 Post subject:
Re: How to make urvxt display current directory? Subject description: temporary display |
|
| JamesTheAwesomeDude wrote: | | ...the console/terminal would display the current directory right behind the # sign. ... |
just if needed: print working directory
|
|
Back to top
|
|
 |
|