^[control-codes
live in libghostty-vt

Private modes

View as Markdown

Settings turned on with CSI ? Pm h and off with CSI ? Pm l (DECSET and DECRST), each named by a number. The ? marks them as private, apart from the ANSI modes that SM and RM set. A host can ask whether one is set with DECRQM.

The space was DEC’s, and the low numbers are DEC’s modes, with mnemonics such as DECAWM. xterm added its own in the same space, mostly from 1000 up, for things DEC’s terminals never had: the alternate screen, mouse tracking, bracketed paste. Newer terminals have added more, such as synchronized output, 2026. Each page says whose a mode is.

?1 DECCKMCursor Keys Mode CSI ? 1 h/l …
?3 DECCOLMColumn Mode CSI ? 3 h/l …
?4 DECSCLMScrolling Mode CSI ? 4 h/l …
?5 DECSCNMScreen Mode CSI ? 5 h/l …
?6 DECOMOrigin Mode CSI ? 6 h/l …
?7 DECAWMAutowrap Mode CSI ? 7 h/l …
?8 DECARMAutorepeat Mode CSI ? 8 h/l …
?9 X10 Mouse
?12 Cursor Blink CSI ? 12 h/l …
?18 DECPFF Print Form Feed Mode
?19 DECPEXPrint Extent Mode CSI ? 19 h/l …
?25 DECTCEMText Cursor Enable Mode CSI ? 25 h/l …
?40 Allow 80/132 Column Mode
?42 DECNRCMNational Replacement Character Set Mode CSI ? 42 h/l …
?46 XTLOGGINGStart Logging or DECGPBMGraphics Print Background Mode CSI ? 46 h/l …
?47 Alternate Screen
?60 DECHCCMHorizontal Cursor Coupling Mode CSI ? 60 h/l …
?61 DECVCCM Vertical Cursor Coupling Mode
?64 DECPCCM Page Cursor Coupling Mode
?68 DECKBUMKeyboard Usage Mode CSI ? 68 h/l …
?80 DECSDMSixel Display Mode CSI ? 80 h/l …
?95 DECNCSMNo Clearing Screen On Column Change CSI ? 95 h/l …
?1000 Mouse Tracking CSI ? 1000 h/l …
?1001 Highlight Mouse Tracking
?1002 Button-Event Mouse Tracking
?1003 Any-Event Mouse Tracking
?1004 Focus Events CSI ? 1004 h/l …
?1005 UTF-8 Mouse Encoding
?1006 SGR Mouse Encoding
?1007 Alternate Scroll
?1015 urxvt Mouse Encoding
?1016 SGR Pixel Mouse Encoding
?1046 Allow Alternate Screen
?1047 Alternate Screen, Cleared on Leaving
?1048 Save Cursor
?1049 Alternate Screen CSI ? 1049 h/l …
?2004 Bracketed Paste CSI ? 2004 h/l …
?2026 Synchronized Output CSI ? 2026 h/l …
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.