fix: backend-size (TIOCGWINSZ), kitty keyboard enable, Wayland clipboard, SIGWINCH handler
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
;;; ---------------------------------------------------------------------------
|
||||
|
||||
@@ -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) ---------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user