DECRQCRA Request Checksum of Rectangular Area
Ask for a checksum of part of the screen, to check it has not changed.
CSI Pi ; Pp ; Pt ; Pl ; Pb ; Pr * y
- Defaults
- Pt = 1, Pl = 1, Pb and Pr = the last line and column
- DEC STD 070
- §5.12.2 Request Checksum of Rectangular Area, p. 5-179
- VT510
- DECRQCRA—Request Checksum of Rectangular Area
Ask the terminal for a checksum of a rectangle of the screen, so that an application can check nothing there has changed behind its back. Pi is a label of the application’s choosing, Pp the page, and Pt, Pl, Pb and Pr the rectangle’s top, left, bottom and right, as for the other rectangle operations. The terminal answers with DECCKSR, DCS Pi ! ~ D…D ST, where D…D is the checksum as four hexadecimal digits (DEC STD 070 p. 5-181, DECCKSR). DEC STD 070 makes it part of level 4’s data integrity features, for transaction processing.
xterm, a VT420 by default, implements it (CASE_DECRQCRA), summing the characters in the rectangle with a value added for each video attribute, skipping blanks at the ends of lines, and negating the total (xtermCheckRect; its checksumExtension resource turns parts of that off). But it answers only when the GetChecksum window operation is allowed, and by default it is not: GetChecksum is in xterm’s default list of disallowed window operations (main.h). So a default xterm sends nothing.
libghostty-vt does not implement DECRQCRA either: its CSI dispatch in stream.zig has no case for the final byte y. It sends nothing, which is what a default xterm does, so the cases below pass.
Validation
DECRQCRA-1: No answer by default
ABC
\e[1;1;1;1;1;3*y
|ABC_______|
reply none
DECRQCRA-2: Nor for the whole screen
ABC
\e[7;1*y
|ABC_______|
|__________|
reply none