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
| Parameter | Description |
|---|---|
Pt | Top row of the rectangle |
Pl | Left column of the rectangle |
Pb | Bottom row of the rectangle |
Pr | Right 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
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | No evidence of rectangular erase implementation |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library |
| contour | ✓ | v0.2.0.171_rc2 | |
| foot | ✓ | Yes | DECERA ($ z) at csi.c:2097-2116 |
| Ghostty | ✗ | No | |
| iTerm2 | ✓ | Yes | VT100CSI_DECERA token parsed and executed via executeDECERA, requires vtLevel >= 400 |
| Kitty | ✗ | No | DECERA (CSI $ z) not implemented |
| Konsole | ✗ | No | No DECERA (CSI $ z) handler found; $ intermediate not processed |
| mintty | ✓ | Yes | DECERA (CSI $ z) at line 3654-3657, erases rectangular area |
| mlterm | ✓ | rel-3_1_6 | Added in commit d9d04d24 (2012-12-02); Implemented at vt_parser.c:5256-5259 |
| PuTTY | ✗ | No | |
| Rio | ✗ | No | Rectangular area operations not implemented |
| rxvt-unicode | ✗ | No | DEC rectangular area operations not implemented |
| st | ✗ | No | CSI $ z not implemented; no rectangular area operations |
| terminology | ✓ | v1.1.0 | |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Fully implemented in vteseq.cc as DECERA handler |
| WezTerm | ✗ | No | |
| Windows Terminal | ✓ | Yes | Implemented in ITermDispatch.hpp:108 as EraseRectangularArea |
| xterm | ✓ | xterm-406 | Requires OPT_DEC_RECTOPS (enabled by default) |
| xterm.js | ✗ | No | |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✗ | No | No $ intermediate handler in DoCSI |
| tmux | ✗ | No | Not implemented for input; used only for output to terminal |
| tuios | ✗ | No | |
| Zellij | ✗ | No | |
See also
- DECFRA — Fill Rectangular Area — Fill a rectangle with a specific character
- DECCRA — Copy Rectangular Area — Copy a rectangle to another position
- ED — Erase in Display — Line-oriented erase