aboutsummaryrefslogtreecommitdiff
path: root/src/app/mod.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/mod.rs
parent3ecacfddae86d603bfd0d1a0c01602b1d34b1df3 (diff)
fix: polish terminal-core agent semantics
Diffstat (limited to 'src/app/mod.rs')
-rw-r--r--src/app/mod.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs
index c5654db2..1c818a9c 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -412,8 +412,11 @@ impl App {
state.terminals = restored_terminals;
state.terminal_runtimes = restored_terminal_runtimes;
- for ws in &mut state.workspaces {
- ws.refresh_git_branch();
+ for ws_idx in 0..state.workspaces.len() {
+ let cwd = state.workspaces[ws_idx]
+ .resolved_identity_cwd_from(&state.terminals, &state.terminal_runtimes);
+ state.workspaces[ws_idx].cached_git_branch =
+ cwd.as_deref().and_then(crate::workspace::git_branch);
}
// Background auto-update is disabled in monolithic no-session mode
@@ -1702,7 +1705,7 @@ mod tests {
}
#[test]
- fn terminal_target_resolves_unique_manual_name() {
+ fn terminal_target_resolves_unique_agent_name() {
let mut app = test_app();
let workspace = Workspace::test_new("terminal-target-name");
let pane = workspace.tabs[0].root_pane;
@@ -1718,7 +1721,7 @@ mod tests {
.terminals
.get_mut(&attached_terminal_id)
.unwrap()
- .manual_label = Some("reviewer".into());
+ .set_agent_name("reviewer".into());
app.state.active = Some(0);
app.state.selected = 0;
@@ -1746,7 +1749,7 @@ mod tests {
}
#[test]
- fn terminal_target_reports_ambiguous_duplicate_manual_name() {
+ fn terminal_target_reports_ambiguous_duplicate_agent_name() {
let mut app = test_app();
let mut workspace = Workspace::test_new("terminal-target-ambiguous");
let first = workspace.tabs[0].root_pane;
@@ -1762,7 +1765,7 @@ mod tests {
.terminals
.get_mut(&first_terminal_id)
.unwrap()
- .manual_label = Some("worker".into());
+ .set_agent_name("worker".into());
let second_terminal_id = app.state.workspaces[0]
.pane_state(second)
.unwrap()
@@ -1772,7 +1775,7 @@ mod tests {
.terminals
.get_mut(&second_terminal_id)
.unwrap()
- .manual_label = Some("worker".into());
+ .set_agent_name("worker".into());
app.state.active = Some(0);
app.state.selected = 0;