5 ms·
On a modern PC, Esc key is Esc key... whatever the application wants to use it for (99% time, cancel some UI operation). To me it's insane that one of the most
by silon42 3y ago
On a modern PC, Esc key is Esc key... whatever the application wants to use it for (99% time, cancel some UI operation).
To me it's insane that one of the most used key command has a 1 second delay in the terminal.
Or that typically Esc + some function/arrow key results in some junk.
- blueflow 3y agoIf you type in junk into the keyboard, junk is what you get on the screen. I see the fault with the developers that overload the keys for existing control characters with a different meaning. > whatever the application wants to use it for With the application being a terminal emulator, that is emitting an ESC character.
- bityard 3y ago> one of the most used key command Found the vim user! The vast, _vast_ majority of Unix command-line or text-based programs do not use the Esc key because they were not written with a particular terminal or keyboard layout in mind. (Unlike vim.) But for whatever it's worth, I use vim every day and I notice no 1 second delay when switching modes with the Esc key, so perhaps this is something you can configure in your terminal.
- mfontani 3y agoCtrl + [ instead of Esc gets one back into normal mode, with no delay Takes a while getting used to it (I still haven't)
- matvore 3y agoWhat does `Ctrl + [` send to the terminal for you if not esc? In my experience these are always the same, so Vim shouldn't be able to tell the difference unless it's a GUI-integrated version like gVim. Try to run `xxd` and then press Ctrl-V and either Ctrl+[ or Esc, then Enter and Ctrl+D. Typical terminal setups will show the same codes both times (1b0a for esc and \n). Alt+Space (or Alt+J Alt+K Alt+B to go up, down, left one word from current position after returning to normal mode) is what I often do which should work universally.
- matvore 3y ago> I notice no 1 second delay when switching modes with the Esc key, so perhaps > this is something you can configure in your terminal. This is configurable in Vim. ttimeoutlen, timeoutlen, and noesckeys are pertinent. tmux et al may also need tweaking.
- MatthiasPortzel 3y agoIs your terminal emulator waiting for a second input before sending Esc? That’s not a common behavior AFAIK.
- blueflow 3y agoNo, its waiting for input after sending escape. Escape + character is how you reach the C1 control codes, with CSI and OSC (ESC + '[' and ESC + ']') being popular ones (both referred to in the posted article). This is relevant for keyboard input (as contrasted to output-only) since some codes for special keys (like arrow keys) start with CSI. Edit: You asked about the terminal emulator, but its the console application that has to do the wait.
- hnlmorg 3y agoAre you using something like tmux: https://unix.stackexchange.com/questions/608142/whats-the-effect-of-escape-time-in-tmux https://unix.stackexchange.com/questions/608142/whats-the-ef...