Hacker News new | past | comments | ask | show | jobs | submit login

If you use ‘vi’, in insert mode, it’s CTRL-V then tap escape button. Followed by [31m or whatever code.



CTRL-V is a common "quote the next character" input command: it's specified by POSIX (https://pubs.opengroup.org/onlinepubs/9699919799.2018edition... https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...) and it works in bash (in vi mode and emacs mode) and zsh

It also works with just the bare terminal line discipline in many flavours of unix: look at the 'lnext' control character in the output from 'stty' on Linux, macOS, or BSD (but not POSIX).

(however the equivalent in emacs itself is ctrl-Q, probably for bad reasons)


> (however the equivalent in emacs itself is ctrl-Q, probably for bad reasons)

Good reasons:

1) Q is mnemonic for Quote.

2) emacs began life on non-Unix platforms (ITS, TOPS-20, Multics), and was only ported to Unix later. Ctrl-Q is inherited from the original ITS emacs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: