1

My Bash prompt seems to be wrapping lines really inefficiently. Here is an example to show what I mean:

enter image description here

I would like the commands that I am typing to continue onto the next line if the command length exceeds the window size.

My PS1 variable in the bashrc file is:

PS1='\e[0;36m\u \W: \e[m';

Perhaps tweaking this will help?

1 Answer 1

3

Enclose the formatting sequences in escaped square brackets to let the terminal know that these characters aren't actually printed (for width calculations):

PS1='\[\e[0;36m\]\u \W: \[\e[m\]';

More details here in section Colors.

Edited to link to original submission on Meta, since whoever copied it to Blog.SU messed up pretty much everything.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .