fix: set stty -icanon -echo in bash script before exec sbcl

uiop:run-program inside SBCL can't access the terminal, so stty
calls from within Lisp fail silently. By running 'stty -icanon -echo'
in the bash script before exec sbcl, the terminal is already in
character-at-a-time mode when the TUI starts, and Ctrl+P/B keys
arrive as individual bytes through the cat pipe.
This commit is contained in:
2026-05-14 15:39:05 -04:00
parent 84ef4c3443
commit 345f3f397d
2 changed files with 5 additions and 6 deletions

View File

@@ -910,12 +910,8 @@ Event handlers + daemon I/O + main loop.
;; breaks read on fd 0 in this SBCL environment, but -echo alone
;; works. A cat subprocess inherits the terminal and provides
;; bytes through a pipe that SBCL reads reliably.
;; Enable character-at-a-time input (-icanon) so Ctrl+P/B
;; arrive as individual bytes instead of being buffered.
;; SBCL now reads from cat's pipe, not directly from fd 0,
;; so -icanon doesn't trigger the SBCL read block issue.
(uiop:run-program '("stty" "-icanon" "-echo")
:output nil :ignore-error-status t)
;; stty -icanon -echo is set by the bash script before exec sbcl.
;; A cat subprocess reads keyboard input from the terminal.
(let* ((cat-proc (uiop:launch-program '("cat")
:output :stream
:input :interactive