Repository navigation
Make DECRQCRA opt-in (TerminalOptions.ChecksumReportsEnabled, default off) - #191
Merged
Merged
Conversation
JohnCampionJr
commented
Nov 6, 2026
JohnCampionJr
left a comment
Collaborator
Author
There was a problem hiding this comment.
Pre-merge review (Codex), for the PR author
No findings. Checked the default-off DECRQCRA gate, silence while disabled, runtime opt-in, VT-level ordering, cloning/copying and tests. The option and copy-constructor additions combine cleanly with the configurable word-separator PR. The combined core PRs build and pass 212 filtered tests, including checksum, device-report, terminal-options, selection, word-separator, OSC-terminator and text-sizing cases. No approval or merge action is being taken.
tomlm
approved these changes
Nov 9, 2026
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #190
Why
DECRQCRA (
CSI Pid ; Pp ; Pt ; Pl ; Pb ; Pr * y) reports a checksum of a rectangle of the screen. Asked one cell at a time, the checksums spell out the text. That lets a program, or a remote host the user has just ssh'd to, read what was on screen before it started, including the alternate screen the last full-screen app left behind. WezTerm turned it off by default for this reason (wezterm/wezterm#7701), xterm gates it behindallowWindowOps(GetChecksum), iTerm2 shows a prompt first, and Ghostty doesn't implement it.What changed
TerminalOptions.ChecksumReportsEnabled, defaultfalse. It sits next toClipboardReadEnabled, the other read-back gate, and is copied by the copy constructor.RequestChecksumRectangularAreareturns without replying when the option is off, after the existing VT400 level gate. "No reply" is what xterm and WezTerm send when it's disallowed, and a canned value could be mistaken for a real sum. With the option on, behaviour is unchanged.Capabilitiesstring has no checksum code, XTGETTCAP has no entry for it, and no DECRQM mode covers it. DA attribute 28 means rectangular editing in general (DECCRA, DECFRA and the rest), which is still supported, so it stays.Behaviour change / how to opt in
DECRQCRA now gets no reply unless a host turns it on. esctest reads every cell back through it, so a conformance run needs:
Tests
ChecksumReportTeststhrough its helper,DeviceReportTests.Decrqcra_IsSilentBelowLevel64, andVtTestBehaviourTests.Rectangular_area_checksums_negate_the_sum_of_the_characters.Is_silent_by_default(no reply from a default terminal) andIs_silent_when_disabled_and_answers_once_enabled(no reply while off, the correct checksum after the option is turned on at runtime).Constructor_SetsDefaultValuesasserts the default is off. The reflection-basedClone_CopiesEverySettablePropertycovers the copy.Is_silent_by_defaultandConstructor_SetsDefaultValuesClone_CopiesEverySettablePropertyand the checksum tests🤖 Generated with Claude Code