^[control-codes
live in libghostty-vt

Control sequences

DECFRA Fill Rectangular Area

View as Markdown

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).

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993YesDECFRA
xtermpatch 412, xterm-411aYesneeds Pch; also accepts code points above 255
libghostty-vt0f171f6Noignored
kitty0.49.1, run in a VMNofails the 4 cases that show it working
foot1.28.0, run in a VMPartlyfails DECFRA-5 of the 3 cases that show it working
pyte0.8.2, run as a libraryNofails the 4 cases that show it working
xterm.js headless6.0.0, run as a libraryNofails the 4 cases that show it working
alacritty_terminal0.26.0, run as a libraryNofails the 4 cases that show it working
ConEmubuild 230724, its documentationNonot in its list: ANSI escape codes
rxvt-unicode9.31, run in a VMNofails the 4 cases that show it working
VTE0.84.1, run as a libraryYespasses the 4 cases that show it working

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 margins
|______|
|_****_|
|_****_|
|_****_|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.