Query or Change Dynamic Colors (OSC 10–19)
Query or change dynamic colors based on their indices.
- 0x1B
- ESC
- 0x5D
- ]
- ____
- n
- 0x3B
- ;
- ____
- c
- 0x1B
- ESC
- 0x5C
- \
When n is between 10 and 19 inclusive, either query or change the
dynamic color corresponding to n depending on the value of c.
c may be provided multiple times, each separated with a semicolon (;).
If c is given as a single character ?, then the terminal will respond with
the color specification of the dynamic color at index n. If c is a valid
color specification, then the dynamic color is changed according to it.
If there are more cs left in the sequence, then n is incremented by one,
and the process repeats.
The correspondence between n and the dynamic colors are as follows:
n | Color |
|---|---|
10 | Foreground color |
11 | Background color |
12 | Cursor color |
13 | Pointer foreground color |
14 | Pointer background color |
15 | Tektronix foreground color |
16 | Tektronix background color |
17 | Highlight background color |
18 | Tektronix cursor color |
19 | Highlight foreground color |
Note
Currently, Ghostty only supports
nbetween10and12inclusive. All other dynamic colors are ignored.
As an example, this sequence changes the background color and the cursor color
to red and blue respectively:
- 0x1B
- ESC
- 0x5D
- ]
- 0x31 0x31
- 11
- 0x3B
- ;
- 0x72 0x65 0x64
- red
- 0x3B
- ;
- 0x62 0x6C 0x75 0x65
- blue
- 0x1B
- ESC
- 0x5C
- \
This is equivalent to combining an OSC 11 and an OSC 12 together:
- 0x1B
- ESC
- 0x5D
- ]
- 0x31 0x31
- 11
- 0x3B
- ;
- 0x72 0x65 0x64
- red
- 0x1B
- ESC
- 0x5C
- \
- 0x1B
- ESC
- 0x5D
- ]
- 0x31 0x32
- 12
- 0x3B
- ;
- 0x62 0x6C 0x75 0x65
- blue
- 0x1B
- ESC
- 0x5C
- \