DECTCEM ?25 — Show/hide cursor
Show or hide the text cursor.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\\x1b[
\x1b[?25h (show) \x1b[?25l (hide)\\033[
\033[?25h / \033[?25l\\e[
\e[?25h / \e[?25lESC [
ESC [ ? 2 5 h / lhex
1b 5b 3f 32 35 68 / 6cDescription
DEC Text Cursor Enable Mode. Useful for progress bars and TUIs to avoid the blinking caret on top of redrawn text. Always restore (`?25h`) on exit, including in panic / signal handlers — a stuck `?25l` will hide the user's prompt cursor until the next `tput cnorm` / terminal reset.
Spec citation: xterm-ctlseqs (DECTCEM)
Examples
printf '\033[?25l'; sleep 2; printf '\033[?25h'import sys; sys.stdout.write('\x1b[?25l')fmt.Print("\x1b[?25l")process.stdout.write('\x1b[?25l')printf("\x1b[?25l");Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- yes
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | no | no |