Discussion:
Which key shortcuts are safe to bind and some Q:s about history and OS diffs Re: Ctrl+4 means SIGQUIT+coredump, where is this documented, what more shortcuts are there?
Tinker
2018-11-01 02:38:21 UTC
Permalink
No idea how ^4 is mapped to ^\, but for some reason it is,
This goes back to the VT220, if not older terminals. Ctrl-3 for
ESC aka ^[ is particularly handy if the Esc key is in some inconvenient
place as on most PC keyboards.
See "Table 3-5 Keys Used to Generate 7-Bit Control Characters" in
https://vt100.net/docs/vt220-rm/table3-5.html
Historial reasons, a ha. Ok so this relates to a whole universe of
questions.


Is there a lot of effectively-unused legacy handling logics for
hardware that has not been manufactured for many decades, or is this
central today also?


Do unices e.g. OpenBSD/BSD, Linux, Solaris-whatever differ very much in
how they handle terminals?


Similar to how certain ctrl+ shortcut bindings are problematic, ESC is
also problematic as terminals easily confuse it right, e.g. ESC and
then rightarrow is easily confused for alt+rightarrow, right?


So this means that key bindings in your favourite console program, be
it KSH or TMUX or any other, better bind ctrl-shortcuts with great
discernment only, as they tend to have hardcoded lower-level terminal
behaviors so can't easily be preserved up to the tmux-etc. application
level and customized there, maybe you get it to work in a particular
setup but it would be fragile and maybe easily break when switching
terminal software or what not.

So binding ctrl+0-9 e.g. to switch windows is a bad idea.

More general-purpose are alt+ shortcuts e.g. alt+0-9.

Are shift+alt+-shortcuts, ctrl+shift+-, ctrl+alt+- shortcuts any
good, or any other control char I may not have thought of?


If I recall right, I did bind ctrl+0-9 successfully back in approx
OpenBSD 6.2 last year, from the latest Putty terminal then.

Did anything change in OpenBSD's terminal handling since then?


Last on this topic, are there any relevant terminal server-side
shortcut-related behaviors that can be tweaked in some environment
variable or configuration file?


Anyhow thanks for your comments, I think I kind of got the point about
what's safe and not safe shortcuts to bind.

If there are any further reading references or books on this topic feel
free to
share.

Thanks,
Tinker
Christian Weisgerber
2018-11-01 12:26:25 UTC
Permalink
Post by Tinker
No idea how ^4 is mapped to ^\, but for some reason it is,
See "Table 3-5 Keys Used to Generate 7-Bit Control Characters" in
https://vt100.net/docs/vt220-rm/table3-5.html
Historial reasons, a ha.
And I'll venture a guess why DEC added those combinations: In order
to type ^[ ^\ ^] to produce the ESC, FS, GS characters, you need
keys for [ \ ]. If you look at non-English keyboard layouts, you'll
see that the corresponding keys have been re-purposed for other
characters. In the old days of national ASCII variants, even the
characters [ \ ] didn't exist in many national encodings. Later,
when extended 8-bit character sets were introduced, [ \ ] were only
made available in a secondary mapping reachable with an extra
modifier key (AltGr or such). And that's the situation right into
the present.

By contrast, combinations like ^3, ^4, ^5 were readily available
on keyboards.

https://en.wikipedia.org/wiki/ISO/IEC_646#ISO_646_national_variants
--
Christian "naddy" Weisgerber ***@mips.inka.de
Loading...