Terminals are weird. If you type read -r
in a shell then hold Alt
and tap a, you may be surprised to see ^[a
glaring at you.
Why?
Your terminal encodes Alt-a (referred to as <m-a>
in vim) as two bytes:
Escape (referred to as <esc>
in vim) followed by a
. This encoding scheme has
been used for decades and allows your terminal to send escape sequences like