Work around old Zellij by parsing unsolicited DECRQM

Zellij 0.41.2 has a bug where it responds to

	 printf '\x1b[?2026$p'; cat -v

with '^[[2026;2$y' (DECRQM) instead of '^[[?2026;2$y' (DECRPM).

This is fixed by https://github.com/zellij-org/zellij/pull/3884

We fail to parse it, leading to an extra y added to the input queue.
Since it seems easy to work around for us, let's do that, I guess.
This commit is contained in:
Johannes Altmanninger 2025-01-13 21:49:57 +01:00
parent cbbf95ee55
commit c77c35152d

View file

@ -961,14 +961,16 @@ pub trait InputEventQueuer {
let key = match c { let key = match c {
b'$' => { b'$' => {
// DECRPM if next_char(self) == b'y' {
if private_mode == Some(b'?') && next_char(self) == b'y' { if private_mode == Some(b'?') {
if params[0][0] == 2026 && matches!(params[1][0], 1 | 2) { // DECRPM
self.push_front(CharEvent::Implicit( if params[0][0] == 2026 && matches!(params[1][0], 1 | 2) {
ImplicitEvent::SynchronizedOutputSupported, self.push_front(CharEvent::Implicit(
)); ImplicitEvent::SynchronizedOutputSupported,
));
}
} }
// DECRQM
return None; return None;
} }
match params[0][0] { match params[0][0] {