benjaminor / kkp

Emacs support for the Kitty Keyboard Protocol
GNU General Public License v3.0
39 stars 6 forks source link

Not working as intended? #4

Closed Inc0n closed 1 year ago

Inc0n commented 1 year ago

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

benjaminor commented 1 year ago

Hi, according to the kitty documentation (https://sw.kovidgoyal.net/kitty/conf/#shortcut-kitty.Pass-selection-to-program), C-S-o is caught by kitty itself and mapped to pass_selection_to_program. With kitty, my emacs does not receive C-S-o neither with or without kkp. Using foot, C-S-o is recognized with kkp in emacs.

Inc0n commented 1 year ago

I see there is foot, that I could use. However, I did have clear_all_shortcuts set to yes. And with C-S-o not set to anything. I guess this may be a difficult case to get through.

benjaminor commented 1 year ago

Have you bound C-S-o to a command?

With a vanilla emacs-28.2 with kkp installed, kitty.conf only set to clear_all_shortcuts yes and global-kkp-mode activated, M-x describe-key recognizes C-S-o:

Furthermore, view-lossage shows me ESC [ 1 1 1 : 7 9 ; 6 u which is the keycode expression for C-S-o.

What does your view-lossage (C-h l) show after pressing C-S-o?

Inc0n commented 1 year ago

Hi benjaminor, thanks for the detailed instruction. First of all apology for C-s-o, I meant S for super, but it is shift. I have noticed this error just now.

I realized I have left out an important detail, all of the issue listed here are produced in an emacs session started in a ssh session run on kitty... This is important because the behavior is different in emacs in kitty and emacs in ssh session in kitty.... As I have just discovered.

Anyways... C-s-o (super) is not bounded to anything within my laptop Desktop Environment (I run ubuntu here). Neither is it bounded to any interactive commands. C-s-o (super) is detected as u with describe-key-briefly in kitty ssh emacs. view-lossage also confirm as u.

Key combination that shows up as the werid code is C-S-n (control-shift-n), which shows as ESC [ 1 1 0 ; 6 u.

Then I enabled global-kkp-mode, the key code get inserted into the buffer I am currently editing (which is also its previous behavior...)

kkp-print-terminal-support prints out KKP supported in this terminal.

It is more convenient to have emacs running in the ssh session within kitty, but I can also work my ways around it. It is not the end of the world if this couldn't get fixed :)

Thanks, Inc0n

Inc0n commented 1 year ago

In my last comment, I mentioned terminal emacs in kitty and terminal emacs from an ssh session within kitty.

The behavior differs in how keys with super is registered properly or not... C-s-o is u in ssh, but a [ x x x ; x u key code in normal emacs kitty session.

However, besides that it also is not working with kkp enabled ...

benjaminor commented 1 year ago

Sorry @Inc0n, I still cannot reproduce the issue.

When I ssh into my own device via localhost, and then execute describe-key with C-s-o, I get the message "C-s-o is undefined" and view-lossage shows me ESC [ 1 1 1 ; 1 3 u, which is how it should be.

Can you give me a recipe to reproduce the issue with a clean Emacs (only kkp installed)?

benjaminor commented 1 year ago

Closing due to inactivity. Feel free to reopen if issue persists!

Inc0n commented 1 year ago

@benjaminor Ah sure, thanks for debugging with me. In the end I just resort to GUI emacs on local machine and tramp :)