diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 23:34:16 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 23:34:16 -0800 |
commit | 5448159471ce57e751853b543a102cca8c6ee7f5 (patch) | |
tree | bad6abdedda522c475fbca93c0048f79c2b46e83 /ChangeLog-2009-2015 | |
parent | faacb12822488d6118f55f02c10887f9d670487c (diff) | |
download | txr-5448159471ce57e751853b543a102cca8c6ee7f5.tar.gz txr-5448159471ce57e751853b543a102cca8c6ee7f5.tar.bz2 txr-5448159471ce57e751853b543a102cca8c6ee7f5.zip |
listener: handle Ctrl-C interrupts from linenoise.
This is an issue that affects plain mode, because in full
editing mode, linenoise reads Ctrl-C as a character.
In plain mode, Ctrl-C-generated SIGINT behaves curiously.
The ^C characters appear, and the current line of input
is discarded. This is because the linenoise() call is not
enclosed in the catch region. The registered signa handler
goes off, and repl_intr is called. Thta function throws the
intr exception. Since that exception isn't derived from error,
and there is no handler for it, nothing happens. The signal
handler just returns.
In this fix, we move the linenoise call into the catch
region of the REPL loop, so the interrupt is handled. The
entire multi-line input is aborted, an ** intr message
is printed, and the REPL waits for another line.
Issues reportd by Paul A. Patience.
* parser.c (repl): Move the uw_catch_begin above the linenoise
call. This means that the surrounding code can no longer use
continue to continue the loop, or break to terminate. Instead
of "continue" we go to a new "contin" label placed at the
bottom of the catch processing, just before the end of the
loop. The EOF case now sets the done fag and also branches to
that label. Some free(line_w) calls no longer have to be done
because the unwinding block takes care of it. In the
exception catching block, we no actually check for the intr_s
exception.
Diffstat (limited to 'ChangeLog-2009-2015')
0 files changed, 0 insertions, 0 deletions