Comprehensive Keyboard Handling in Terminals
sw.kovidgoyal.net
sw.kovidgoyal.net
Kovid deserves credit for addressing some of the issues in the original proposal, and for documenting it well. But Evans deserves credit as well for formulating the original idea.
Note also that this is not the only solution to this problem. Xterm has had its own solution for a long time called modifyOtherKeys [2] which has been supported by Vim and iTerm2 for quite some time (I believe foot supports it as well, perhaps others). Of course people have different opinions on which approach is “better”, though empirically it seems like the CSIu/“fixterms”/kitty approach has a lot more momentum at present.
Fragmentation is unfortunate, especially since there's no termcap/terminfo property that indicates which form(s) a terminal supports, and so many terminals already identify themselves as ‘xterm’ without being remotely close to xterm-compatible.
Great, that he tries to make progress in terminal area, that, as for me, is quite archaic as of now.
What problem does it solve for you?
Kitty has a new keyboard handling protocol, and Neovim supports it. So if you use kitty, you can use key mappings in neovim in a more predicatable and flexible way.
Of course your workflow is yours.
That latency interferes just with a plain Esc key press. There's no weird use case in this.
Or does tmux make them work automagically?
I would be capable of working entirely in any modern terminal emulator, but Kitty makes it a pleasure.
I use vim as my main editor and while I usually stick with default terminal I have tried others in the past and at least I cant tell a difference in normal usage.
Yeah... Terminal is not the issue, rather why you have 100000 line js file in the first place.
I made a random file with 100 000 lines and using 3 different terminals (Default Terminal, iTerm2, and Kitty) and using two different grep tools (grep and rip-grep) with and without tmux I can not see any meaningful performance difference.
Do I just not understand what terminal emulators do? How does choice of text printing matter when you run a script?
I could see a tiny performance improvement with kitty when I ran just cat on the file in a loop, but the difference was so tiny that if you want to argue that this is the performance benefit worth using kitty for I have bad news for you since the worst case with kitty was then noticeably worse than in competition.
Are these like "powerline fonts" or what? Where are these used?
Do you mean such things as wide Unicode glyphs? Because it doesn’t seem to support variable-width fonts.
https://github.com/microsoft/terminal/blob/main/doc/specs/%2...
https://github.com/microsoft/terminal/blob/main/doc/specs/%2...
Anyway, there are other better mechanisms to resolve the conflict instead of crippling the app
BTW. "Hyper" is available also on Mac, by default mapped to Shift+Control+Alt+Command but it can be remapped to another key. That key combination is emitted by the "Office key" on some Microsoft keyboards, and is used in MS-Windows for launching a component in their Office pack, or the Emoji picker.
So, there are lots of opportunities for configuration, and conflicts. IMHO, It would be a "nice thing to have" if users could configure their text-mode programs to use more modifiers, sure ... but as long as they are the only users of that config. I don't think a text-mode program should map Super or Hyper by default.
In addition to the Hyper key, there's also the "Meh" key, which is Shift+Control+Command and basically not used by any application. I use it as my default macro hotkey.
I dedicate "Super" to my WM and Hyper to quite a few things but... Hyper is a hack for the USB specs do not have the concept of the Hyper key. So Hyper support is always a kludge.
This is precisely why I prefer KDE — it's feasible to move GUI shortcuts off Control. (It could and should be easier, since there's a global setting deep in Qt somewhere, but it's only exposed on MacOS.)
Disagree. I used to use Emacs with evil-mode, but I gave up because of this issue.
If I entered `ESC` then `k` (i.e. return to normal mode and move up a line) too quickly on an SSH connection, there was a good chance the `read` syscall on the PTTY file descriptor would return two characters (determined via `strace`) instead of two subsequent calls returning a single character each.
This makes it literally impossible for Emacs to distinguish it from `M-k` (i.e. `kill-line`), so I’d “randomly” see lines deleted before I figured out what was going on.
The effect is a lot more pronounced over SSH where a spike in network latency can cause two subsequent TCP segments to reach the host essentially back-to-back (or even be retransmitted as a single segment), leading to this behaviour of `read` returning two characters.
Some of it is EXWM specific but about half also apply on a tty frame too. My fingers just automatically type the alternate version when needed.
Sorry if it came off too argumentative. I've been on the other side of this plenty, one person's annoyance is another's show stopper.
C-x @ s event-apply-super-modifier
So to get s-g to work, you'd configure the terminal emulator to convert the Command+G key press to the C-x @ s g sequence. # Hex code (iTerm)
0x18 0x40 0x73 0x67
# kitty (without Emacs doing the integration)
map cmd+g send_text all \x18@sg
Konsole somehow seems to have this done for the whole English alphabet, so it just works out of the box there.For 2-modifier bindings, I guess you can add a creative entry to local-function-key-map. (If the other modifier is Shift, you can just use uppercase letters.)
Is there any advance on that front?
Previous submission was 2 years ago.
I noticed the difference by playing with kitty. It makes me consider switching to a compatible terminal emulator.
You may not have to switch at all if you are already using one of these terminal emulators.