[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PS1 multiline with colors
From: |
Chris Down |
Subject: |
Re: PS1 multiline with colors |
Date: |
Fri, 5 Jul 2013 00:50:53 +0800 |
> 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
- PS1 multiline with colors, BASTIDON , Stéphane, 2013/07/04
- Re: PS1 multiline with colors,
Chris Down <=
- Re: PS1 multiline with colors, Greg Wooledge, 2013/07/05
- Message not available
- Re: PS1 multiline with colors, Greg Wooledge, 2013/07/05
- RE: PS1 multiline with colors, BASTIDON , Stéphane, 2013/07/05
- Re: PS1 multiline with colors, Linda Walsh, 2013/07/08
- Re: PS1 multiline with colors, Dan Douglas, 2013/07/09
- Re: PS1 multiline with colors, Geir Hauge, 2013/07/09
- Re: PS1 multiline with colors, Dan Douglas, 2013/07/05