-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpui: Add platform-specific keystroke display #25651
base: main
Are you sure you want to change the base?
Conversation
fn open_with_system(&self, path: &Path) { | ||
let executor = self.background_executor().clone(); | ||
let path = path.to_owned(); | ||
executor | ||
.spawn(async move { | ||
let _ = std::process::Command::new("xdg-open") | ||
.arg(path) | ||
.spawn() | ||
.expect("Failed to open file with xdg-open"); | ||
}) | ||
.detach(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't hard-code shelling out to a program that isn't even listed as a dependency of the crate. The right way to do this is to use a library that understands mime associations (e.g. https://docs.rs/xdg-utils/latest/xdg_utils/). In the worst case the command should be configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, i used this because it's standard command similar to open
on macos (although might have to be explicitly installed on linux).
perhaps this is only a linux specific dependency which i can add.
should i create a separate pr for this?
Closes #21938
I think I accidentally closed #23979 while pulling the latest so I had to create a new branch for it.
Release Notes: