Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 29 Jul 2014, 04:56
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to make urvxt display current directory? (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
JamesTheAwesomeDude


Joined: 29 Jan 2013
Posts: 99
Location: Classified

PostPosted: 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. Sad (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
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: 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:
Code:
PS1="\w # "

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:
Code:
PS1="\W # "

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
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7782
Location: qld

PostPosted: Sun 10 Feb 2013, 17:32    Post subject:  

Works just as well when inserted into ~/.bashrc Wink
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Semme

Joined: 07 Aug 2011
Posts: 3580
Location: World_Hub

PostPosted: 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 Wink better contributors on the forum. TIA..
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: 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
View user's profile Send private message 
JamesTheAwesomeDude


Joined: 29 Jan 2013
Posts: 99
Location: Classified

PostPosted: 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! Very Happy
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Wed 13 Feb 2013, 15:16    Post subject:  

You're welcome.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: 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. ...


Code:
pwd
just if needed: print working directory Cool
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0616s ][ Queries: 12 (0.0094s) ][ GZIP on ]