diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index b88725393f..ee39fb1f6a 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -426,6 +426,11 @@ impl Item for Terminal { } } +///Gets the intuitively correct working directory from the given workspace +///If there is an active entry for this project, returns that entry's worktree root. +///If there's no active entry but there is a worktree, returns that worktrees root. +///If either of these roots are files, or if there are any other query failures, +/// returns the user's home directory fn get_wd_for_workspace(workspace: &Workspace, cx: &AppContext) -> Option { let project = workspace.project().read(cx); @@ -435,19 +440,11 @@ fn get_wd_for_workspace(workspace: &Workspace, cx: &AppContext) -> Option