aboutsummaryrefslogtreecommitdiff
path: root/src/app/actions.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-17 01:41:17 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-17 01:41:17 +0300
commitf7fe0f203e0f349df33819aab239c0aade016f79 (patch)
tree51540d4a040a1a2d32ecf73c5c2d9277a7d4efef /src/app/actions.rs
parent3ecacfddae86d603bfd0d1a0c01602b1d34b1df3 (diff)
fix: polish terminal-core agent semantics
Diffstat (limited to 'src/app/actions.rs')
-rw-r--r--src/app/actions.rs14
1 files changed, 10 insertions, 4 deletions
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<WorkspaceGitStatus>) -> 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)