-
Notifications
You must be signed in to change notification settings - Fork 3k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for CSI u
bindings
#5358
Conversation
Also, if this binding-based approach is correct, I'd gladly extend it to more modifiers - I've started with just a few to get a sneak peek. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt a keybinding-based solution to this could ever provide any meaningful solution.
Limiting things to just 0-9/A-Z just isn't sufficient, that barely helps with Ctrl+Shift but that's about it. I don't think it would be in the spirit of the protocol to half-ass it like this.
I'd have to check some other implementations to get some insights on the common limitations/approaches taken, but I doubt they usually define all the bindings manually. That would certainly create a massive matrix of bindings which quickly becomes a problem.
Hello, I just wanted to ask a question here because I am interested in native
We just want some functionality that converts the recognized keypresses (with or without modifiers) and sends the The "recognize keypresses with or without modifiers" bit seems to be in around alacritty/alacritty/src/input.rs Lines 799 to 807 in ec4dc32
|
@listx Hi; I've already checked this approach while trying to implement For instance, Kitty's approach is to have various levels of "what should be sent via CSI": from "some selected keystrokes", up to "everything"; but, if I understand it correctly, it still requires keeping some hard-coded keymap of "for the most basic level of So a tl;dr would be: a flag such as |
It makes sense to send
Maybe it's cleaner to make FWIW I've recently overhauled my own keybindings from Alacritty to Tmux to Emacs (all the way up the "stack" so to speak), and I've come to realize that even if Alacritty natively supported Anyway, coming back to the issue in this thread: I think Alacritty's system of allowing custom keybindings works so well that it makes native |
@listx I'm a noob to tmux; do you have sample config lines for this tmux parsing to bring back the |
Sure, have a look at https://github.com/listx/syscfg/blob/ec89be49694f1befeb8a2dedaa46001632e41360/tmux/.tmux.conf#L348. |
Closes #31011
The implementation is based on:
(there are many similar keybinding-repos for Alacritty, and there's nothing special about this one - just happened to be the first one that I stumbled upon, and I considered worth mentioning it.)
I've checked the keycodes we yield using
showkey -a
andemacs -nw
, and most of them seem to work correctly (and for the rest I've left some comments in the code).Please lemme know what you think and if my approach is even valid in the first place - terminals are startlingly complicated piece of software 馃槄
Different approaches
I've also considered implementing the neat thing that Kitty supports, but for my taste it's an investment not worth that much (to give a peek - my adventure with
CSI u
started mainly because I wanted for terminal Emacs to recognize Ctrl+Enter 馃檭).1 disclaimer: this pull request doesn't implement support for
modifyOtherKeys
, but - as discussed - going withCSI u
is probably a better solution