From 613e4b6217d176885e0bcf8b070bf8f129e46e2e Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 12 May 2026 01:42:15 +0000 Subject: [PATCH] stty via /bin/sh -c + stdin redirect instead of -F /dev/tty The -F flag isn't available on all stty implementations. Using shell stdin redirect (stty ... < /dev/tty) via /bin/sh is more portable and doesn't depend on run-program preserving the controlling terminal across subprocess boundaries. --- src/components/input.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/input.lisp b/src/components/input.lisp index 48af8eb..b25d54e 100644 --- a/src/components/input.lisp +++ b/src/components/input.lisp @@ -45,10 +45,12 @@ ;;; Terminal raw mode (stty on /dev/tty — portable across Unices) ;;; --------------------------------------------------------------------------- (defun stty-run (args) - "Run stty with ARGS on the controlling terminal. Returns stdout as string." + "Run stty with ARGS. Returns stdout as string." (with-output-to-string (s) - (sb-ext:run-program "stty" (append '("-F" "/dev/tty") args) - :output s :input :stdin :wait t))) + (sb-ext:run-program "/bin/sh" + (list "-c" (format nil "stty ~{~a~^ ~} < /dev/tty" + (mapcar #'princ-to-string args))) + :output s :wait t))) (defun save-terminal-state () "Save current terminal settings via stty -g. Returns a string."