^[control-codes
live in libghostty-vt

Private modes

DECSCLM Scrolling Mode

View as Markdown

Choose between jump scrolling and smooth, slow scrolling.

CSI ? 4 h/l
Defaults
reset (jump scrolling) in xterm
DEC STD 070
§5.4.3 Set/Reset Scrolling Mode, p. 5-32
VT220
§4.6.11 Scrolling Mode (DECSCLM)
VT510
DECSCLM—Scrolling Mode

Mode 4 chooses how fast the screen scrolls. Set (CSI ? 4 h), it scrolls slowly and smoothly; DEC STD 070 asks for about six lines a second, slow enough to make the text “recognizable”. Reset (CSI ? 4 l), it jumps, as fast as the terminal can.

Only the speed changes. What ends up on the screen is the same either way, so the cases here can check only that the mode is recorded, through DECRQM, and that scrolling still scrolls.

DEC STD 070 and the VT510 manual make smooth scrolling the default. xterm starts in jump scrolling: its jumpScroll resource is true by default (charproc.c), and only when it is false does xterm start with smooth scrolling set (charproc.c). Setting the mode (charproc.c) turns jump scrolling off, and DECRQM reports the mode as set or reset (do_dec_rqm). The cases follow xterm, and libghostty-vt matches it.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Yes§4.6.11 Scrolling Mode (DECSCLM)
VT510manual, 1st ed., 1993YesDECSCLM
xtermpatch 412, xterm-411aYesjump scrolling by default (jumpScroll)
libghostty-vt0f171f6Yesrecords the mode
kitty0.49.1, run in a VMNofails the case that shows it working
foot1.28.0, run in a VMNofails the case that shows it working
xterm.js headless6.0.0, run as a libraryNofails the case that shows it working
alacritty_terminal0.26.0, run as a libraryNofails the case that shows it working
ConEmubuild 230724, its documentationNonot in ConEmu’s list, ANSI escape codes
rxvt-unicode9.31, run in a VMYespasses the case that shows it working
VTE0.84.1, run as a libraryNofails the case that shows it working

Validation

DECSCLM-1: Jump scrolling by default

\e[?4$p
|_____|
reply \e[?4;2$y

DECSCLM-2: Set and reset

\e[?4h
\e[?4$p
\e[?4l
\e[?4$p
|_____|
reply \e[?4;1$y\e[?4;2$y

DECSCLM-3: Smooth scrolling still scrolls

A\r\nB\r\nC
\e[?4h     # smooth scrolling
\r\nD
|B____|
|C____|
|D____|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.