^[control-codes
live in libghostty-vt

Private modes

DECHCCM, DECVCCM, DECPCCM Cursor Coupling Modes

View as Markdown

Choose whether the window follows the cursor around a page larger than the screen.

DECHCCM Horizontal Cursor Coupling Mode

CSI ? 60 h/l

DECVCCM Vertical Cursor Coupling Mode

CSI ? 61 h/l

DECPCCM Page Cursor Coupling Mode

CSI ? 64 h/l
DEC STD 070
§5.5 Set/Reset Horizontal Cursor Coupling Mode, p. 5-85

In DEC’s windowing extension, the screen is a window onto a page of display memory that can be wider, taller, or one of several pages. These three modes decide whether the window follows the cursor when it moves out of view:

ModeNameSet (coupled)DEC STD 070 default
60DECHCCM, horizontalthe page moves sideways in the window to keep the cursor visiblereset
61DECVCCM, verticalthe page moves up or down in the windowset
64DECPCCM, pagethe window switches to the cursor’s pageset

DECVCCM is on p. 5-86 and DECPCCM on p. 5-87, both in §5.5, Windowing Extension, at levels 3 and 4. The VT510 manual has DECVCCM and DECPCCM, but no page for DECHCCM.

A terminal whose page is the size of its screen has nothing to couple. xterm recognizes all three modes and ignores them (charproc.c); DECRQM reports each as permanently reset, 4, at level 3 and up, and xterm is a VT420 by default (do_dec_rqm). esctest2 expects DECHCCM to be permanently reset, and DECVCCM and DECPCCM to be changeable, listing xterm as not supporting those two; the cases follow xterm.

libghostty-vt does not have the modes: none is in its table in modes.zig, so DECRQM reports each as not recognized, 0. Both cases are known differences.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993PartlyDECVCCM and DECPCCM; DECHCCM only in Table 5-6, always reset
xtermpatch 412, xterm-411aNorecognized and ignored; DECRQM reports each as permanently reset
libghostty-vt0f171f6Nonone is in its mode table; DECRQM reports 0 (DECHCCM-1, DECHCCM-2)
ConEmubuild 230724, its documentationNonot in ConEmu’s list, ANSI escape codes

Validation

DECHCCM-1: All three permanently reset

\e[?60$p\e[?61$p\e[?64$p
|_____|
reply \e[?60;4$y\e[?61;4$y\e[?64;4$y

DECHCCM-2: Even after they are set

\e[?60h\e[?61h\e[?64h
\e[?60$p\e[?61$p\e[?64$p
|_____|
reply \e[?60;4$y\e[?61;4$y\e[?64;4$y
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.