diff --git a/src/bin/dosh-client.rs b/src/bin/dosh-client.rs index 862abc6..8685992 100644 --- a/src/bin/dosh-client.rs +++ b/src/bin/dosh-client.rs @@ -10290,6 +10290,7 @@ fn render_frame_bytes(frame: &Frame) -> Vec { } 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));