aboutsummaryrefslogtreecommitdiff
path: root/src/raw_input.rs
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-09-14 03:42:21 +0400
committerGitHub <noreply@github.com>2026-09-14 02:42:21 +0300
commit247f6d1f82a524dba87dd9f2fe9cb2aedb01932e (patch)
tree409a4968581f40e3ad83e669ddc40081f2b7f12a /src/raw_input.rs
parentaa961df943b874730b23f78baf94af7332f7acfa (diff)
fix(client): re-assert host mouse modes after a terminal reconnect (#4079)
Co-authored-by: dengos <dengoswei@gmail.com>
Diffstat (limited to 'src/raw_input.rs')
-rw-r--r--src/raw_input.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/raw_input.rs b/src/raw_input.rs
index fc6ff52e..147d6e39 100644
--- a/src/raw_input.rs
+++ b/src/raw_input.rs
@@ -543,6 +543,13 @@ pub(crate) fn events_require_host_surface_redraw(
.any(|event| matches!(event, RawInputEvent::OuterFocusGained))
}
+#[cfg(any(unix, test))]
+pub(crate) fn events_require_host_mode_refresh(events: &[RawInputEvent]) -> bool {
+ events
+ .iter()
+ .any(|event| matches!(event, RawInputEvent::OuterFocusGained))
+}
+
#[cfg(any(not(windows), test))]
pub(crate) fn events_require_host_terminal_appearance_query(events: &[RawInputEvent]) -> bool {
events
@@ -1356,6 +1363,16 @@ mod tests {
}
#[test]
+ fn outer_focus_gained_requests_host_mode_refresh() {
+ assert!(events_require_host_mode_refresh(
+ &parse_raw_input_bytes_sync(b"\x1b[I")
+ ));
+ assert!(!events_require_host_mode_refresh(
+ &parse_raw_input_bytes_sync(b"\x1b[O")
+ ));
+ }
+
+ #[test]
fn outer_focus_gained_requests_host_appearance_query() {
let gained = parse_raw_input_bytes_sync(b"\x1b[I");
let lost = parse_raw_input_bytes_sync(b"\x1b[O");