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

Re: Bug with the new prompt redraw code



Bart Schaefer wrote:
> Instead it has the effect of printing a garbage prompt.  This appears to 
> occur because (1) zle-line-init runs before the prompt is displayed, which 
> seems odd but wouldn't be a big deal except that (2) the prompt printing 
> code has stashed a pointer to the value of $PS1, which ends up pointing at 
> reclaimed memory when PS1 is re-assigned.

It sounds like a general problem with reassigning prompts in zle.

How about passing the address of the prompt variable (the internal one,
i.e. prompt, rprompt, etc., not the parameter) to zle instead of the
prompt itself?  That would have the useful side effect that changes
to the variable were reflected when updating.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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