benjaminor / kkp Goto Github PK
View Code? Open in Web Editor NEWEmacs support for the Kitty Keyboard Protocol
License: GNU General Public License v3.0
Emacs support for the Kitty Keyboard Protocol
License: GNU General Public License v3.0
Hi there, thanks for writing kkp. I have a couple of questions and an issue.
I'm using ARCH, with emacs 29.2. I start emacs in daemon mode at startup of Hyprland, and then connect to it with emacs -nw
.
I have a tmux session open in kitty, if I hit kitty keyboard bindings (e.g. ctrl-shift-backspace), font size resets as the kitty configuration is setup, new tabs etc all work.
However, when I run (kkp-status)
invoked from emacs -nw
, it reports:
KKP not supported in this terminal
If I run it outside of tmux, I get the better response:
KKP supported in this terminal.
KKP active in this terminal. Enabled enhancements: report-alternate-keys and disambiguate-escape-codes
Two questions:
I ask the 2nd question, as when I try a key chord like c-s-c c-s-c
(which I have for multiple cursors) nothing happens, despite status telling me it's active.
In fact, non of my c-s-
bindings work with kkp enabled, so I'm wondering what I'm doing wrong.
My assumption was that enabling kkp would make emacs in kitty work like a native window, where c-s-
bindings would just work. Hoping that's what this does!
Many thanks.
I'm having issues getting the Delete key to work correctly. It seems that by default, with kkp (verified with emacs -q
), it maps to DEL
, which usually maps to backwards deletion instead of forward deletion.
I'm currently working around it with
(define-key (current-global-map) (kbd "<delete>") 'delete-forward-char)
but it feels both ugly and incorrect (modes often map it to variants of delete-forward
...)
The behavior is the same in both foot-1.15.1 and kitty-0.28.1. Using kkp 5652ba0)
Hi,
I'm running emacs in a remote server, the emacs is running as daemon server, and I use wezterm terminal with ssh to login the server, then use emacsclient to start a new frame. the wezterm already set "config.enable_kitty_keyboard = true", but when I run the command kkp-status in the emacs, I got below output:
KKP supported in this terminal.
KKP not active in this terminal.
So looks like wezterm is recognized as support kpp, but I can't enable emacs use the enhancement features. I wonder what could be wrong here?
the config I used to enable kpp:
(use-package kkp
:ensure t
:config
(global-kkp-mode +1)))
Before kkp
mode, C-S-o
produces [111;6u]
when pressed.
After kkp
mode, these key combinations will still produce certain codes instead of being interpreted as the corresponding key bind in emacs
.
kkp
version: 2023-04-03 from melpa
emacs
28.1 in kitty
0.21.2
I am using Emacs 29.3 and Kitty 0.35.1
. I have installed kkp
because a few key combinations do not work without it (Ctrl+'
).
M-<backspace>
is defined to be (backward-kill-word)
in Emacs. However, with kkp
and Kitty, I get M-<backspace> is undefined
. Could you please suggest how this can be fixed?
I see the behavior even without kitty.conf
.
After suspending emacs, then control-C in zsh produces the character sequence 9;5u (and other control characters produce similar sequences). I don't know all the details of kkp, but I suspect it's because the Kitty Keyboard Protocol doesn't get turned off when emacs is suspended?
Using the terminal to paste (with bracketed paste enabled) doesn't quite work. It inserts ร
(codepoint 200) before the pasted text, and ร
(codepoint 201) after the pasted text.
I see that you've been doing some work on this as well (98e13a2), but that's unfortunately not enough to get it working for me.
I started to look at this myself, but have so far only gotten to:
diff --git a/kkp.el b/kkp.el
index 621d314..7e8d8d2 100644
--- a/kkp.el
+++ b/kkp.el
@@ -392,7 +392,7 @@ key codepoint."
(cond
;; this protocol covers all keys with a prefix in `kkp--key-prefixes' except for this external one
- ((equal terminal-input "200~")
+ ((equal (concat terminal-input) "200~")
#'xterm-translate-bracketed-paste)
;; input has this form: keycode[:[shifted-key][:base-layout-key]];[modifiers[:event-type]][;text-as-codepoints]{u~}
This at least makes it match the opening paste sequence, something it didn't do before.
I thought I'd open issue now, before I spend too much time on something that may be obvious to you, or maybe something you're already working on.
Thanks for providing this package; it's really helpful: now I can remove tricky CSI configurations in kitty & foot.
However, I've encountered an issue with the keys that start with C-q
. For example, in both kitty & foot terminal:
C-q C-j
should insert a newline without any indent, but instead, it inserts ^[[106;5u]
.C-q C-M
should produce the special character ^M
, but it actually gives ^[[109;5u]
.Can you please provide some suggestions on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.