DECSCL — Select conformance level (`CSI Pl ; Pc " p`)
Choose VT100 / VT200 / VT300 / VT400 / VT500 conformance level — controls which subset of escape sequences the terminal honours, plus 7-bit vs 8-bit C1 emission. Implicitly performs a hard reset (RIS) first.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b[<Pl>;<Pc>" p\033[62;1" p\e[62;1" pESC [ Pl ; Pc " p1b 5b ... 22 70Description
DECSCL — Set Conformance Level — chooses the highest VT model whose escape-sequence vocabulary the terminal will accept, **and** picks 7-bit-only C1 emission (`Pc=1`) or 8-bit C1 emission (`Pc=0` or omitted). The intermediate byte is `"` (0x22) and the final is `p` (0x70). **`Pl` values:** `61` = VT100, `62` = VT200 / VT220, `63` = VT300 / VT320, `64` = VT400 / VT420, `65` = VT500 / VT510 / VT520. **`Pc` values** (only meaningful when `Pl ≥ 62`): `0` or omitted = 8-bit controls allowed (terminal may emit single-byte 0x80–0x9F C1 codes — IND, NEL, HTS, RI, SS2, SS3, DCS, CSI, ST, OSC, PM, APC), `1` = 7-bit controls only (the same C1 codes are emitted as their two-byte `ESC` equivalents: `ESC D` for IND, `ESC E` for NEL, `ESC \` for ST, etc. — see `c1-controls`), `2` = 8-bit controls allowed (alias of 0 on some emulators). **Critical side-effect**: DECSCL implicitly performs a **hard reset (RIS-equivalent)** before applying the new level. Setting `\x1b[62;1" p` to lock the terminal into VT220-7bit mode also clears the screen + scrollback, resets SGR, resets margins, restores wraparound, etc. — do **not** call DECSCL casually mid-session unless you want the full RIS effect. **Hardware terminals** clip requested level at their native model — a real VT220 receiving `\x1b[65" p` falls back to VT220 conformance. **Software emulators** (xterm, kitty, iTerm2, WezTerm, Ghostty, Alacritty, Konsole, Windows Terminal) accept `61`–`65` uniformly and effectively run at VT520 native by default. Most ignore `Pc` entirely — they keep emitting 7-bit by default and only switch to 8-bit when explicitly enabled via the separate `S8C1T` `\x1b G` / `\x1b F` controls. **Query side**: `DCS $ q " p ST` (DECRQSS for DECSCL — see `dcs-decrqss`) — reply is `DCS 1 $ r Pl ; Pc " p ST`. e.g. probing on Ghostty returns `\x1bP1$r65;1" p\x1b\\` (VT520 + 7-bit). Round-trip pattern: probe → switch → restore on exit. Use this when a TUI legitimately needs to drop to VT220 vocabulary (e.g. to suppress the terminal's interpretation of `?2026` synchronized update bracketing) — but expect the screen contents to evaporate. If you need to *restrict feature use* without paying the RIS cost, prefer DECRQM (`decrqm`) to probe individual modes and DECRST (`\x1b[?...l`) to selectively disable them — that's almost always what people reach for DECSCL to do.
Spec citation: DEC VT510 RM (DECSCL) / xterm-ctlseqs
Parameters
| Pl | Conformance level: 61 = VT100, 62 = VT200/VT220, 63 = VT300/VT320, 64 = VT400/VT420, 65 = VT500/VT510/VT520. Hardware terminals clip at their native model. |
| Pc | Control bits (Pl ≥ 62 only): 0 / 2 = 8-bit C1 allowed, 1 = 7-bit-only (C1 emitted as two-byte ESC equivalents). Most emulators ignore this. |
Examples
# Lock terminal to VT220 7-bit conformance.\n# WARNING: this also performs an RIS (clears screen + scrollback).\nprintf '\\033[62;1\" p'import sys\n# VT520 with 8-bit C1 allowed (modern default).\nsys.stdout.write('\\x1b[65;0\" p')\nsys.stdout.flush()// VT320 conformance — useful when targeting Sixel-era apps.\nfmt.Print(\"\\x1b[63;0\\\" p\")// Most portable target: VT220 7-bit. Survives any modern emulator.\nprocess.stdout.write('\\x1b[62;1\" p')/* DECSCL — implicit RIS first, then apply new level. */\nprintf(\"\\x1b[%d;%d\\\" p\", 62, 1);\nfflush(stdout);Terminal support
- xterm
- yes
- Linux console (fbcon)
- partial
- macOS Terminal.app
- partial
- iTerm2
- yes
- Windows Terminal
- partial
- cmd.exe / ConPTY
- no
- kitty
- yes
- alacritty
- partial
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- partial
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | partial | partial | yes | partial | no | yes | partial | yes | yes | partial | yes | no | no |