DECKPAM/DECKPNM
DECKPAM (Keypad Application Mode) and DECKPNM (Keypad Numeric Mode) are DEC VT100 escape sequences that control what the numeric keypad transmits when keys are pressed.
Syntax
ESC = DECKPAM — Enter application keypad mode
ESC > DECKPNM — Enter numeric keypad mode
DECKPAM = 0x1b, "=" ; DECKPNM = 0x1b, ">" ;
Description
DECKPAM — Application mode (ESC =)
Per the VT510 manual, DECKPAM causes the numeric keypad to send application-specific escape sequences instead of the characters printed on the keys. In this mode, each keypad key generates a unique SS3-prefixed sequence (e.g., ESC O p for key 0, ESC O q for key 1, etc.).
This mode is commonly used by full-screen applications like text editors (e.g., vi, Emacs) and TUI libraries (e.g., ncurses) that need to distinguish keypad input from regular number input.
DECKPNM — Numeric mode (ESC >)
DECKPNM restores the keypad to its default numeric mode, where keys send the literal characters printed on them: digits 0-9, period (.), comma (,), and minus (-).
Default behavior
The terminal defaults to numeric keypad mode on power-up and after a reset. The setting is not saved to non-volatile memory.
DECKPAM/DECKPNM function identically to the DECNKM mode (DECSET/DECRST mode 66) on the VT510. Most modern terminal emulators support both mechanisms.
Examples
printf '\e=' # Enable application keypad mode
printf '\e>' # Return to numeric keypad mode
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | ESC =/> listed as IMPLEMENTED in docs/escape_support.md; handlers set_keypad_application_mode() at term/mod.rs:2180 and unset_keypad_application_mode() at term/mod.rs:2186 |
| Bobcat | ✓ | 0.9.0 | PCStyleFunctionKeys() toggle (Terminal.cpp:355) indicates keypad mode support |
| contour | ✓ | v0.1.0 | ESC = (DECKPAM) and ESC > (DECKPNM) control keypad mode |
| foot | ✓ | Yes | Implemented in vt.c:531-536 as ESC =/> |
| Ghostty | ✓ | v1.0.0 | ESC = and ESC > handled in stream.zig:2339-2353 |
| iTerm2 | ✓ | Yes | |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | |
| mintty | ✓ | Yes | DECKPAM (ESC =) at src/termout.c:1956-1957, DECKPNM (ESC >) at src/termout.c:1958-1959 |
| mlterm | ✓ | rel-0_2_1 | |
| PuTTY | ✓ | 0.45 | |
| Rio | ✓ | v0.0.28 | |
| rxvt-unicode | ✓ | rxvt-unicode-1.2 | |
| st | ✓ | 0.4 | |
| terminology | ✓ | v0.1.0 | |
| VT100 | ✓ | Yes | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | Handled in performer.rs:602-608 via EscCode::DecApplicationKeyPad (ESC =) and DecNormalKeyPad (ESC >) |
| Windows Terminal | ✓ | Yes | ESC = sets keypad application mode, ESC > sets numeric mode in OutputStateMachineEngine.cpp:211-215 |
| xterm | ✓ | Yes | Implemented in charproc.c:4922-4933. Sets/clears MODE_DECKPAM |
| xterm.js | ✓ | 3.5.0 | |
| Multiplexers | |||
| cy | ✓ | v0.1.0 | |
| GNU Screen | ✓ | v.4.2.0 | DECKPAM (ESC =) and DECKPNM (ESC >) at src/ansi.c:748-759 |
| tmux | ✓ | 1.3 | Application/numeric keypad mode toggle |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✗ | No | |