Fix reveal_path blocks on linux (#11702)

If you go to the file tree and press "x" (which is
"project_panel::RevealInFinder"). It will open the default file
manager(in my case nautilus). But on Linux it makes Zed unresponsive.
This fixes that.

Release Notes:

- Fixed Zed blocked after opening file manager in the file tree on
Linux.
This commit is contained in:
Flafy 2024-05-14 21:18:45 +03:00 committed by GitHub
parent bfc066a1ec
commit c8ddde27e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -305,12 +305,12 @@ impl<P: LinuxClient + 'static> Platform for P {
fn reveal_path(&self, path: &Path) {
if path.is_dir() {
open::that(path);
open::that_detached(path);
return;
}
// If `path` is a file, the system may try to open it in a text editor
let dir = path.parent().unwrap_or(Path::new(""));
open::that(dir);
open::that_detached(dir);
}
fn on_quit(&self, callback: Box<dyn FnMut()>) {