?12 Cursor Blink
Start or stop the cursor blinking.
CSI ? 12 h/l
- xterm
- Functions using CSI
CSI ? 12 h makes the cursor blink and CSI ? 12 l makes it steady. xterm names it after the AT&T 610 terminal it took the number from; DEC’s own use of mode 12 is something else, and DECSCUSR is the way to set the blink and the shape together.
The cases follow xterm, where this mode and DECSCUSR set the same flag (dpmodes, CASE_DECSCUSR, do_dec_rqm):
- it is off to begin with, unless the
cursorBlinkresource says otherwise; - a blinking DECSCUSR style sets it, and a steady one resets it, so DECRQM for mode
12tells which DECSCUSR chose last; - DECSTR and RIS both reset it (
ReallyReset).
If the cursorBlink resource is set to always or never, neither this mode nor DECSCUSR can change it.
libghostty-vt keeps the mode and DECSCUSR in step as xterm does, but DECSTR leaves the mode set, which is a known difference.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | No | not in the manual |
| VT510 | manual, 1st ed., 1993 | No | not in the manual; mode 12 there is SRM, an ANSI mode |
| xterm | patch 412, xterm-411a | Yes | off unless the cursorBlink resource says otherwise |
| libghostty-vt | 0f171f6 | Yes | BLINK-4: DECSTR leaves the mode set |
| kitty | 0.49.1, run in a VM | No | fails the case that shows it working |
| foot | 1.28.0, run in a VM | Yes | passes the case that shows it working |
| xterm.js headless | 6.0.0, run as a library | Yes | passes the case that shows it working |
| alacritty_terminal | 0.26.0, run as a library | Yes | passes the case that shows it working |
| ConEmu | build 230724, its documentation | No | not in ConEmu’s list, which has DECSCUSR instead; ANSI escape codes |
| rxvt-unicode | 9.31, run in a VM | Yes | passes the case that shows it working |
| VTE | 0.84.1, run as a library | No | fails the case that shows it working |
Validation
BLINK-1: Steady to begin with
\e[?12$p
|____|
reply \e[?12;2$y
BLINK-2: Set and reset
\e[?12h
\e[?12$p
\e[?12l
\e[?12$p
|____|
reply \e[?12;1$y\e[?12;2$y
BLINK-3: DECSCUSR sets it too
\e[1\sq # blinking block
\e[?12$p
\e[2\sq # steady block
\e[?12$p
|____|
reply \e[?12;1$y\e[?12;2$y
BLINK-4: DECSTR resets it
\e[?12h
\e[!p
\e[?12$p
|____|
reply \e[?12;2$y
BLINK-5: So does RIS
\e[?12h
\ec
\e[?12$p
|____|
reply \e[?12;2$y