^[control-codes live in libghostty-vt

Control sequences

DECFRA Fill Rectangular Area

Fill a rectangle of the screen with one character, in the current rendition.

CSI Pch ; Pt ; Pl ; Pb ; Pr $ x
Defaults
Pt = 1, Pl = 1, Pb and Pr = the last line and column; Pch has none in xterm
DEC STD 070
§5.12.1 Fill Rectangular Area, p. 5-170
VT510
DECFRA—Fill Rectangular Area

Fill the rectangle from line Pt, column Pl to line Pb, column Pr with the character whose code is Pch, in the current rendition set by SGR. The cursor does not move. The rectangle works as it does for DECERA: corners left out or 0 take the screen’s edge, values past the edge are taken as the edge, an upside-down rectangle does nothing, and only origin mode brings the margins into it.

DEC STD 070 allows Pch from 32 to 126 and from 160 to 255, and has the whole control ignored for anything else. xterm also accepts any printable Unicode code point above 255, and the cases follow xterm (CASE_DECFRA, whose comment says as much). Unlike DEC STD 070, xterm needs Pch to be given: with no parameters at all, DECFRA does nothing.

Not in libghostty-vt

DECFRA is one of the VT420’s rectangle operations, level 4 in DEC STD 070. libghostty-vt, a VT220 (see DA), has no handler for CSI … $ x in stream.zig and ignores it. xterm is a VT420 by default and implements it, so every case below expects xterm’s result and is a known difference (see the sources page).

Validation

DECFRA-1: Fill a rectangle

abcdef\r\nghijkl\r\nmnopqr\r\nstuvwx
\e[1;3H
\e[37;2;2;3;4$x # 37 is %
|abcdef|
|g%%%kl|
|m%%%qr|
|stuvwx|
cursor 1,3

DECFRA-2: The whole screen by default

\e[88$x   # 88 is X
|XXXXXX|
|XXXXXX|
|XXXXXX|

DECFRA-3: In the current rendition

\e[1;4m   # bold, underlined
\e[88;1;1;1;2$x
\e[0m
|XX____|
attr 1,1 bold underline
attr 1,2 bold underline

DECFRA-4: A character beyond Latin-1

\e[9472;1;1;1;6$x # 9472 is U+2500
|──────|
|______|

DECFRA-5: Counted from the margins in origin mode

\e[?69h   # allow left and right margins
\e[2;5s   # margins at columns 2 and 5
\e[2;4r   # region is lines 2 to 4
\e[?6h    # origin mode
\e[42;1;1;9;9$x # 42 is *, clipped to the screen
|______|
|_*****|
|_*****|
|_*****|