DECTCEM
AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard
DECTCEM (Mode 25) is a DECSET/DECRST mode that controls whether the text cursor is visible on screen.
Syntax
CSI ? 25 h DECSET — Show cursor
CSI ? 25 l DECRST — Hide cursor
Formal syntax
DECSET-mode25 = 0x1b, "[", "?", "2", "5", "h" ; DECRST-mode25 = 0x1b, "[", "?", "2", "5", "l" ;
Description
Per the VT220 Programmer Reference and VT510 Programmer Reference, DECTCEM (Text Cursor Enable Mode) controls the visibility of the text cursor.
- Set — The cursor is visible. This is the default.
- Reset — The cursor is hidden. The cursor position is still tracked internally and all positioning sequences continue to work; the cursor is simply not rendered on screen.
Common uses
Hiding the cursor is one of the most commonly used DECSET modes. Applications hide the cursor to:
- Prevent the cursor from flickering during screen updates
- Create a cleaner visual display for status bars, menus, or animations
- Avoid distracting cursor artifacts when drawing full-screen interfaces
Well-behaved applications should always restore cursor visibility (DECSET mode 25) before exiting. Many terminal multiplexers and shell prompts reset this mode to ensure the cursor is visible.
note
DECTCEM only controls whether the cursor is drawn. It does not affect the cursor position, which continues to be tracked. Sequences like CUP and DSR/CPR still work correctly when the cursor is hidden.
Examples
printf '\e[?25l' # Hide the cursor
printf '\e[?25h' # Show the cursor
# Hide cursor during a screen update
printf '\e[?25l' # Hide cursor
printf '\e[2J\e[H' # Clear screen and move home
# ... draw the interface ...
printf '\e[?25h' # Show cursor when done
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | |
| Bobcat | ? | ? | Cursor visibility is supported (cursor styles are configurable), but cannot confirm DECTCEM sequence support from Bobcat's code. |
| contour | ✓ | v0.3.10.257 | Implemented as DECMode::VisibleCursor at primitives.h:683, handled in Terminal.cpp:2394 |
| foot | ✓ | Yes | |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | v20260216-nightly | |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | MODE_Cursor (mode 25) controls cursor visibility |
| mintty | ✓ | Yes | Implemented at src/termout.c:2442 |
| mlterm | ✓ | rel-0_2_1 | Present since initial public release |
| PuTTY | ✓ | 0.49 | |
| Rio | ✓ | v0.1.13 | |
| rxvt-unicode | ✓ | 1.2 | |
| st | ✓ | 0.1 | |
| terminology | ✓ | v0.9.0 | Uses termstate.hide_cursor flag |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | |
| Windows Terminal | ✓ | Yes | DECTCEM_TextCursorEnableMode at adaptDispatch.cpp:1808-1810 |
| xterm | ✓ | Yes | VT200 feature, implemented early in xterm history |
| xterm.js | ✓ | 0.10 | |
| Multiplexers | |||
| cy | ✓ | Yes | |
| GNU Screen | ✓ | v.4.2.0 | Present since at least v.4.0.2 (2005) |
| tmux | ✓ | 0.8 | |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.31.2 | |
See also
- DECSCUSR — Set Cursor Style — Change cursor shape (block, underline, bar)
- Blink Cursor — Mode 12 — Toggle cursor blinking