Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
latest bash update changes terminal prompt
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
grassushi
n00b
n00b


Joined: 11 Feb 2005
Posts: 54

PostPosted: Thu Jun 09, 2005 8:32 pm    Post subject: latest bash update changes terminal prompt Reply with quote

Hey folks, this isn't a serious issue, its just kind of annoying.

Before the latest bash update, my aterm prompt would look similar to the following:
Code:

someone@machine someone $

(assuming I was the user 'someone' and was in that user's home directory)

however, with the latest bash update it now looks like this:
Code:

someone@machine ~ $

showing a ~ to represent the home directory of the user 'someone'. In no way does this affect the overall performance of the machine, or anything else for that matter, but I don't like it, and would like to know how to change it.

Anyone know? A reply to this would be nice. Thanks in advance.
Back to top
View user's profile Send private message
radfoj
Guru
Guru


Joined: 31 Dec 2004
Posts: 490
Location: Tísek, Czech Republic

PostPosted: Thu Jun 09, 2005 9:20 pm    Post subject: Reply with quote

I had same problem today, but I decided to solve it. I found Tip: Prompt magic
If you want, look on it, try change it to your needs and put it to your .bashrc.
Example:
Code:
export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'

I solved it thisway.
Back to top
View user's profile Send private message
grassushi
n00b
n00b


Joined: 11 Feb 2005
Posts: 54

PostPosted: Thu Jun 09, 2005 9:57 pm    Post subject: Reply with quote

Thanks radfoj, but my PS1 variable is already set to exactly that.

Code:

someone@machine ~ $ echo $PS1
\[\003[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]
someone@machine ~ $


Nonetheless, I appreciate the attempt.
Back to top
View user's profile Send private message
southsider
Guru
Guru


Joined: 05 Jul 2004
Posts: 358

PostPosted: Thu Jun 09, 2005 10:39 pm    Post subject: Reply with quote

Yerp, same here.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Thu Jun 09, 2005 11:18 pm    Post subject: Reply with quote

\w and \W are interpreted differently than previously.
You could try putting
Code:
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]$(basename $PWD) \$ \[\033[00m\]'

in your ~/.bashrc.
Back to top
View user's profile Send private message
grassushi
n00b
n00b


Joined: 11 Feb 2005
Posts: 54

PostPosted: Fri Jun 10, 2005 8:24 pm    Post subject: Reply with quote

limn: that seems to have done the trick. Thank you very much!
Back to top
View user's profile Send private message
justinCOD
n00b
n00b


Joined: 08 Mar 2004
Posts: 73

PostPosted: Mon Jun 13, 2005 7:35 pm    Post subject: Reply with quote

grassushi wrote:
limn: that seems to have done the trick. Thank you very much!


Yes, thanks, I had the same problem and this fixed it as well for me. Basically, replace \W with $(basename $PWD).
Back to top
View user's profile Send private message
oumpah-pah
Guru
Guru


Joined: 18 Jul 2004
Posts: 575
Location: Lausanne, Switzerland

PostPosted: Sun Jun 19, 2005 7:32 pm    Post subject: Reply with quote

I think
Quote:
PS1='\[\033[01;31m\]\h \[\033[01;34m\]${PWD/\/*\/} \$ \[\033[00m\]'

would be a better solution, since it doesn't call basename everytime the prompt is printed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
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