the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix: report the foreground group leader's cwd, not a descendant's (#3386)
caner-akca3a3792622e59
diff --git a/src/pane.rs b/src/pane.rsindex bd3f7ffdb..7340629cf 100644--- a/src/pane.rs+++ b/src/pane.rs@@ -3013,12 +3013,12 @@ impl PaneRuntime {.or_else(|| crate::platform::foreground_process_group_id(pid));let leader_cwd = foreground_pgid.and_then(absolute_process_cwd);- if leader_cwd.as_ref() == shell_cwd.as_ref() {- foreground_member_cwd_different_from_shell(pid, shell_cwd.as_ref()).or(leader_cwd)- } else {- leader_cwd- .or_else(|| foreground_member_cwd_different_from_shell(pid, shell_cwd.as_ref()))- }+ // The group leader's cwd is authoritative (issue #3270): a helper+ // process that chdirs elsewhere inside the same foreground group+ // must not override it. Scan other members only when the leader's+ // cwd cannot be read at all.+ leader_cwd+ .or_else(|| foreground_member_cwd_different_from_shell(pid, shell_cwd.as_ref()))}#[cfg(not(unix))]diff --git a/tests/api_ping.rs b/tests/api_ping.rsindex d6b253fbf..0a52e6a74 100644--- a/tests/api_ping.rs+++ b/tests/api_ping.rs@@ -969,9 +969,11 @@ fn new_terminal_cwd_follow_ignores_nonleader_group_member_cwd() {),);assert_eq!(pane["result"]["pane"]["cwd"], base.display().to_string());+ // Regression for issue #3270: the foreground group leader's cwd is+ // authoritative; the backgrounded helper's chdir must not override it.assert_eq!(pane["result"]["pane"]["foreground_cwd"],- helper_cwd.display().to_string()+ base.display().to_string());let split = send_request(