út 16. 9. 2025 v 19:03 odesílatel Jakub Horký <[email protected]> napsal:

> But just three years later, AT&T released UNIX System V Release 3, which
> added switching to cursor application mode and keypad application mode via
> smkx and rmkx, and defined sequences for numeric keypad for vt100 and
> others. However, there was a problem: DEC VT terminals have *two *keypads
> (cursor and numeric), generating too much sequences. But there was no room
> for all of them, simply because terminfo predefined capabilities didn't
> anticipate such complexity. Note that user-definable capabilities didn't
> exist until 13 years later.
>
> So the author of the vt100 entry came up with a dirty hack: assigning
> numeric keypad application mode sequences to *random *capabilities,
> regardless of their documented purpose. So keys 1, 2, 3 were mapped to caps
> belonging to 7, 5, and 9, keys 0 and dot were mapped to caps belonging to 1
> and 3, key row 4, 5, 6, and comma was mapped to caps belonging to F5, F6,
> F7 and F8, and key row 7, 8, 9 was mapped to caps belonging to F9, F10 and
> F0.
>
> There is excerpt from SysV R3 terminfo:
>
> # Info:
> # This is how the keypad gets assigned.
> # PF1  PF2    PF3      PF4
> kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
> # 7  8     9    '-' does not send anything on my terminal.
> kf9=\EOw, kf10=\EOx, kf0=\EOy,
> # 4  5    6      ,
> kf5=\EOt, kf6=\EOu, kf7=\EOv, kf8=\EOl,
> # 1  2    3
> ka1=\EOq, kb2=\EOr, ka3=\EOs,
> # 0  .    ENTER
> kc1=\EOp, kc3=\EOn, kent=\EOM,
> #
>
> That's it. No explaining commentary, nothing. Just this terminfo "rape".
> And of course smkx and rmkx were added to enable application modes.
>
> Surprisingly, this survived for years throughout SysV UNIX history. Later
> only VT220 added but without keypad app mode. In 1995, all this was
> imported into today's terminfo.
>

Oh, I almost forgot to mention that just three years later (in 1990), VT100
keypad application mode was disabled, apparently for its bogus assignments:

# smkx and rmkx, given below, were removed.
# smkx=\E[?1h\E=, rmkx=\E[?1l\E>,
# Somtimes smkx and rmkx are included.  This will put the auxilliary keypad
in
# dec application mode, which is not appropriate for SCO applications.

This removal persisted to all SysV/SCO UNIX descendants. These dormant
bogus mappings were later (in 1995) revived by merging into Eric Raymond's
terminfo, but by that time, VT100 terminals had practically fallen out of
use, so it was no longer a major issue - until vt100 entry began to be used
as a base for modern terminal emulators lately.

Jakub

Reply via email to