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:
parent
8ded734477
commit
f54ceb35af
3 changed files with 11 additions and 5 deletions
|
|
@ -54,6 +54,8 @@
|
|||
"printf 'kill %%1\\r'" "sleep 0.5"
|
||||
"printf 'printf x | u\\r'" "sleep 1"
|
||||
"printf 'stty tostop; printf y | u; stty -tostop\\r'" "sleep 1"
|
||||
"printf 'li < /dev/tty\\r'" "sleep 1" "printf '\\003'" "sleep 0.5"
|
||||
"printf 'echo after $?\\r'" "sleep 0.5"
|
||||
"printf 'exit\\r'" "sleep 1"]
|
||||
"; "))
|
||||
(def command (str "(" keys ") | XDG_STATE_HOME=" state " script -qec 'dotnet src/main.exe' /dev/null"))
|
||||
|
|
@ -72,6 +74,8 @@
|
|||
(string-contains? out "history | tl 1 | g line\nhistory | tl 1 | g line\n"))
|
||||
(expect-true "a value command at the end of a job" (string-contains? out "printf x | u\nx\n"))
|
||||
(expect-true "and with tostop set" (string-contains? out "stty -tostop\ny\n"))
|
||||
(expect-true "Ctrl-C of a read of the terminal, and the next line runs"
|
||||
(string-contains? out "\nafter 130\n"))
|
||||
(expect-true "the history is saved"
|
||||
(match (file-read-text (path-combine state "bjosh/history"))
|
||||
((Ok text) (string-contains? text "kill %1"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue