# Private modes

> Settings turned on with CSI ? Pm h and off with CSI ? Pm l, and asked about with DECRQM.

Settings turned on with `CSI ? Pm h` and off with `CSI ? Pm l`
([DECSET](https://control-codes.page/csi/decset/index.html.md) and [DECRST](https://control-codes.page/csi/decrst/index.html.md)), each named by a number. The `?` marks
them as private, apart from the [ANSI modes](https://control-codes.page/ansi/index.html.md) that
[SM](https://control-codes.page/csi/sm/index.html.md) and [RM](https://control-codes.page/csi/rm/index.html.md) 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.

- [?1049: Alternate Screen](https://control-codes.page/modes/altscreen/index.html.md): Switch to a second screen for full-screen programs, and back to the one the shell was using.
- [DECARM: Autorepeat Mode](https://control-codes.page/modes/decarm/index.html.md): Turn the repeating of held-down keys on and off.
- [DECAWM: Autowrap Mode](https://control-codes.page/modes/decawm/index.html.md): Choose whether text reaching the right margin continues on the next line.
- [?2004: Bracketed Paste](https://control-codes.page/modes/paste/index.html.md): Mark pasted text, so that a program can tell it from typing.
- [DECCOLM: Column Mode](https://control-codes.page/modes/deccolm/index.html.md): Switch the screen between 80 and 132 columns, clearing it.
- [?12: Cursor Blink](https://control-codes.page/modes/blink/index.html.md): Start or stop the cursor blinking.
- [DECHCCM: Horizontal Cursor Coupling Mode](https://control-codes.page/modes/dechccm/index.html.md): Choose whether the window follows the cursor around a page larger than the screen.
- [DECCKM: Cursor Keys Mode](https://control-codes.page/modes/decckm/index.html.md): Choose what the arrow keys send: cursor movement or application codes.
- [?1004: Focus Events](https://control-codes.page/modes/focus/index.html.md): Have the terminal tell the program when its window gains or loses the keyboard focus.
- [DECKBUM: Keyboard Usage Mode](https://control-codes.page/modes/deckbum/index.html.md): Choose between typewriter keys and data processing keys.
- [XTLOGGING: Start Logging](https://control-codes.page/modes/logging/index.html.md): Start or stop logging the session to a file, in an xterm built to log; DECGPBM on a VT340.
- [?1000: Mouse Tracking](https://control-codes.page/modes/mouse/index.html.md): Ask the terminal to report mouse buttons and movement, and choose how the reports are encoded.
- [DECNRCM: National Replacement Character Set Mode](https://control-codes.page/modes/decnrcm/index.html.md): Allow the 7-bit national character sets, which replace a few ASCII characters with letters of one language.
- [DECOM: Origin Mode](https://control-codes.page/modes/decom/index.html.md): Count cursor positions from the margins instead of the corner of the screen.
- [DECPEX: Print Extent Mode](https://control-codes.page/modes/decpex/index.html.md): Choose what a print operation sends to the printer, and whether it ends with a form feed.
- [DECSCNM: Screen Mode](https://control-codes.page/modes/decscnm/index.html.md): Show the whole screen in reverse video: dark text on a light background.
- [DECSCLM: Scrolling Mode](https://control-codes.page/modes/decsclm/index.html.md): Choose between jump scrolling and smooth, slow scrolling.
- [?2026: Synchronized Output](https://control-codes.page/modes/sync/index.html.md): Hold back drawing the screen until a program has finished updating it.
- [DECTCEM: Text Cursor Enable Mode](https://control-codes.page/modes/dectcem/index.html.md): Show or hide the cursor.

---

This is the Markdown version of <https://control-codes.page/modes/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.
