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

Re: problem with bold prompt



On 30 Jan 1997, willday@xxxxxxxxxxxxxxxxxx (Will Day) wrote:
> This is a problem I've been fighting with for a long time, and which I only
> recently began to grasp, when it got worse after I upgraded from 2.5.03 to
> 3.0.2. :) 
> 
> My prompt is defined as:
> 	export PS1="^[[1m${HOSTNAME}:^[[m%d) "
> so that it appears as:
> 	rom:/home/willday)
> where the "rom" is bold.
> 
> It looks like zsh is counting the formatting characters as printable
> characters on the command-line.  Under 2.5.03, this would screw up
> command-recall, and ctrl-U line clearing.  

Put the formatting characters inside %{ %} pairs:
  export PS1="%{^[[1m%}${HOSTNAME}:%{^[[mi%}%d) "
this tells zsh not to count them.
-- 
Aaron Schrab    <mailto:aarons@xxxxxxxxxx>    <http://www.execpc.com/~aarons/>
Exec-PC Internet Systems Administration <mailto:info@xxxxxxxxxx> for auto info



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