Release stranded synchronized terminal output
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-17 17:59:22 -04:00
parent 30952aa488
commit 00a56fa53e
+12
View File
@@ -10290,6 +10290,7 @@ fn render_frame_bytes(frame: &Frame) -> Vec<u8> {
}
const TERMINAL_SNAPSHOT_RESET: &[u8] = concat!(
"\x1b[?2026l",
"\x1b[0m",
"\x1b[?25h",
"\x1b[?1003l",
@@ -10741,6 +10742,7 @@ impl Drop for RawMode {
}
const TERMINAL_CLEANUP: &[u8] = concat!(
"\x1b[?2026l",
"\x1b[?1l",
"\x1b[0m",
"\x1b[?25h",
@@ -11707,6 +11709,10 @@ mod tests {
let bytes = render_frame_bytes(&frame);
assert!(bytes.starts_with(TERMINAL_SNAPSHOT_RESET));
assert!(
bytes.starts_with(b"\x1b[?2026l"),
"a reconnect snapshot must release a stranded synchronized-output update first"
);
assert!(bytes.ends_with(b"frame-7"));
}
@@ -11899,6 +11905,12 @@ mod tests {
assert!(TERMINAL_CLEANUP.windows(8).any(|w| w == b"\x1b[?1016l"));
}
#[test]
fn terminal_resets_release_synchronized_output_before_other_cleanup() {
assert!(TERMINAL_SNAPSHOT_RESET.starts_with(b"\x1b[?2026l"));
assert!(TERMINAL_CLEANUP.starts_with(b"\x1b[?2026l"));
}
#[test]
fn unowned_mouse_reports_are_stripped_unless_tui_owns_mouse() {
assert!(should_strip_unowned_terminal_reports(false, false));