Skip to main content

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​

ParameterDescription
Pts;Pls;Pbs;PrsSource rectangle (top, left, bottom, right)
PpsSource page (typically 1)
Ptd;PldDestination top-left corner (row, column)
PpdDestination 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​

SpecificationSection
VT510 Reference—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoNo evidence of rectangular copy implementation
Bobcat✓0.9.0Supported via TerminalCtrl library
contour✓v0.2.0.171_rc2
foot✓YesDECCRA ($ v) at csi.c:1999-2070
Ghostty✗No
iTerm2✓YesVT100CSI_DECCRA token parsed and executed via executeDECCRA, requires vtLevel >= 400
Kitty✗NoDECCRA (CSI $ v) not implemented
Konsole✗NoNo DECCRA (CSI $ v) handler found; $ intermediate not processed
mintty✓YesDECCRA (CSI $ v) at line 3643-3649, copies rectangular area
mlterm✓rel-3_1_6Added in commit d9d04d24 (2012-12-02); Implemented at vt_parser.c:5267-5279
PuTTY✗No
Rio✗NoRectangular area operations not implemented
rxvt-unicode✗NoDEC rectangular area operations not implemented
st✗NoCSI $ v not implemented; no rectangular area operations
terminology✓v1.4.0
VT100✗No
VTE✓YesFully implemented in vteseq.cc as DECCRA handler
WezTerm✗No
Windows Terminal✓YesImplemented in ITermDispatch.hpp:106 as CopyRectangularArea
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​