Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem with push-line-or-edit and precmd?
- X-seq: zsh-workers 26333
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh list <zsh-workers@xxxxxxxxxx>
- Subject: Re: problem with push-line-or-edit and precmd?
- Date: Fri, 16 Jan 2009 20:08:52 -0800
- In-reply-to: <18801.2149.303884.532633@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <18801.2149.303884.532633@xxxxxxxxxxxxxxxxxx>
On Jan 16, 5:21pm, Greg Klanderman wrote:
}
} Notice the precmd is run when the push-line-or-edit widget is invoked,
} and that $? is set to 1 in the precmd.
}
} Is it expected that precmd would be run here?
}
} And if so, why is a non-zero exit status set?
This is an admitted misfeature of the push-line-or-edit implementation,
which in order to accomplish its purpose of invoking the editor on the
multi-line buffer as a single editable region, does almost exactly the
equivalent of
print -z "$BUFFER"
zle send-break
This causes the current zle "session" to abort, which returns from the
PS2 or deeper prompt all the way to the top level, at which point the
editor re-initializes at the PS1 prompt and pops the buffer stack and
you're back where you want to be.
The side-effects of this include that a zle widget can't do anything
after push-line-or-edit (the widget forcibly exits), the status is
set to nonzero, and precmd runs because the editor has restarted, all
as if the user hit ctrl+c.
This is one case where a change would be welcome, if a better way could
be found to trash the entire nested editor context up from whatever
prompt level you're reached, and thereby reset at PS1.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author