Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bash Prompt Issues
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
green sun
Guru
Guru


Joined: 04 Nov 2002
Posts: 325
Location: Wista, MA

PostPosted: Tue Feb 18, 2003 5:57 pm    Post subject: Bash Prompt Issues Reply with quote

Ok, lets just start this out with the disclaimer that I'm no expert with bash by any means... :D

I wanted to change my prompt in Konsole to be a bit more user friendly, so I added the following to my .bashrc
Code:

export PS1="\e[36;1m\T \e[32;1m\u@\h\e[33;1m/\w \e[32;1m\$>\e[37;1m "


Which gives me what I want for a prompt, but when I type in a long command string, the cursor jumps to the start of the prompt and begins to overwrite it. Is there something Im missing in my export command?
Back to top
View user's profile Send private message
fifo
Guru
Guru


Joined: 14 Jan 2003
Posts: 437

PostPosted: Tue Feb 18, 2003 9:57 pm    Post subject: Reply with quote

Try this instead:
Code:

export PS1="\[\033[01;36m\]\T \[\033[01;32m\]\u@\h\[\033[01;33m\]\w \[\033[01;32m\]\$>\[\033[00m\] "
Back to top
View user's profile Send private message
Mongoose5
n00b
n00b


Joined: 29 Jan 2003
Posts: 71

PostPosted: Tue Feb 18, 2003 10:09 pm    Post subject: Reply with quote

Here you go

Code:
export PS1="\[\033[36;1m\]\t \[\033[32;1m\]\u@\h\[\033[33;1m\]\w \[\033[32;1m\]\$>\[\033[00m\] "


edit ...
DOH, I guess somebody else filled this in while I looked at it...
Back to top
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Wed Feb 19, 2003 12:32 am    Post subject: Reply with quote

use single instead of double quotes, or double-escape the dollar sign (\\$ instead of \$) to make the $ become a # when logged in as root.

btw: how can you like those ugly colours? ;-)
Back to top
View user's profile Send private message
green sun
Guru
Guru


Joined: 04 Nov 2002
Posts: 325
Location: Wista, MA

PostPosted: Wed Feb 19, 2003 2:31 am    Post subject: Reply with quote

That did it.. thanks everyone. I'll go back & pour over it to make sure I understand why it works...

jukka wrote:
use single instead of double quotes, or double-escape the dollar sign (\\$ instead of \$) to make the $ become a # when logged in as root.

btw: how can you like those ugly colours? ;-)


Hmm? For everyone who doesnt try the prompt, time is in cyan, user & machine in green & pwd in yellow, with terminating prompt in green. On a black background the yellow stands out enough to give me the most important piece of info, where I am, and the green stands out only when I really look (I dont need to know *who* I am as often). I'll agree the color for time is blech... contrasts too much. I should poke around for a better one.
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