gord-project / gord

The Discord terminal client you never knew you wanted.
https://yellowsink.vercel.app/project/gord
BSD 3-Clause "New" or "Revised" License
65 stars 6 forks source link

Word-jump with ctrl+cursor keys #21

Open dromer opened 3 years ago

dromer commented 3 years ago

What do you want

Jump words in the text-field

Why

Most text editors, terminals and chat clients allow this. And it allows for much easier editing.

yellowsink commented 3 years ago

Which terminal are you using?

dromer commented 3 years ago

Terminator, but I run the client on a remote server inside tmux. I now realize that it does work outside of tmux. Interesting.

In tmux I use the set-window-option -g xterm-keys on setting to enable this. However it seems this conflicts with gord somehow?

yellowsink commented 3 years ago

Does your setup actually allow ctrl-arrows to reach Gord? I know for example that ctrl-shift-arrows to select words works on everything except Kitty - Kitty reserves ctrl-shift for its own shortcuts.

dromer commented 3 years ago

I use ctrl+arrows in irssi and my editors. I don't see why they wouldn't reach gord as well?

yellowsink commented 3 years ago

I wonder if tmux uses it for switching panels or something hmm.

Hold on imma do some testing.

yellowsink commented 3 years ago

ok i think i know whats happening - the terminal's escape codes for left and right are not understood by tmux?

image

yellowsink commented 3 years ago

I know I had issues with this exactly in zsh for a while. Perhaps that's the reason?

dromer commented 3 years ago

I don't use zsh, but regular old bash (5.0.3(1)-release)

yellowsink commented 3 years ago

Yeah but my point is that perhaps tmux is simply not understanding the word-left and word-right signals sent by the terminal. This is usually a localisation issue.

dromer commented 3 years ago

Hmm, well set-window-option -g xterm-keys on should fix this (which it does for everything else, like bash, vim, irssi)

yellowsink commented 3 years ago

Weird.

dromer commented 3 years ago

Hmm, I think that sends different key codes: https://github.com/SynologyOpenSource/tmux/blob/master/examples/xterm-keys.vim (<< not actual tmux source-code though)