aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcaner-akca <94343893+caner-akca@users.noreply.github.com>2026-08-30 03:02:22 +0300
committerGitHub <noreply@github.com>2026-08-30 03:02:22 +0300
commit3a3792622e59c7f2dc20f9c0236167161e4a5035 (patch)
treec7528695eca040fb742fddf11ee6bfb557b44f4f /src
parent03ce02e1a7c04426a2881962da661c46e389e8bf (diff)
fix: report the foreground group leader's cwd, not a descendant's (#3386)
refs #3270
Diffstat (limited to 'src')
-rw-r--r--src/pane.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pane.rs b/src/pane.rs
index bd3f7ffd..7340629c 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))]