From 16a745958ba989292987bded5ae6a6188d775d46 Mon Sep 17 00:00:00 2001 From: David Florness Date: Sat, 18 Jul 2026 11:25:03 -0400 Subject: [PATCH] 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-, 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 --- lisp/keys.el | 8 ++++++++ straight/versions/default.el | 1 + 2 files changed, 9 insertions(+) diff --git a/lisp/keys.el b/lisp/keys.el index 1c56bbc..9f6503b 100644 --- a/lisp/keys.el +++ b/lisp/keys.el @@ -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-, +;; 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)) diff --git a/straight/versions/default.el b/straight/versions/default.el index 7b87b3e..1d6e635 100644 --- a/straight/versions/default.el +++ b/straight/versions/default.el @@ -72,6 +72,7 @@ ("hydra" . "59a2a45a35027948476d1d7751b0f0215b1e61aa") ("inheritenv" . "b9e67cc20c069539698a9ac54d0e6cc11e616c6f") ("just-ts-mode.el" . "6b4b23fcc6f0f0d0903e84c51771d43c06a00771") + ("kkp" . "82b7443e10a2ba287467b62e90b6adb6dd93dc99") ("kotlin-mode" . "fddd747e5b4736e8b27a147960f369b86179ddff") ("kubel" . "ceb35d50e7ff736a7a707e22407cd9542bf50ffd") ("let-alist" . "a331a39b02da002c6c570c4960106454f88a99a5") -- 2.38.4