Skip to main content

DECCKM

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard

DECCKM (Mode 1) is a DECSET/DECRST mode that controls whether the cursor keys send normal (ANSI) sequences or application (SS3) sequences.

Syntax​

CSI ? 1 h    DECSET — Enable application cursor keys
CSI ? 1 l DECRST — Disable application cursor keys (normal mode)
Formal syntax
DECSET-mode1 = 0x1b, "[", "?", "1", "h" ;
DECRST-mode1 = 0x1b, "[", "?", "1", "l" ;

Description​

Per the VT100 User Guide and VT510 Programmer Reference, DECCKM controls the sequences generated by the four cursor (arrow) keys.

  • Set (application mode) — The cursor keys send SS3 sequences: ESC O A (Up), ESC O B (Down), ESC O C (Right), ESC O D (Left).
  • Reset (normal mode) — The cursor keys send CSI sequences: CSI A (Up), CSI B (Down), CSI C (Right), CSI D (Left). This is the default.

Cursor key output​

KeyNormal (DECRST)Application (DECSET)
UpESC [ AESC O A
DownESC [ BESC O B
RightESC [ CESC O C
LeftESC [ DESC O D

Application cursor key mode is typically enabled by full-screen terminal applications (such as vi, less, or top) via the smkx/rmkx terminfo capabilities, so that the application can distinguish arrow keys from other input that happens to include CSI sequences.

note

DECCKM only affects the four arrow keys. The numeric keypad has its own mode controlled by DECKPAM/DECKPNM (ESC = / ESC >).

Examples​

printf '\e[?1h'      # Enable application cursor keys
printf '\e[?1l' # Disable application cursor keys (normal mode)

# In application mode, pressing Up sends: ESC O A
# In normal mode, pressing Up sends: ESC [ A

Specifications​

SpecificationSection
VT510 Reference—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesApplication cursor keys mode
Bobcat✓0.9.0Implemented in TerminalCtrl library. Configurable via PCStyleFunctionKeys setting.
contour✓v0.1.0DECCKM (mode 1 - application cursor keys) implemented as DECMode::UseApplicationCursorKeys in primitives.h line 613, set via Terminal.cpp line 2488
foot✓YesApplication cursor keys mode
Ghostty✓v1.0.0
iTerm2✓YesApplication cursor keys mode via cursorMode property
Kitty✓Yes
Konsole✓YesApplication cursor keys mode (DECCKM) fully supported
mintty✓YesDECCKM (Mode 1) implemented at src/termout.c:2376-2377
mlterm✓YesFundamental VT100 mode, present since early versions
PuTTY✓0.45Application cursor keys mode implemented at terminal.c:3060-3062
Rio??
rxvt-unicode✓1.2PrivMode_aplCUR - Application cursor keys
st✓0.1
terminology✓v0.1.0
VT100✓Yes
VTE✓YesDEC_APPLICATION_CURSOR_KEYS mode
WezTerm✓YesApplication cursor keys mode
Windows Terminal✓Yes
xterm✓xterm-1DECCKM (mode 1) - Application cursor keys
xterm.js✓0.10Application Cursor Keys
Multiplexers
cy✓Yes
GNU Screen✓v.4.2.0Application cursor keys mode (src/ansi.c:1077-1082)
tmux✓0.8
tuios✓v0.0.15Application cursor keys mode
Zellij✓v0.31.2

See also​