aboutsummaryrefslogtreecommitdiff
path: root/src/app/api/workspaces.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 00:32:46 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 00:32:46 +0300
commit3de6ea799965a7d2aad0f7db2f23f54cd24cb039 (patch)
treec9233a7f3d432aed7761c9db9c0072fee4ff5de2 /src/app/api/workspaces.rs
parent0fec1199671becba511e03d98a4921e375a46fe3 (diff)
feat: configure new terminal cwd
Diffstat (limited to 'src/app/api/workspaces.rs')
-rw-r--r--src/app/api/workspaces.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/app/api/workspaces.rs b/src/app/api/workspaces.rs
index f5e9a563..92b41486 100644
--- a/src/app/api/workspaces.rs
+++ b/src/app/api/workspaces.rs
@@ -45,11 +45,12 @@ impl App {
id: String,
params: WorkspaceCreateParams,
) -> String {
- let cwd = params
- .cwd
- .map(PathBuf::from)
- .or_else(|| std::env::current_dir().ok())
- .unwrap_or_else(|| PathBuf::from("/"));
+ let cwd = params.cwd.map(PathBuf::from).unwrap_or_else(|| {
+ let follow_cwd = self
+ .workspace_creation_source()
+ .and_then(|ws_idx| self.seed_cwd_from_workspace(ws_idx));
+ self.resolve_new_terminal_cwd(follow_cwd)
+ });
match self.create_workspace_with_options(cwd, params.focus) {
Ok(index) => {
if let Some(label) = params.label {