Skip to content

Commit

Permalink
DECRQCRA: treat uninitialized cells as spaces
Browse files Browse the repository at this point in the history
The concept of uninitialized cells in wezterm is not the same as that on
VT520 or that on xterm, so treat them as spaces, at least when asking
for the checksum of a single cell, which is what esctest does.
  • Loading branch information
ninjalj authored and wez committed Nov 22, 2023
1 parent fde9267 commit 769840d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion term/src/terminalstate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,17 @@ impl TerminalState {
checksum += u16::from(ch as u8);
}
}
checksum

// Treat uninitialized cells as spaces.
// The concept of uninitialized cells in wezterm is not the same as that on VT520 or that
// on xterm, so, to prevent a lot of noise in esctest, treat them as spaces, at least when
// asking for the checksum of a single cell (which is what esctest does).
// See: https://github.com/wez/wezterm/pull/4565
if checksum == 0 {
32u16
} else {
checksum
}
}

fn perform_csi_window(&mut self, window: Window) {
Expand Down

0 comments on commit 769840d

Please sign in to comment.