Setting exteKeys in tmux prints raw keys codes in neovim #5924
Replies: 5 comments 3 replies
-
has anyone found a workaround for this? |
Beta Was this translation helpful? Give feedback.
-
What is
My guess is that the new-line characters are being encoded with modifyOtherKeys or the Kitty keyboard protocol, and Neovim doesn't support that unless it enabled it. |
Beta Was this translation helpful? Give feedback.
-
For my case, I'm using nvim inside of tmux with Ghostty. By default, it could not register the key in nvim, hence I will need to add the following config to my tmux config:
key works in nvim with the config, however, when I copy something like the following text:
And paste with Previously I was using iTerm2, it did not give me issue, I'm not sure where to start figuring out what caused this. I'm aware of bracketed pasting, but this issue only happens if I use |
Beta Was this translation helpful? Give feedback.
-
I think this is happening because tmux supports fixterms but not Kitty keyboard protocol. Or there is a bug somewhere in between. There is an issue in tmux for supporting kitty keyboard protocol but unfortunately it's closed: tmux/tmux#3335 This is the workaround that I found, which is not great but at least works, here's a diff in my tmux.conf: -set -s extended-keys on
+# FIXME: extended-keys doesn't work with ghostty at the moment:
+# https://github.com/ghostty-org/ghostty/discussions/5924
+# https://github.com/tmux/tmux/issues/3335
+# set -s extended-keys on
+
+# This is a workaround while the extended-keys doesn't work with ghostty.
+# https://github.com/listx/syscfg/blob/ec89be49694f1befeb8a2dedaa46001632e41360/tmux/.tmux.conf#L360-L361
+# From https://github.com/alacritty/alacritty/pull/5358#issuecomment-1309433644
+bind-key -T root C-S-j send-keys Escape "[106;6u"
+bind-key -T root C-S-k send-keys Escape "[107;6u" So basically I had to remove the |
Beta Was this translation helpful? Give feedback.
-
I can confirm this after doing the same setup as OP. On the other hand, forgiving my naive question: What are those neovim keybinds you're using that need |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am using tmux with ghostty and have set the
set-option -g extended-keys always
to ensure that the modifier keys likeShift
andCtrl
are correctly recognised and work inside neovim.This work fine where the neovim mappings for
Shift
andCtrl
work correctly however I am noticing a weird side effect of setting the ``set-option -g extended-keys always` that whenever I paste something inside neovim within a tmux session it prints raw keys codes along with it.For example the below text
when pasted in neovim within tmux is rendered as
Doing quick check show that ghostty does not have support for
extkeys
and hence this issue seems little obvious.So I was wondering if there is a way to fix this or is this support planned for future ?
Beta Was this translation helpful? Give feedback.
All reactions