> Repeat-By: > With mintty terminal: > PS1='\h Hello everybody\n\e[1;35m\]Hi\e[0m\]>' > << cursor up >> > << cursor down >> > the line look like: > Hi>PS1='\h Hello > > With putty terminal (with default configuration): > with the same PS1, when the cursor is on the last line of the terminal > when I call back a long command (displayed on 2 or more lines) from > history > this line is badly displayed.
You need to properly indicate that the control codes are zero-width (by using \[ and \]). Without them, this is expected behaviour. Better, don't hardcode the escape codes for colours -- it is a naive assumption to believe that all terminals will do what you expect. Use `tput' instead. Best, Chris