From f7fe0f203e0f349df33819aab239c0aade016f79 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 17 May 2026 01:41:17 +0300 Subject: fix: polish terminal-core agent semantics --- src/app/actions.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/app/actions.rs') diff --git a/src/app/actions.rs b/src/app/actions.rs index 27ca7474..faa5717d 100644 --- a/src/app/actions.rs +++ b/src/app/actions.rs @@ -693,18 +693,23 @@ impl AppState { pub fn apply_workspace_git_statuses(&mut self, results: Vec) -> bool { let mut changed = false; for result in results { - let Some(ws) = self + let Some(ws_idx) = self .workspaces - .iter_mut() - .find(|ws| ws.id == result.workspace_id) + .iter() + .position(|ws| ws.id == result.workspace_id) else { continue; }; - if ws.resolved_identity_cwd().as_ref() != Some(&result.resolved_identity_cwd) { + if self.workspaces[ws_idx] + .resolved_identity_cwd_from(&self.terminals, &self.terminal_runtimes) + .as_ref() + != Some(&result.resolved_identity_cwd) + { continue; } + let ws = &mut self.workspaces[ws_idx]; if ws.cached_git_branch != result.branch { ws.cached_git_branch = result.branch; changed = true; @@ -1050,6 +1055,7 @@ mod tests { } fn mark_agent(state: &mut AppState, ws_idx: usize, tab_idx: usize, pane_id: PaneId) { + state.ensure_test_terminals(); let terminal_id = state.workspaces[ws_idx].tabs[tab_idx] .panes .get(&pane_id) -- cgit v1.2.3