diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-07 00:07:24 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-07 16:29:44 +0300 |
| commit | 3c2b46d24aa6c8011a1e198143752f2aa414d585 (patch) | |
| tree | a52280bccc824ca656f8bc986a756f30901974e4 /src/app/state.rs | |
| parent | 5d7e56737ef30d9de5802b0684a9428c40131dda (diff) | |
feat: add native windows beta support
Diffstat (limited to 'src/app/state.rs')
| -rw-r--r-- | src/app/state.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/app/state.rs b/src/app/state.rs index 494bee0f..32cf087d 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -1419,6 +1419,22 @@ impl AppState { self.switch_ascii_input_source_in_prefix } + pub(crate) fn pane_exposes_host_cursor( + &self, + ws_idx: usize, + pane_id: crate::layout::PaneId, + ) -> bool { + let has_effective_agent_label = self + .workspaces + .get(ws_idx) + .and_then(|ws| ws.terminal_id(pane_id)) + .and_then(|terminal_id| self.terminals.get(terminal_id)) + .and_then(crate::terminal::TerminalState::effective_agent_label) + .is_some(); + + pane_exposes_host_cursor_for_target(has_effective_agent_label, cfg!(windows)) + } + pub(crate) fn integration_updates_available(&self) -> bool { self.integration_recommendations .iter() @@ -1734,12 +1750,31 @@ impl AppState { } } +fn pane_exposes_host_cursor_for_target( + has_effective_agent_label: bool, + target_is_windows: bool, +) -> bool { + !target_is_windows || !has_effective_agent_label +} + #[cfg(test)] mod tests { use super::*; use crossterm::event::KeyEvent; #[test] + fn windows_agent_panes_do_not_expose_host_cursor() { + assert!(!pane_exposes_host_cursor_for_target(true, true)); + assert!(pane_exposes_host_cursor_for_target(false, true)); + } + + #[test] + fn non_windows_agent_panes_keep_existing_host_cursor_behavior() { + assert!(pane_exposes_host_cursor_for_target(true, false)); + assert!(pane_exposes_host_cursor_for_target(false, false)); + } + + #[test] fn built_in_theme_names_resolve() { for name in THEME_NAMES { assert!( |
