Raw terminal mode must be set by the parent process (the shell),
not from inside SBCL. sb-ext:run-program subprocesses cannot
reliably access the controlling terminal for stty operations.
./demo.sh sets raw mode via stty, runs sbcl --script demo.lisp,
and restores terminal state on exit (EXIT, INT, TERM).
demo.lisp no longer calls with-raw-terminal — it assumes the
calling shell has already set raw mode.
Added ./demo shell script that sets raw mode via stty before running
the Lisp demo and restores it on exit (including SIGINT/SIGTERM).
demo.lisp no longer attempts to set raw mode from inside SBCL —
terminal raw mode is the shell's responsibility. This avoids the
recurring problem of sb-ext:run-program + stty not being able to
access the controlling terminal from inside sbcl --script.
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.
No Quicklisp needed at all. Works from a fresh git clone with
just SBCL installed. Registering the current directory in ASDF's
central-registry is enough to find cl-tty.asd.
The demo now guards the quickload with a (find-package :cl-tty.backend)
check first, tries ql:quickload inside ignore-errors, and falls through
to direct (load cl-tty.asd) + (asdf:load-system :cl-tty) if the
package still isn't loaded. Works in --disable-debugger mode where
Quicklisp's SYSTEM-NOT-FOUND continuable error kills the process.
demo.lisp now registers the current directory as a quicklisp project
source and falls back to direct asdf:load-system if quicklisp can't
find cl-tty. Lets the demo run from a fresh git clone without
symlinking into ~/quicklisp/local-projects/.
demo.lisp:
- Removed ignore-errors wrapper: run-demo now returns normally,
followed by (uiop:quit 0) at top level — fixes exit code always 1 bug
- Manual set-raw-mode/unwind-protect/restore-terminal-state instead of
with-raw-terminal macro (safer in edge cases)
- Graceful fallback when raw mode fails: continues in pipe-safe mode
so the demo renders frames even without terminal control
- Simplified tab rendering, fixed textarea-lines display
The demo runs correctly in both interactive and pipe-safe modes.
In a real terminal: raw mode, keyboard/mouse event loop.
In pipe-safe mode: spins rendering frames (read-event returns nil).
Verified running: frames render correctly with borders, tabs, content,
status bar, and event counter.
- Three tabs: Home, Components, Stats with different content
- Real keyboard input: arrow keys to switch tabs, q to quit
- CSI escape sequence parsing for arrow keys
- Footer bar shows current tab position
- Tab bar highlights active tab in bright blue