Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PROMPT escape sequences



On Monday 2007-10-08 10:40 +1000, Bart Schaefer output:
:On Oct 7, 11:34pm, Atom Smasher wrote:
[...]
:} PS1='%{^[[36m%}%# '
:This enters cyan coloring mode but does not leave it again.

:So the answer to this question is:
:} is there a way to set a color at the prompt that doesn't reset to default 
:} when i tab-complete?
:No, there isn't, because you're relying on the entire prompt being re-
:painted every time zsh needs to redraw the line that begins with the

I (obviously) don't understand what the desired result is.  Ah, OK, 
now I've tried with alwayslastprompt it becomes clearer.

The only stored character attributes (currently) from the prompt are
bold, standout and underline.  If you use one of those (I use bold for
my main text) then you should also be setting POSTEDIT appropriately,
e.g.  POSTEDIT=`print -P -n %b`  # note that %b turns off all attributes

:It "works" for %S because of a quirk in the way some terminals (xterm
:included) implement "standout mode", not because of anything zsh does
:differently.

Well, actually, it should be handling these correctly.  For bold, standout
and underline.

Regards,
Geoff



Messages sorted by: Reverse Date, Date, Thread, Author