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

Re: PS1 or PS2



On Jun 29,  5:09pm, Andrej Borsenkow wrote:
} Subject: RE: PS1 or PS2
}
} >
} > It almost works ...
} >
} > bor@itsrm2:~%> _Fn-up-line-or-history () {
} > function> [[ -n "$PREBUFFER" ]] && zle .push-line-or-edit
} > function> zle .up-line-or-history
} > function> }
} 
} After zle .push-line-or-edit both BUFFER and PREBUFFER are empty. Are they
} static values computed on the entry into widget or do they reflect real ZLE
} buffers?

I think they reflect real ZLE buffers.  The "problem" is with the way that
push-input/get-line (and consequently push-line-or-edit) are implemented:
They do something similar to

	print -z "$BUFFER"
	BUFFER=""

and then wait for zle_refresh() to come around and yank the buffer back.
So if you're entirely inside a zle widget (or a bindkey -s), you can't do
anything to the pushed input; it simply isn't there anymore until zsh has
a chance to print a prompt again.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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