OSC 22 — Set X11 mouse pointer / cursor name
Override the mouse-pointer glyph the terminal window draws — historically xterm-specific, exposed via standard X cursor names.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b]22;CURSOR-NAME\x07\033]22;CURSOR-NAME\007\e]22;CURSOR-NAME\aESC ] 22 ; CURSOR-NAME BEL1b 5d 32 32 3b ... 07Description
OSC 22 sets the X-server cursor name for the terminal window — the mouse pointer glyph the user sees when hovering over the terminal. The argument is one of the standard X cursor names (xcursor library): `xterm` (the I-beam — default), `crosshair`, `hand2`, `watch`, `wait`, `pirate`, `pencil`, etc. Used by full-screen TUI applications that want to signal mode changes via cursor shape (e.g. `pirate` while a long operation runs, `xterm` when input is accepted), or by terminal-based games. Strictly xterm-specific historically — the OSC body is passed straight to `XDefineCursor` so it only makes sense on X11-backed terminals. Non-X11 terminals universally ignore. Empty argument (`\x1b]22;\x07`) resets to the user's default pointer.
Spec citation: xterm-ctlseqs (OSC 22)
Examples
printf '\033]22;watch\007' # show a wait-cursor while a long job runs\nsleep 5\nprintf '\033]22;xterm\007' # restore I-beamimport sys; sys.stdout.write('\x1b]22;watch\x07')fmt.Print("\x1b]22;watch\x07")process.stdout.write('\x1b]22;watch\x07')printf("\x1b]22;watch\x07");Terminal support
- xterm
- yes
- Linux console (fbcon)
- no
- macOS Terminal.app
- no
- iTerm2
- no
- Windows Terminal
- no
- cmd.exe / ConPTY
- no
- kitty
- no
- alacritty
- no
- WezTerm
- no
- Ghostty
- no
- GNOME Terminal
- no
- Konsole
- no
- 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 | no | no | no | no | no | no | no | no | no | no | no | no | no |