v1.0.0: TUI support — resize events, with-terminal macro
- read-event now checks *terminal-resized-p* and returns :resize on SIGWINCH - Added with-terminal convenience macro (detect → init → body → shutdown) - Exported *terminal-resized-p* from cl-tty.input package - Exported with-terminal from cl-tty.backend package - Updated text-input.org with resize event integration and refactored tests - Tests: 461 checks, 100% pass (93 input suite, +2 new test cases)
This commit is contained in:
@@ -389,3 +389,21 @@
|
||||
(remhash :local *keymaps*)
|
||||
(is-false (gethash :global *keymaps*))
|
||||
(is-false (gethash :local *keymaps*)))
|
||||
|
||||
(test resize-event-check
|
||||
"read-event returns :resize when *terminal-resized-p* is set"
|
||||
(let ((b (make-instance 'cl-tty.backend:backend)))
|
||||
(setf cl-tty.input:*terminal-resized-p* t)
|
||||
(multiple-value-bind (type data) (cl-tty.input:read-event b :timeout 0)
|
||||
(is (eq :resize type))
|
||||
(is (consp data))
|
||||
(is (integerp (car data)))
|
||||
(is (integerp (cdr data))))
|
||||
(is-false cl-tty.input:*terminal-resized-p*)))
|
||||
|
||||
(test with-terminal-macro-expands
|
||||
"with-terminal macro expands and compiles"
|
||||
(is (macro-function 'cl-tty.backend:with-terminal))
|
||||
(let ((expanded (macroexpand-1 '(cl-tty.backend:with-terminal (be)
|
||||
(print be)))))
|
||||
(is (listp expanded))))
|
||||
|
||||
Reference in New Issue
Block a user