`M-<backspace>` not working with Emacs and Kitty
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.
Same for M-
Try this: (global-set-key (kbd "M-<backspace>") (lookup-key (current-global-map) (kbd "ESC DEL")))
I ran into the same issue. Without kkp, M-backspace gets remapped to M-DEL, which is then bound to backward-kill-word. For some reason, kkp blocks the remap. @douo's suggestion to bind M-backspace directly to backward-kill-word is a good workaround. Here's my setup using use-package:
(use-package kkp
:bind
;; https://github.com/benjaminor/kkp/issues/13
("M-<backspace>" . backward-kill-word) ; should be remapped to "M-DEL"
:config
(global-kkp-mode 1))
That being said, kkp is a nifty little package, thanks for creating it!
Hi, I pushed a fix for this in commit 4f7993a65729eb38b9fa4c2c341353b979bfbe76.
The reason M-<backspace> is not mapped to backward-kill-word is that actually M-DEL is the key mapped to backward-kill-word.
On normal terminals without kkp, M-<backspace> is transmitted to the terminal directly as M-DEL. On x frames, there is a x-alternatives-map which is added as a parent to local-function-key-map and which translates M-<backspace> to M-DEL. I added a similar kkp-alternatives-map which should now do the same job.
I will try the fix out over this weekend. Thanks!
I see "M-DEL runs the command backward-kill-word" reported when using describe-key.
Thanks!
Thanks for testing! I'll close this now, if anyone experiences this issue again feel free to reopen or open a new issue.