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

Re: Prompt coloring question



On Jul 13,  3:37pm, Richard Hartmann wrote:
} Subject: Re: Prompt coloring question
}
} On Sun, Jul 13, 2008 at 04:23, Phil Pennock
} <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
} 
} > Define invert?  The sequence you provide is a reset to default and
} > normal red text, so you'll need to be clearer about what you want and
} > what you tried, instead of what you started from.
} 
} I want to use %S and %s to invert the user name so I know I am on a
} remote system. While I can easily invert other colors, like light green
} ( $'%{\e[1;32m%}' ), I can't invert red.

Read again what Phil wrote.

$'%{\e[1;32m%}' is not "light green", it's "bold green" -- the "1" is
bold, the "32" is green.  Similarly, $'%{\e[0;31m%}' is not "red", it's
"turn everything else off" (0) and then "red" (31).  That first "0"
disables %S before it has a chance to do anything.  If you were to use
%S%{$'\e[31m'%} without the "0;" it would work as expected.



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