Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-kitty-keyboard-protocol = true doesn't work with tmux #599

Closed
jZhangTk opened this issue Aug 18, 2024 · 15 comments
Closed

use-kitty-keyboard-protocol = true doesn't work with tmux #599

jZhangTk opened this issue Aug 18, 2024 · 15 comments

Comments

@jZhangTk
Copy link

Environment:

  • Apple M3
  • OS: Sonoma 14.6.1
  • Rio: Version 0.1.6 (20230528.115631)
  • Tmux: 3.4

I'm using the default config with only use-kitty-keyboard-protocol = true added. It works fine without tmux. However, once I launch tmux, it seems to stop working. E.g. I have a key mapping for ctrl-shift-t set up in Neovim, but it doesn't work when I use it within tmux.

@raphamorim
Copy link
Owner

Hey @jZhangTk thanks for the issue! Could you test with latest main?

@jZhangTk
Copy link
Author

Thanks for the update, @raphamorim. I followed the instructions here and confirmed that the version is 0.1.10 (20230528.115631), but the behavior is still the same.

@raphamorim
Copy link
Owner

Thank you for testing @jZhangTk! Very interesting, I tested Rio and Kitty key inputs and looks is correct at least. Wondering what could be

Screenshot 2024-08-27 at 16 05 56

@raphamorim
Copy link
Owner

I assume it does work with kitty right?

@raphamorim
Copy link
Owner

I did a bit of searching, and tested tmux with Kitty and Ghostty but looks the protocol doesn't really work there (at least with no configuration), found this as well tmux/tmux#3335

@jZhangTk
Copy link
Author

Interesting. It works fine for me on Kitty. What are you using to test the key press? I can test it on my side too.

@raphamorim
Copy link
Owner

ah if it does work with kitty terminal then is likely to be a bug in Rio.

I use the kitty cli https://sw.kovidgoyal.net/kitty/invocation/ , there's a command that I can test the inputs kitty +kitten show_key -m kitty

can you send me your tmux configuration as well? I will try to reproduce here

@jZhangTk
Copy link
Author

When I was testing it, I commented out everything in tmux.conf, so you don't need any tmux configuration. For Kitty, I also commented out everything except for kitty_mod ctrl+shift+alt so I can use ctrl+shift.

I'm going to test the key press later today and let you know.

@jZhangTk
Copy link
Author

I'm not sure if I did it right. I tried to run kitty +kitten show_key -m kitty in tmux for both Rio and Kitty, but it behaves very strangely compared to no tmux. When I press a key, it only responds with Text: and nothing else. One thing I noticed is that when I press c-s-t, Rio displays the same Text:, but Kitty does not show anything, as if no key has been pressed, so they do act a little differently.

I should have provided this earlier. Here are the steps I'm using to test if c-s-t works.

  1. Add this line to neovim init.lua
-- reopen a closed tab
vim.keymap.set('n', '<C-S-t>', '<cmd>tabnew#<CR>', { noremap = true, silent = true })
  1. Open neovim in tmux
  2. Press c-s-t
  3. Notice that Rio and Kitty shows different messages (Rio acts as c-t is pressed)

Rio
image
Kitty
image

@siimon
Copy link

siimon commented Dec 19, 2024

I have a similar issue with meta key not working in my nvim bindings, similar setup and they also work in Kitty but not in Rio!

@raphamorim raphamorim moved this from Todo to In Progress in Rio terminal 0.2.x Dec 19, 2024
@raphamorim
Copy link
Owner

@jZhangTk sorry took a while, tried to reproduce it again.

Few notes, ghostty and alacritty doesn't work as create tab either and more important kitty create a new tab having the keybinding or not. If I have a fresh tmux/nvim (no configuration whatsoever) and run C-S-t it will create a new tab anyway.

@jZhangTk
Copy link
Author

jZhangTk commented Jan 6, 2025

Thanks for looking into it, @raphamorim. It's definitely not working in Kitty now. Something must have changed on the Kitty side.

I'm actually fine without supporting C-S-t now since I've remapped it to M-t, but one thing to note is that M-t works with the same setup in Kitty, Ghostly, and Alacritty, but not in Rio.

@raphamorim
Copy link
Owner

Ok I did some refactors, a lot of stuff was weird tbh.
Could you try again? 🙏

@jZhangTk
Copy link
Author

Thanks @raphamorim. This is working now 🎉

@github-project-automation github-project-automation bot moved this from In Progress to Done in Rio terminal 0.2.x Jan 16, 2025
@raphamorim
Copy link
Owner

Let’s gooo
Thank you for testing @jZhangTk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants