ncurses terminal database defines these (see How can I use shift- or control-modifiers? in the
Most of this it's based on work done for
xterm (see this page, for example).
Those are unique names (which
zsh ignores, since they're not in its dictionary of predefined terminal names — see Src/Modules/terminfo.c). You'd have to make some shell assignment, say, to the output of
tput to get the data into a variable.
Alt is typically not considered a modifier when applied to an ordinary key such as
k in the
It has a mode (modifyOtherKeys), which can tell it to send an escape sequence for different combinations (see How can my program distinguish control-I from tab? in the
In this case,
zsh provides no help at all. Likewise, the terminal will not offer a table of the results (it deals with special keys). A customized application would be needed.
You may have in mind the meta feature. That does have a terminfo feature (
smm to enable,
rmm to disable). However, most terminals (other than
xterm) implement this differently from the documented behavior. In
If the terminal has a "meta key" which acts as a shift key, setting the
8th bit of any character transmitted, this fact can be indicated with
km. Otherwise, software will assume that the 8th bit is parity and it
will usually be cleared. If strings exist to turn this "meta mode" on
and off, they can be given as
That's partly due to the backwards definition found in
bash documentation (see my answer for details). But in any case, terminfo will not hold the information that tells your script what characters might be prefixed with Escape.