Search code examples
terminalttyxtermterminfotermcap

Terminfo smkx and Application Cursor Keys vs Application keypad


XTerm Control Sequences specifies the following key sequences:

CSI ? 1 h  → Application Cursor Keys (DECCKM)
CSI ? 1 l  → Normal Cursor Mode (DECOM)
CSI ? 66 h → Application keypad (DECNKM)
CSI ? 66 l → Numeric keypad (DECNKM)

and the Terminfo Source Format has the following entry:

Variable: keypad_xmit
Capname: smkx
Termcap: ks
Description: Put terminal in "keypad-transmit" mode

But the terminfo for xterm actually says smkx=\E[?1h\E=, which seems mixed up to me (smkx should affect the keypad, not the cursor keys, right?). What am I missing here?


Solution

  • It looks like you are missing the \E= at the end of smkx.

    ESC =     Application Keypad (DECKPAM).
    ESC >     Normal Keypad (DECKPNM).
    

    are listed on the XTerm Control Sequences page as well and you would expect them to affect the keypad.

    I found a related question here: keyboard transmit mode in vt100 terminal emulator.