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

RE: PS1 or PS2



> > 
> > would do quite nicely ... but how can I find out (in user defined 
> widget) that I
> > am on PS2? The info is available (push-line-or-edit has it) - is it 
> possible to
> > make it available to user widgets as well?
> 
> I haven't tried, but [[ -z "$PREBUFFER" ]] should work.
> 

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> }
bor@itsrm2:~%> zle -N up-line-or-history _Fn-up-line-or-history
bor@itsrm2:~%> while true
while> <CursorUp>
beeps and I get
bor@itsrm2:~%> while true
<<< cursor here

That is, zle .up-line-or-history seems to be never executed.

/andrej



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