Skip to main content
ansicode

DECSET ?12 — Cursor blink

Enable or disable the blinking attribute of the cursor — independent of cursor shape.

Byte forms

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

\\x1b[\x1b[?12h (start blinking) \x1b[?12l (stop blinking)
\\033[\033[?12h / \033[?12l
\\e[\e[?12h / \e[?12l
ESC [ESC [ ? 1 2 h / l
hex1b 5b 3f 31 32 68 / 6c

Description

Toggle the cursor-blink attribute. Distinct from DECSCUSR (`\x1b[N SP q`), which combines shape AND blink in one parameter: with `?12` you can keep the user's preferred shape (block / bar / underline) and just override whether it blinks. Used by editors that want a steady cursor in normal mode and a blinking one in insert mode WITHOUT touching the user's chosen shape. Reset to terminal default by combining with DECSCUSR `\x1b[0 q` or DECSTR (`\x1b[!p`).

Spec citation: xterm-ctlseqs (Private mode 12)

Examples

bash
printf '\033[?12h'   # start blinking\nprintf '\033[?12l'   # stop blinking
python
import sys; sys.stdout.write('\x1b[?12l')
go
fmt.Print("\x1b[?12l")
javascript
process.stdout.write('\x1b[?12l')
c
printf("\x1b[?12l");

Terminal support

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

Related sequences

In the family cookbook

DEC cookbook · 3. Cursor visibility & blink — `?25`, `?12`