fix: backend-size (TIOCGWINSZ), kitty keyboard enable, Wayland clipboard, SIGWINCH handler

This commit is contained in:
Hermes Agent
2026-05-12 13:49:23 +00:00
parent bb1717a43d
commit 26ec1dfbe8
4 changed files with 37 additions and 5 deletions

View File

@@ -15,6 +15,8 @@
#:with-raw-terminal
;; Event reading
#:read-event
;; Terminal resize flag
#:*terminal-resized-p*
;; TextInput
#:text-input #:make-text-input
#:text-input-value #:text-input-cursor

View File

@@ -318,6 +318,20 @@ key event rather than blocking indefinitely."
(t
(make-key-event :key :unknown :code b :raw (string (code-char b)))))))
;;; ---------------------------------------------------------------------------
;;; SIGWINCH handler for terminal resize
;;; ---------------------------------------------------------------------------
(defvar *terminal-resized-p* nil
"Set to T by SIGWINCH handler when terminal is resized.
Applications should check and clear this flag each frame.")
#+sbcl
(eval-when (:load-toplevel :execute)
(sb-sys:enable-interrupt sb-posix:sigwinch
(lambda (signal info context)
(declare (ignore signal info context))
(setf *terminal-resized-p* t))))
;;; ---------------------------------------------------------------------------
;;; Backend integration
;;; ---------------------------------------------------------------------------

View File

@@ -49,8 +49,13 @@ Components without a layout-node or position return nil."
(when *selection* (sel-text *selection*)))
(defun copy-to-clipboard (text)
#+linux (sb-ext:run-program "xclip" (list "-selection" "clipboard")
:input text :wait nil)
#+linux
(cond
((sb-ext:posix-getenv "WAYLAND_DISPLAY")
(sb-ext:run-program "wl-copy" nil :input text :wait nil))
(t
(sb-ext:run-program "xclip" (list "-selection" "clipboard")
:input text :wait nil)))
#+darwin (sb-ext:run-program "pbcopy" nil :input text :wait nil))
;;; --- Selection tracking (mouse drag) ---------------------------------------