LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   xterm - how to go onto next line when end of current line is reached? (https://www.linuxquestions.org/questions/linux-newbie-8/xterm-how-to-go-onto-next-line-when-end-of-current-line-is-reached-780699/)

gavinz 03-15-2010 03:42 PM

Have you tried my suggestion? Did it work?

devnull10 03-15-2010 04:10 PM

Hi,
Sorry I didn't see your previous reply - I may well owe you a pint though! :)
I tried setting PS1 to just "> " and did some typing and it worked fine! Woohoo!!!
However - I can't seem to get my PS1 prompt to display correctly...

This is how it is currently in my .bashrc:

Code:

export PS1="\e[0;31m\H \e[0;34m\W\e[m $ "
I've tried several combinations but I think I'm missing a trick somewhere - I'm not great with bash special characters!

gavinz 03-21-2010 04:32 AM

Quote:

Originally Posted by devnull10 (Post 3899473)
Hi,
Sorry I didn't see your previous reply - I may well owe you a pint though! :)
I tried setting PS1 to just "> " and did some typing and it worked fine! Woohoo!!!
However - I can't seem to get my PS1 prompt to display correctly...

This is how it is currently in my .bashrc:

Code:

export PS1="\e[0;31m\H \e[0;34m\W\e[m $ "
I've tried several combinations but I think I'm missing a trick somewhere - I'm not great with bash special characters!

I've tried both your current PS1 (which breaks), and the following one, which seems to work correctly:
Code:

export PS1="\[\e[0;31m\]\H \[\e[0;34m\]\W\[\e[m\] $ "
(I believe that the reason that I missed out "\[" and "\]" before was that I had a missing termcap entry for one of my terminals on an old installation, and it worked slightly better without them. This is no longer the case so I can do it properly now.)

devnull10 03-21-2010 05:41 AM

Top man, that works great.
Cheers!


All times are GMT -5. The time now is 08:36 AM.