diff options
Diffstat (limited to 'src/app/api')
| -rw-r--r-- | src/app/api/layouts.rs | 15 | ||||
| -rw-r--r-- | src/app/api/panes.rs | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/app/api/layouts.rs b/src/app/api/layouts.rs index 0fdbaba0..34795474 100644 --- a/src/app/api/layouts.rs +++ b/src/app/api/layouts.rs @@ -339,10 +339,15 @@ impl App { return PathBuf::from(cwd); } let follow_cwd = replace_target.and_then(|(_, tab_idx)| { - let ws = self.state.workspaces.get(ws_idx)?; - let tab = ws.tabs.get(tab_idx)?; - let pane_id = tab.layout.focused(); - tab.follow_cwd_for_pane(pane_id, &self.state.terminals, &self.terminal_runtimes) + let pane_id = self + .state + .workspaces + .get(ws_idx)? + .tabs + .get(tab_idx)? + .layout + .focused(); + self.launch_cwd_for_pane_in_workspace(ws_idx, pane_id) }); self.resolve_new_terminal_cwd( follow_cwd.or_else(|| self.focused_pane_cwd_in_workspace(ws_idx)), @@ -396,7 +401,7 @@ impl App { .cwd .as_ref() .map(PathBuf::from) - .or_else(|| self.follow_cwd_for_pane_in_workspace(ws_idx, target_pane_id)); + .or_else(|| self.launch_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 { diff --git a/src/app/api/panes.rs b/src/app/api/panes.rs index 483d73a5..9947a3b8 100644 --- a/src/app/api/panes.rs +++ b/src/app/api/panes.rs @@ -51,7 +51,7 @@ impl App { }; let (rows, cols) = self.state.estimate_pane_size(); let split_cwd = params.cwd.map(std::path::PathBuf::from).or_else(|| { - let follow_cwd = self.follow_cwd_for_pane_in_workspace(ws_idx, target_pane_id); + let follow_cwd = self.launch_cwd_for_pane_in_workspace(ws_idx, target_pane_id); Some(self.resolve_new_terminal_cwd(follow_cwd)) }); let default_shell = self.state.default_shell.clone(); |
