wire / terminal-dec-private-mode / 9001

DECSET 9001 — Win32 input mode (ConPTY)

CSI ? 9001 h enables Windows Terminal / ConPTY 'win32-input-mode': keyboard (and some other) input is encoded as a verbose CSI _ sequence carrying the full Win32 KEY_EVENT_RECORD (virtual key code, scan code, unicode char, key-down flag, control-key state, repeat count). CSI ? 9001 l disables it. It lets a ConPTY client receive lossless Win32 key events over a VT stream.

terminal-dec-private-mode kind control-sequence status proprietary verification verified tier C terminal-escape@1

aka: win32-input-mode · ConPTY input · DECSET 9001 · ?9001h / ?9001l · Win32 input mode

frame

DEC-private-mode introducer: \x1b[? ESC [ ? (0x1B 0x5B 0x3F)

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
set Enable (DECSET) \x1b[?9001h CSI ? 9001 h enables win32-input-mode: ConPTY forwards each input event as CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _ (the six KEY_EVENT_RECORD fields), giving lossless Win32 key information including key-up events and modifier state.
reset Disable (DECRST) \x1b[?9001l CSI ? 9001 l disables win32-input-mode; input reverts to standard VT key encoding.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-dec-private-mode/9001 or /terminal-dec-private-mode/9001.json