DECCRA
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
DECCRA (Copy Rectangular Area) is a CSI sequence that copies a rectangular screen region to another location.
Syntax
CSI Pts;Pls;Pbs;Prs;Pps;Ptd;Pld;Ppd $ v DECCRA — Copy Rectangular Area
Formal syntax
DECCRA = 0x1b, "[", Pts, ";", Pls, ";", Pbs, ";", Prs, ";",
Pps, ";", Ptd, ";", Pld, ";", Ppd, "$", "v" ;
Pts = digit, { digit } ; (* source top row *)
Pls = digit, { digit } ; (* source left column *)
Pbs = digit, { digit } ; (* source bottom row *)
Prs = digit, { digit } ; (* source right column *)
Pps = digit, { digit } ; (* source page, usually 1 *)
Ptd = digit, { digit } ; (* destination top row *)
Pld = digit, { digit } ; (* destination left column *)
Ppd = digit, { digit } ; (* destination page, usually 1 *)
digit = "0" | "1" | "2" | "3" | "4"
| "5" | "6" | "7" | "8" | "9" ;Parameters
| Parameter | Description |
|---|---|
Pts;Pls;Pbs;Prs | Source rectangle (top, left, bottom, right) |
Pps | Source page (typically 1) |
Ptd;Pld | Destination top-left corner (row, column) |
Ppd | Destination page (typically 1) |
Description
Per the VT510 manual, DECCRA copies the rectangular region defined by the source coordinates to the destination position. Both character content and attributes are copied. The cursor position is not changed.
The source area is not modified. If the source and destination overlap, the result is as if the source were copied to a temporary buffer first.
The page parameters (Pps, Ppd) are a legacy concept from multi-page DEC terminals. Modern terminals typically only have one page, so these are usually set to 1.
Coordinates are 1-based and refer to absolute screen positions.
Examples
# Copy the rectangle (1,1)-(10,40) to position (15,1) on page 1
printf '\e[1;1;10;40;1;15;1;1$v'
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | No evidence of rectangular copy implementation |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library |
| contour | ✓ | v0.2.0.171_rc2 | |
| foot | ✓ | Yes | DECCRA ($ v) at csi.c:1999-2070 |
| Ghostty | ✗ | No | |
| iTerm2 | ✓ | Yes | VT100CSI_DECCRA token parsed and executed via executeDECCRA, requires vtLevel >= 400 |
| Kitty | ✗ | No | DECCRA (CSI $ v) not implemented |
| Konsole | ✗ | No | No DECCRA (CSI $ v) handler found; $ intermediate not processed |
| mintty | ✓ | Yes | DECCRA (CSI $ v) at line 3643-3649, copies rectangular area |
| mlterm | ✓ | rel-3_1_6 | Added in commit d9d04d24 (2012-12-02); Implemented at vt_parser.c:5267-5279 |
| PuTTY | ✗ | No | |
| Rio | ✗ | No | Rectangular area operations not implemented |
| rxvt-unicode | ✗ | No | DEC rectangular area operations not implemented |
| st | ✗ | No | CSI $ v not implemented; no rectangular area operations |
| terminology | ✓ | v1.4.0 | |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Fully implemented in vteseq.cc as DECCRA handler |
| WezTerm | ✗ | No | |
| Windows Terminal | ✓ | Yes | Implemented in ITermDispatch.hpp:106 as CopyRectangularArea |
| 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
- DECERA — Erase Rectangular Area — Erase a rectangular region
- DECFRA — Fill Rectangular Area — Fill a rectangle with a character