Skip to main content
ansicode

DECCOLM — 80 / 132 column mode (CSI ? 3 h / l)

Toggle between 80 and 132 column page width — DEC VT100's flagship 'wide mode' switch, gated by an opt-in resource on every modern emulator.

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[?3h (132 cols) \x1b[?3l (80 cols)
\\033[\033[?3h / \033[?3l
\\e[\e[?3h / \e[?3l
ESC [ESC [ ? 3 h / ESC [ ? 3 l
hex1b 5b 3f 33 68 / 6c

Description

Column Mode (DECCOLM, private mode 3). Set (`\x1b[?3h`) requests 132-column page width; reset (`\x1b[?3l`, the typical default) returns to 80 columns. Originally a hardware feature of the DEC VT100 — flipping this triggered a real font / clock-rate switch that physically narrowed each character cell so 132 glyphs fit on the same CRT. Software emulators implement it by resizing the page buffer; the side effects are the same as DECSCPP and intentional: - **Screen cleared** to current SGR background. - **Cursor homed** to (1, 1). - **DECSTBM and DECSLRM reset** to full-page. - Any pending **DECOM** (origin mode) state preserved but margins re-anchored. Why the resource gate? In the X11 / VT100 era, applications would emit `?3h` programmatically to gain wide-display real estate, surprising the user by clearing their buffer. Modern emulators (xterm `allowC132`, putty `disable_remote_resize`, others by default) suppress DECCOLM unless explicitly opted in. Result: a program that ships `?3h` today gets silent no-ops on alacritty / kitty / wezterm / ghostty / Windows Terminal — the safe assumption is that DECCOLM does nothing unless you've already verified it works in the target environment. Use DECCOLM (or its parameter-bearing cousin DECSCPP) only when you control the terminal config; otherwise emit a `resize`-style request through your platform's window-management protocol (e.g. ioctl `TIOCSWINSZ`). DECCOLM **persists** until reset or until DECSTR (soft reset returns it to default) or RIS (hard reset).

Spec citation: DEC VT100 (DECCOLM) / xterm-ctlseqs

Parameters

Examples

bash
# Probe and request 132-col, fall back gracefully:\nprintf '\033[?3h'   # request wide\nprintf '\033[6n'    # cursor position report\nIFS='[;R' read -t 0.05 -rsd R _ rows cols < /dev/tty || true\nif [ "$cols" -lt 100 ]; then echo "emulator ignored DECCOLM"; fi
python
import sys, os\nsys.stdout.write('\x1b[?3h')   # ask for 132\nsys.stdout.flush()\nrows, cols = os.get_terminal_size()\nif cols < 100:\n    print('DECCOLM not honoured — staying narrow')
go
fmt.Print("\x1b[?3h")\ndefer fmt.Print("\x1b[?3l")   // always restore — clears screen on transition
javascript
process.stdout.write('\x1b[?3l')   // explicit 80-col (default; harmless on emulators that ignore DECCOLM)
c
printf("\x1b[?3h");   /* request 132 cols */\n/* WARNING: screen now cleared. Re-render entire UI. */

Terminal support

xterm
yes
Linux console (fbcon)
no
macOS Terminal.app
partial
iTerm2
partial
Windows Terminal
no
cmd.exe / ConPTY
no
kitty
no
alacritty
no
WezTerm
no
Ghostty
no
GNOME Terminal
partial
Konsole
partial
tmux
no
GNU screen
no

Related sequences