^[control-codes
live in libghostty-vt

Private modes

DECTCEM Text Cursor Enable Mode

View as Markdown

Show or hide the cursor.

CSI ? 25 h/l
DEC STD 070
§5.4.2 Set/Reset Text Cursor Enable Mode, p. 5-21
VT220
§4.6.7 Text Cursor Enable Mode (DECTCEM)
VT510
DECTCEM—Text Cursor Enable Mode

CSI ? 25 h shows the cursor and CSI ? 25 l hides it. Shown is the default.

Only the cursor’s symbol on the screen is affected. A hidden cursor still has its position, still moves, and text is still written where it is. DEC STD 070 asks that turning it off be immediate, and suggests that a terminal’s setup screen offer a way to turn it back on, in case a program forgets to.

On this site the cursor’s cell is outlined in the drawn terminal only while it is visible; the cursor-visible line in a case checks the mode itself.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Yes§4.6.7 Text Cursor Enable Mode (DECTCEM)
VT510manual, 1st ed., 1993YesDECTCEM
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Yes
kitty0.49.1, run in a VMYespasses the 3 cases that show it working
foot1.28.0, run in a VMYespasses the 3 cases that show it working
pyte0.8.2, run as a libraryYespasses the 2 cases that show it working
xterm.js headless6.0.0, run as a libraryYespasses the 3 cases that show it working
alacritty_terminal0.26.0, run as a libraryYespasses the 3 cases that show it working
ConEmubuild 230724, its documentationYesANSI escape codes
rxvt-unicode9.31, run in a VMYespasses the 3 cases that show it working

Validation

DECTCEM-1: Hidden where it is

\e[2;3H
\e[?25l
|_____|
|_____|
cursor 2,3
cursor-visible no

DECTCEM-2: Text is still written

\e[?25l
AB
|AB___|
cursor 1,3
cursor-visible no

DECTCEM-3: Shown again

\e[?25l
\e[?25h
|_____|
cursor-visible yes

DECTCEM-4: Shown to begin with

\e[?25$p  # DECRQM: is mode 25 set?
|_____|
cursor-visible yes
reply \e[?25;1$y
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.