aboutsummaryrefslogtreecommitdiff
path: root/src/app/creation.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-02 14:24:33 +0300
committerGitHub <noreply@github.com>2026-09-02 14:24:33 +0300
commit6c0bb273d5d5405a00985621b17e36f8b4d64609 (patch)
treeceef5ea8adf337bf3c1e977b133e76cb763c6f1b /src/app/creation.rs
parentcc88b3b8e5bb9f7d9f23ed6ae85a52fd7b5b9ed6 (diff)
feat: support independent multi-client tab views (#3526)
Diffstat (limited to 'src/app/creation.rs')
-rw-r--r--src/app/creation.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/app/creation.rs b/src/app/creation.rs
index fbe61902..af34e540 100644
--- a/src/app/creation.rs
+++ b/src/app/creation.rs
@@ -79,8 +79,23 @@ impl App {
}
pub(crate) fn resolved_new_workspace_cwd_from(&self, ws_idx: usize) -> PathBuf {
- let follow_cwd = self
- .focused_pane_cwd_in_workspace(ws_idx)
+ let tab_idx = self
+ .state
+ .workspaces
+ .get(ws_idx)
+ .map(crate::workspace::Workspace::active_tab_index);
+ self.resolved_new_workspace_cwd_from_tab(ws_idx, tab_idx)
+ }
+
+ pub(crate) fn resolved_new_workspace_cwd_from_tab(
+ &self,
+ ws_idx: usize,
+ tab_idx: Option<usize>,
+ ) -> PathBuf {
+ let follow_cwd = tab_idx
+ .and_then(|tab_idx| self.state.workspaces.get(ws_idx)?.tabs.get(tab_idx))
+ .map(|tab| tab.layout.focused())
+ .and_then(|pane_id| self.launch_cwd_for_pane_in_workspace(ws_idx, pane_id))
.or_else(|| self.seed_cwd_from_workspace(ws_idx));
self.resolve_new_terminal_cwd(follow_cwd)
}