I just noticed this by accident.
I use the vi
readline mode (run set -o vi
in bash
) so it is particularly noticeable; in emacs
readline mode I don't think Esc does anything, but in vi
mode it exits insert mode (enters normal mode).
I don't see Shift–Tab documented in man bash
, and it would seem that its interpretation as an Esc key is at a more basic level than bash
. Possibly in readline?
It works on Mac OS X as well as Linux.
Where can I find this documented?
Best Answer
Shift+Tab on several terminals sends an escape sequence like this
It has been part of the Linux console terminal since 1995, part of xterm since 2002, and used in terminals emulating one or the other of those since then.
In the
terminfo
description, this would be expressed asand
kcbt
is documented interminfo(5)
:From the standpoint of parsing, there is no difference between this and pressing some function-key. readline does have special cases for several editing keys (seen after the call to
tgetent
in bash'slib/readline/terminal.c
), but the termcap"kB"
is not part of that.