View Full Version : shell prompt, new line

29th May 2006, 10:58 AM
Hi. I was playing around with the bash_aliases and bashrc options a while back to make a few changes to the behaviour of my shell prompt. Now I have a small problem.

When I type a really long line at the shell prompt, when the command reaches the end-of-the-line it then begins displaying the next characters over top the beginning-of-the-line instead of on a new line below. Of course I can still execute the command as desired but it makes reading and editing the command very difficult.

I have not been able to find any help on this on Google because I do not know what to call this problem. But if anyone knows how I might be able to resume the new-line display of long commands in my shell your help would be greatly appreciated!


29th May 2006, 12:12 PM
hi kenm_uk,

i also had that problem using FC4 sometimes but dont now have it in CentOS. so I would think it is either a bug in bash or wrong settings (although I wasn't able to find it).

for a long line at the shell prompt you can use \

for example:
$ cd ;\
> vi \
> .bashrc

30th May 2006, 12:32 PM
Thanks for your reply. I think I have paritally found the answer. Several weeks ago I added to my bash_aliases file the line:

#PS1='\e[31m[\u@\h \W \! \#]\e[34m$\e[0m '
in order to change the color of my bash prompt which is what seems to have caused the problem. Since removing this line, long commands at the bash prompt now wrap to a new line correctly.

So my question is, where do I change the appearance of my bash prompt without messing up the wrap-to-new-line functionality?


30th May 2006, 12:47 PM
hi kenm_uk,

your entry was not really correct. :(

there is a lot of bash tutorials in the web, for example:

I would not explain it better than there! :D