sigildocs

(sigil tui terminal)

(sigil tui terminal) - Terminal control layer

Wraps native terminal primitives with Scheme-level conveniences for raw mode, alternate screen, mouse tracking, and terminal queries.

Exports

Switch to the alternate screen buffer.

Switch back to the normal screen buffer.

Enable SGR extended mouse tracking.

Disable mouse tracking.

Get the number of terminal columns.

terminal-rowsprocedure

Get the number of terminal rows.

with-terminalprocedure

Run a thunk with the terminal in raw mode and alternate screen.

Sets up raw mode, alternate screen, and hidden cursor on entry. Restores everything on exit (normal or exception).

(with-terminal
  (lambda ()
    ;; Terminal is in raw mode, alternate screen active
    (terminal-write-raw "Hello from raw mode!")
    (let loop ()
      (let ((input (terminal-read-raw 64)))
        (when input (loop))))))