4 ms·
If we're counting ^C, then I'd also add: * ^D - Send EOF, which exits most shell-like programs (if you're on an empty line, so try ^C^D) And the job control
by chaosite 4y ago
If we're counting ^C, then I'd also add:
* ^D - Send EOF, which exits most shell-like programs (if you're on an empty line, so try ^C^D)
And the job control bindings:
* ^Z - Suspend current foreground process and return to shell, use `fg` to resume it in foreground and `bg` to resume it in background (see also `disown`)
* ^S - "Stop" current process, useful if it's printing a lot of stuff and you want to pause it for a bit, otherwise useless and usually done by mistake
* ^Q - resume a stopped process, probably after you ^S'ed by mistake
- wdfx 4y agoFor enough, but yes these are not to do with readline but terminal behaviour
- klibertp 4y agoI hated ^S until I disabled it with `stty -ixon`. The thing is, this key is actually bound to a really useful command: the reverse of ^R, ie. search forward in history. It's very useful when you assemble a new command from a few separate ones. You just ^R to the first one you want, mark and copy the part you want with ^Space and Alt+w, then search forward to the next one with ^S. I do use fzf, and it's great, but not for this specific use case. Also, it's worth noting that you can give a prefix argument to many commands by pressing Alt+1-9 (possibly multiple times). For example, the sequence Alt+2 Alt+. pasted not the last, but second to last word from the previous command. Oh, and Alt+x also works! With completion under TAB! The terminal looks simple, and most people prefer GUIs for good reasons. Not to mention the actual complexity of interpreting escape sequence and emulating the teletype (TTY). By the same token, though, terminal is something that was developed and polished by hordes of programmers since the teletypes. It's amazing, and the result is quirky as hell, but also incredibly powerful.