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

Re: The curious incident of the feep in the night-time



On Thu, Apr 29, 2021 at 11:27 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> An actual interrupt signal causes getbyte() to behave as if no
> keystroke were entered [...], sendbreak() eventually returns
> whatever keystroke(s) initiated the widget

More accurately, on sendbreak() the keystrokes have already been
returned, and used to select the widget.

This brings us to the final (I hope) complication, which is that when
a built-in widget is run by execzlefunc() any result stored in lastval
is retained, whereas invoking a user-defined widget passes noreturnval
= 1 to doshfunc() which causes lastval to be overwritten by the saved
value from before the function was invoked.  This spoils a scheme I
briefly considered wherein running
  zle send-break 75
(for example) would cause $? to be set to 75.  I suppose it's best to
drop that idea and leave noreturnval as it is, because as it happens
there are no builtin widgets that change lastval.

A question for anyone still following this:  Is it acceptable/desirable that
  { zle send-break } always {
    TRY_BLOCK_ERROR=0
    TRY_BLOCK_INTERRUPT=0
  }
causes the send-break to be disregarded?  Or should send-break in fact
have its own not-clearable state?




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