ghostty/tests.lisp
defpackage#:luv.ghostty.tests
:use#:cl#:rove
:local-nicknames
#:ghostty#:luv.ghostty
in-package#:luv.ghostty.tests
deftestvt-input-round-trips-through-plain-formatter
ghostty:with-terminal
terminal:columns24:rows4
ghostty:write-terminalterminal
formatnil"Hello, ~C[1;32mGhostty~C[0m!~C~CSecond line"
code-char27
code-char27
#\Return#\Newlineok
deftestkey-encoding-follows-live-terminal-modes
ghostty:with-terminal
ghostty:with-key-encoder
encoder
ok
ok
ok
equal'
1
coerce
ghostty:encode-key-eventencoderterminal:press:a:modifiers'
'list:control
:text"a":unshifted-codepointchar-code#\a
defmacro with-terminal
((variable &rest initargs) &body body)defclass terminal
An explicitly owned libghostty-vt terminal.
defun write-terminal
(terminal text)defun terminal-text
(terminal)defun make-terminal
(&key (columns 80) (rows 24))defun terminal-open-p
(terminal)defun close-terminal
(terminal)define-arithmetic-operator not
Logical negation of one test or raw truth value.
defmacro with-key-encoder
((variable) &body body)defun encode-key-event
(encoder terminal action key
&key modifiers consumed-modifiers text unshifted-codepoint composing-p)Encode one physical key fact using TERMINAL's current keyboard modes. ACTION is :PRESS, :REPEAT, or :RELEASE. KEY is a Ghostty/W3C physical key keyword. MODIFIERS use :SHIFT, :CONTROL, :ALT (or :META), and :SUPER. TEXT is layout-produced printable text; UNSHIFTED-CODEPOINT is its base codepoint.