Change Pointer Shape (OSC 22)
Change the pointer shape.
- 0x1B
- ESC
- 0x5D
- ]
- 0x32 0x32
- 22
- 0x3B
- ;
- ____
- t
- 0x1B
- ESC
- 0x5C
- \
Change the pointer shape to t.
Unfortunately, there is no consensus on what values t is allowed to have.
Even xterm, the origin of this OSC, remarks that when one uses a custom
cursor theme, "expect it to provide about a third of those names, while adding
others."1
Ghostty, like some other terminals like Kitty and Foot, uses CSS's list of
standardized cursor shapes, used in the cursor property. This is by no
means perfect, but it at least is an international standard that is unambiguous
and platform-independent.
Avoid using this sequence unless your program only targets certain terminal emulators, or you can switch between cursor names by detecting the current terminal.
| Ghostty | Kitty | VTE | Alacritty | Foot | iTerm2 | xterm | |
|---|---|---|---|---|---|---|---|
| OSC 22 | 1.0.0 | 0.31.0 | No | No | 1.12.0 | 3.5.0 | 367 |
| Cursor styles | CSS | CSS | - | - | CSS + X11 subset2 | Custom X11 subset | X11 |
-
https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:pointerShape ↩
-
Foot maps both CSS and X11 names to
wp_cursor_shape_device_v1::shapeenums, which are also based on the CSS standard. ↩