~edwargix/emacs.d

16a745958ba989292987bded5ae6a6188d775d46 — David Florness 2 months ago 854b0a6
Enable Kitty Keyboard Protocol via kkp

Terminal frames (e.g. those opened with 'emacsclient -t') can only send
key combinations that fit into legacy terminal escape codes, so many
bindings that work in GUI frames silently fail there. In particular, the
C-S-s binding for shell-pop (eshell) in lisp/misc.el was unreachable from
a -t frame.

kkp negotiates the Kitty Keyboard Protocol with terminals that support
it, letting Emacs receive richer key events: C-M-S chords, distinct C-h
vs C-<backspace>, Hyper/Super, and more. Hooking global-kkp-mode onto
tty-setup enables it per-terminal, so each new emacsclient -t frame gets
it automatically, and it's a no-op on terminals that don't speak the
protocol.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 files changed, 9 insertions(+), 0 deletions(-)

M lisp/keys.el
M straight/versions/default.el
M lisp/keys.el => lisp/keys.el +8 -0
@@ 142,3 142,11 @@

;; override: list-buffers -> ibuffer
(global-set-key (kbd "C-x C-b") #'ibuffer)

;; Support the Kitty Keyboard Protocol so terminal frames (e.g. those opened
;; via `emacsclient -t') can send key combinations that plain terminal escape
;; codes can't represent -- C-M-S chords, distinct C-h vs C-<backspace>,
;; Hyper/Super, etc.  Only takes effect on terminals that actually speak the
;; protocol; check `kkp-status' in a given frame to confirm.
(use-package kkp
  :hook (tty-setup . global-kkp-mode))

M straight/versions/default.el => straight/versions/default.el +1 -0
@@ 72,6 72,7 @@
 ("hydra" . "59a2a45a35027948476d1d7751b0f0215b1e61aa")
 ("inheritenv" . "b9e67cc20c069539698a9ac54d0e6cc11e616c6f")
 ("just-ts-mode.el" . "6b4b23fcc6f0f0d0903e84c51771d43c06a00771")
 ("kkp" . "82b7443e10a2ba287467b62e90b6adb6dd93dc99")
 ("kotlin-mode" . "fddd747e5b4736e8b27a147960f369b86179ddff")
 ("kubel" . "ceb35d50e7ff736a7a707e22407cd9542bf50ffd")
 ("let-alist" . "a331a39b02da002c6c570c4960106454f88a99a5")