Fix termios-cc API for SBCL 2.5.x, demo exits cleanly if raw mode fails

make-raw-termios (input.lisp:66-67): termios-cc accessor in SBCL 2.5.x
takes one arg (the struct) and returns the cc array.  Use (aref ...)
to set individual control characters.  Old code used 3-arg setf form
that no longer works and produced style warnings.

demo.lisp: Now exits with a clear error message when raw mode can't
be established, rather than running in broken pipe-safe mode where
escape sequences are echoed and input is line-buffered.
This commit is contained in:
Hermes
2026-05-12 01:30:09 +00:00
parent 517b43b801
commit 4594d40a9c
2 changed files with 7 additions and 3 deletions

View File

@@ -126,7 +126,10 @@
(defun run-demo ()
(let ((saved (ignore-errors (set-raw-mode))))
(unless saved
(format *error-output* "Failed to set raw mode, trying pipe-safe mode~%"))
(format *error-output* "~&ERROR: Cannot set terminal to raw mode.~%")
(format *error-output* " Make sure you are in a real terminal (not a pipe/redirect).~%")
(format *error-output* " Try: sbcl --script demo.lisp~%")
(return-from run-demo))
(unwind-protect
(progn
(init-app-state)