Ctrl-C of a value command that reads a terminal or a FIFO

The file of < is opened with #:cancellable? #t, so Ctrl-C of
li < /dev/tty takes nothing from the terminal, and the next line goes to
the editor. tests/interactive.bjo checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-12-01 08:13:20 +01:00
parent 8ded734477
commit f54ceb35af
3 changed files with 11 additions and 5 deletions

View file

@ -280,10 +280,10 @@ the text above:*
after one with ~>~ is an error. ~2>~, ~2>&1~, assignments and ~&~ of
value commands are errors.
- A pipe of only value commands runs in the shell, with an empty input
or the file of ~<~. Ctrl-C cancels it with status 130, but only at a
point where a command waits for a value: a read of a terminal or a FIFO
(~li < /dev/tty~) is not cancelled, and goes on until it has a line.
There is no test of Ctrl-C: no value command waits long otherwise.
or the file of ~<~. Ctrl-C cancels it with status 130. The file of ~<~
is opened with ~#:cancellable? #t~, so a cancelled read of a terminal or
a FIFO (~li < /dev/tty~) takes nothing from it, and the next line goes to
the editor (Linux only). tests/interactive.bjo checks this.
- ~jobs~ and ~history~ are values in a pipe: records of number, current,
state, command and id; and of number and line. Alone they write text.
- ~2>&1~ is done (phase 3): ~>FILE 2>&1~ works, ~2>&1 >FILE~ is an error.