View previous topic :: View next topic |
Author |
Message |
green sun Guru
Joined: 04 Nov 2002 Posts: 325 Location: Wista, MA
|
Posted: Tue Feb 18, 2003 5:57 pm Post subject: Bash Prompt Issues |
|
|
Ok, lets just start this out with the disclaimer that I'm no expert with bash by any means...
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 |
|
|
fifo Guru
Joined: 14 Jan 2003 Posts: 437
|
Posted: Tue Feb 18, 2003 9:57 pm Post subject: |
|
|
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 |
|
|
Mongoose5 n00b
Joined: 29 Jan 2003 Posts: 71
|
Posted: Tue Feb 18, 2003 10:09 pm Post subject: |
|
|
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 |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Wed Feb 19, 2003 12:32 am Post subject: |
|
|
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 |
|
|
green sun Guru
Joined: 04 Nov 2002 Posts: 325 Location: Wista, MA
|
Posted: Wed Feb 19, 2003 2:31 am Post subject: |
|
|
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 |
|
|
|