Skip to main content

DECERA

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard

DECERA (Erase Rectangular Area) is a CSI sequence that fills a rectangular screen region with blank characters.

Syntax​

CSI Pt ; Pl ; Pb ; Pr $ z    DECERA — Erase Rectangular Area
Formal syntax
DECERA = 0x1b, "[", Pt, ";", Pl, ";", Pb, ";", Pr, "$", "z" ;
Pt = digit, { digit } ;                 (* top row *)
Pl = digit, { digit } ;                 (* left column *)
Pb = digit, { digit } ;                 (* bottom row *)
Pr = digit, { digit } ;                 (* right column *)
digit = "0" | "1" | "2" | "3" | "4"
    | "5" | "6" | "7" | "8" | "9" ;

Parameters​

ParameterDescription
PtTop row of the rectangle
PlLeft column of the rectangle
PbBottom row of the rectangle
PrRight column of the rectangle

Description​

Per the VT510 manual, DECERA fills the specified rectangular area with blank (space) characters using the current SGR attributes. The cursor position is not changed.

Coordinates are 1-based and refer to absolute screen positions (not affected by DECOM). If coordinates exceed the screen dimensions, they are clamped.

DECERA differs from ED in that it operates on an arbitrary rectangle rather than line-oriented regions. This is part of the VT400-series rectangular area operations (along with DECFRA and DECCRA).

Examples​

printf '\e[5;10;15;30$z'   # Erase rectangle from (5,10) to (15,30)

Specifications​

SpecificationSection
VT510 Reference—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoNo evidence of rectangular erase implementation
Bobcat✓0.9.0Supported via TerminalCtrl library
contour✓v0.2.0.171_rc2
foot✓YesDECERA ($ z) at csi.c:2097-2116
Ghostty✗No
iTerm2✓YesVT100CSI_DECERA token parsed and executed via executeDECERA, requires vtLevel >= 400
Kitty✗NoDECERA (CSI $ z) not implemented
Konsole✗NoNo DECERA (CSI $ z) handler found; $ intermediate not processed
mintty✓YesDECERA (CSI $ z) at line 3654-3657, erases rectangular area
mlterm✓rel-3_1_6Added in commit d9d04d24 (2012-12-02); Implemented at vt_parser.c:5256-5259
PuTTY✗No
Rio✗NoRectangular area operations not implemented
rxvt-unicode✗NoDEC rectangular area operations not implemented
st✗NoCSI $ z not implemented; no rectangular area operations
terminology✓v1.1.0
VT100✗No
VTE✓YesFully implemented in vteseq.cc as DECERA handler
WezTerm✗No
Windows Terminal✓YesImplemented in ITermDispatch.hpp:108 as EraseRectangularArea
xterm✓xterm-406Requires OPT_DEC_RECTOPS (enabled by default)
xterm.js✗No
Multiplexers
cy✗No
GNU Screen✗NoNo $ intermediate handler in DoCSI
tmux✗NoNot implemented for input; used only for output to terminal
tuios✗No
Zellij✗No

See also​