Allow opening the FS root dir as a remote project (#30190)

### Todo

* [x] Allow opening `ssh://username@host:/` from the CLI
* [x] Allow selecting `/` in the `open path` picker
* [x] Allow selecting the home directory in the `open path` picker

Release Notes:

- Changed the initial state of the SSH project picker to show the full
path to your home directory on the remote machine, instead of `~`.
- Added the ability to open `/` as a project folder over SSH

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
Max Brunsfeld 2025-05-07 16:50:57 -07:00 committed by GitHub
parent 6ac2f4e6a5
commit 37010aac6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 98 additions and 54 deletions

View file

@ -2855,13 +2855,7 @@ impl ProjectPanel {
}
let worktree_abs_path = worktree.read(cx).abs_path();
let (depth, path) = if Some(entry.entry) == worktree.read(cx).root_entry() {
let Some(path_name) = worktree_abs_path
.file_name()
.with_context(|| {
format!("Worktree abs path has no file name, root entry: {entry:?}")
})
.log_err()
else {
let Some(path_name) = worktree_abs_path.file_name() else {
continue;
};
let path = ArcCow::Borrowed(Path::new(path_name));