Text sizing¶
Two mechanisms let text occupy something other than one cell per character: the DEC double-width and double-height lines from the VT100, and kitty's per-string text sizing protocol from 2025.
DEC line attributes¶
Status: DEC.
ESC # 3 DECDHL top half of a double-height, double-width line
ESC # 4 DECDHL bottom half
ESC # 5 DECSWL single-width, single-height (default)
ESC # 6 DECDWL double-width, single-height
The attribute applies to the whole current line. A double-width line holds
half the columns; text beyond that is discarded. Double height needs two lines
carrying the same text, one with ESC # 3 and one with ESC # 4.
The VT100 rendered these with hardware; emulators must scale glyphs. xterm does. Most modern emulators parse and ignore the sequences.
kitty text sizing protocol¶
Status: Vendor-private. Adopters other than kitty: ?.
OSC 66 ; metadata ; text ST
metadata is a comma-separated list of key=value pairs:
| Key | Meaning |
|---|---|
s |
Scale: the text is rendered s cells tall, 1–7 |
w |
Width: the number of cells the text occupies, overriding measurement |
n, d |
Fractional scale numerator and denominator for subscript-style sizes |
v |
Vertical alignment within the scaled block: 0 top, 1 bottom, 2 centered |
h |
Horizontal alignment: 0 left, 1 right, 2 centered |
The text is at most a small number of code points and cannot contain
controls. w alone, with s=1, is the protocol's answer to width skew: the
application states how many cells the text should take, and the terminal
obeys instead of consulting its own tables.
Terminals that do not implement OSC 66 ignore the whole sequence, including
the text, so an application must query first. kitty documents detection via
its keyboard or graphics query paths and via TERM_PROGRAM; a generic probe
is to send OSC 66 with w=1 and measure with CSI 6 n.
Probe¶
printf '\033#6wide line\033#5\n'
printf '\033#3TALL\n\033#4TALL\n\033#5'
printf '\033]66;s=2;Big\033\\\n\n'
printf '\033]66;w=2;\xe2\x9d\xa4\033\\\033[6n' # heart forced to width 2
Sources¶
Compatibility¶
Choose terminals
| Feature / stable ID | Alacritty | Apple Terminal | ConPTY (conhost) | Contour | DomTerm | foot | Ghostty | iTerm2 | kitty | Konsole | mintty | mlterm | PuTTY | Revenant | RLogin | st | tmux | rxvt-unicode | VTE | wayst | WezTerm | Windows Terminal | xterm | xterm.js |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OSC 66osc-66-text-sizing |
Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | SupportedImported · unverified | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown |
DECDWL/DECDHL renderedesc-double-size-lines |
Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | SupportedImported · unverified | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | SupportedImported · unverified | Unknown |