diff options
| author | Pitchfork-and-Torch <Pitchfork-and-Torch@users.noreply.github.com> | 2026-07-09 21:11:52 -0400 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-10 15:06:54 +0300 |
| commit | 4f7fcc48d1f760ab6057d0964f009c05b753456a (patch) | |
| tree | ee617c2d12d4c33c2c63a6a8048ab9e80a11d225 /src/app/api/layouts.rs | |
| parent | c8850a2e3e284033142db0f8117fa5998c68bd59 (diff) | |
fix: follow foreground cwd for new terminals
refs #1245
Diffstat (limited to 'src/app/api/layouts.rs')
| -rw-r--r-- | src/app/api/layouts.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/app/api/layouts.rs b/src/app/api/layouts.rs index 851221b4..0fdbaba0 100644 --- a/src/app/api/layouts.rs +++ b/src/app/api/layouts.rs @@ -341,11 +341,8 @@ impl App { let follow_cwd = replace_target.and_then(|(_, tab_idx)| { let ws = self.state.workspaces.get(ws_idx)?; let tab = ws.tabs.get(tab_idx)?; - tab.cwd_for_pane( - tab.layout.focused(), - &self.state.terminals, - &self.terminal_runtimes, - ) + let pane_id = tab.layout.focused(); + tab.follow_cwd_for_pane(pane_id, &self.state.terminals, &self.terminal_runtimes) }); self.resolve_new_terminal_cwd( follow_cwd.or_else(|| self.focused_pane_cwd_in_workspace(ws_idx)), @@ -399,7 +396,7 @@ impl App { .cwd .as_ref() .map(PathBuf::from) - .or_else(|| self.cwd_for_pane_in_workspace(ws_idx, target_pane_id)); + .or_else(|| self.follow_cwd_for_pane_in_workspace(ws_idx, target_pane_id)); let extra_env = super::env::normalize_launch_env(pane.env.clone()) .map_err(|(_, message)| message.to_string())?; let direction = match direction { |
