Skip to main content
ansicode

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[\x1b[<Pl>;<Pc>" p
\\033[\033[62;1" p
\\e[\e[62;1" p
ESC [ESC [ Pl ; Pc " p
hex1b 5b ... 22 70

Description

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 6165 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

PlConformance level: 61 = VT100, 62 = VT200/VT220, 63 = VT300/VT320, 64 = VT400/VT420, 65 = VT500/VT510/VT520. Hardware terminals clip at their native model.
PcControl 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

bash
# Lock terminal to VT220 7-bit conformance.\n# WARNING: this also performs an RIS (clears screen + scrollback).\nprintf '\\033[62;1\" p'
python
import sys\n# VT520 with 8-bit C1 allowed (modern default).\nsys.stdout.write('\\x1b[65;0\" p')\nsys.stdout.flush()
go
// VT320 conformance — useful when targeting Sixel-era apps.\nfmt.Print(\"\\x1b[63;0\\\" p\")
javascript
// Most portable target: VT220 7-bit. Survives any modern emulator.\nprocess.stdout.write('\\x1b[62;1\" p')
c
/* 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
yes
GNU screen
yes

Related sequences