diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-02 02:20:40 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-02 02:20:40 +0300 |
| commit | 48d58648aefcc59964a99be9c23778fe69346663 (patch) | |
| tree | cd982894e474bfd8b8ce7fbcb81d6487d7a7a064 /src/app/creation.rs | |
| parent | a9111cbab2a7550c7e84ec94c8b388de9a44daa3 (diff) | |
fix: follow cached cwd for new tabs
refs #912
Diffstat (limited to 'src/app/creation.rs')
| -rw-r--r-- | src/app/creation.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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<PathBuf> { + 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<PathBuf> { + 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>) -> PathBuf { resolve_new_terminal_cwd(&self.state.new_terminal_cwd, follow_cwd) } |
