diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-06 02:27:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-06 02:27:06 +0300 |
| commit | 9e9bc8a144667a6b7debfd4f0c7a31ff0e11493a (patch) | |
| tree | 03f1259f91fd9edeacfd4b904f2e84d4acf25232 /src/client/shell/input.rs | |
| parent | 35b0dff96579f099e0436290085024424ffb289c (diff) | |
feat: manage multiple ssh machines from one client (#3670)
Diffstat (limited to 'src/client/shell/input.rs')
| -rw-r--r-- | src/client/shell/input.rs | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/src/client/shell/input.rs b/src/client/shell/input.rs index d2ca3a82..f8826136 100644 --- a/src/client/shell/input.rs +++ b/src/client/shell/input.rs @@ -236,6 +236,9 @@ impl ClientShellState { self.outer_focused = Some(true); outcome.query_host_appearance = true; outcome.repaint |= self.config.redraw_on_focus_gained; + if let Some(surface) = self.pane_surface.clone() { + outcome.repaint |= self.acknowledge_active_surface_agents(&surface); + } outcome .requests .push(ClientMessage::ClientShellFocus { focused: true }); @@ -798,7 +801,36 @@ impl ClientShellState { ) { use crate::input::{KeybindAction, KeybindMatch}; - let indexed_target_exists = match &binding { + if !self.indexed_navigation_target_exists(&binding) { + return; + } + + if let KeybindMatch::Action(KeybindAction::CyclePaneNext) = binding { + self.cycle_pane(false, outcome); + } else if let KeybindMatch::Action(KeybindAction::CyclePanePrevious) = binding { + self.cycle_pane(true, outcome); + } else { + if !preserve_navigate { + self.mode = ClientShellMode::Terminal; + } + self.record_binding(binding, outcome); + } + if !preserve_navigate { + if self.mode == ClientShellMode::Navigate { + self.mode = self.copy_or_terminal_mode(); + } + self.navigate_workspace_id = None; + } + outcome.repaint = true; + } + + pub(super) fn indexed_navigation_target_exists( + &self, + binding: &crate::input::KeybindMatch, + ) -> bool { + use crate::input::{KeybindAction, KeybindMatch}; + + match binding { KeybindMatch::Action(KeybindAction::SwitchWorkspace(index)) => { self.snapshot.as_deref().is_some_and(|snapshot| { self.navigation_workspace_entries(snapshot) @@ -819,38 +851,15 @@ impl ClientShellState { }) .is_some(), KeybindMatch::Action(KeybindAction::FocusAgent(index)) => { - self.snapshot.as_deref().is_some_and(|snapshot| { - super::agent_sidebar::ordered_agent_pane_ids( - snapshot, - self.config.agent_panel_sort, - ) - .get(*index) - .is_some() - }) + super::aggregate_navigation::online_agent_targets( + &self.endpoints, + self.config.agent_panel_sort, + ) + .get(*index) + .is_some() } _ => true, - }; - if !indexed_target_exists { - return; } - - if let KeybindMatch::Action(KeybindAction::CyclePaneNext) = binding { - self.cycle_pane(false, outcome); - } else if let KeybindMatch::Action(KeybindAction::CyclePanePrevious) = binding { - self.cycle_pane(true, outcome); - } else { - if !preserve_navigate { - self.mode = ClientShellMode::Terminal; - } - self.record_binding(binding, outcome); - } - if !preserve_navigate { - if self.mode == ClientShellMode::Navigate { - self.mode = self.copy_or_terminal_mode(); - } - self.navigate_workspace_id = None; - } - outcome.repaint = true; } fn move_navigate_workspace(&mut self, delta: isize) { |
