From 48d58648aefcc59964a99be9c23778fe69346663 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 2 Jul 2026 02:20:40 +0300 Subject: fix: follow cached cwd for new tabs refs #912 --- src/app/creation.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/app/creation.rs') diff --git a/src/app/creation.rs b/src/app/creation.rs index 7131520e..30883fb4 100644 --- a/src/app/creation.rs +++ b/src/app/creation.rs @@ -38,6 +38,23 @@ impl App { .resolved_identity_cwd_from(&self.state.terminals, &self.terminal_runtimes) } + pub(super) fn cwd_for_pane_in_workspace( + &self, + ws_idx: usize, + pane_id: crate::layout::PaneId, + ) -> Option { + let ws = self.state.workspaces.get(ws_idx)?; + let tab_idx = ws.find_tab_index_for_pane(pane_id)?; + ws.tabs + .get(tab_idx)? + .cwd_for_pane(pane_id, &self.state.terminals, &self.terminal_runtimes) + } + + pub(super) fn focused_pane_cwd_in_workspace(&self, ws_idx: usize) -> Option { + let pane_id = self.state.workspaces.get(ws_idx)?.focused_pane_id()?; + self.cwd_for_pane_in_workspace(ws_idx, pane_id) + } + pub(super) fn resolve_new_terminal_cwd(&self, follow_cwd: Option) -> PathBuf { resolve_new_terminal_cwd(&self.state.new_terminal_cwd, follow_cwd) } -- cgit v1.2.3