We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f5dcca commit 7d314fcCopy full SHA for 7d314fc
1 file changed
src/main.rs
@@ -866,9 +866,20 @@ impl Executor {
866
867
// ファイルを開く
868
"open" => {
869
- let _result = std::process::Command::new("cmd")
870
- .args(&["/C", "start", "", self.pop_stack().get_string().as_str()])
871
- .spawn();
+ if cfg!(target_os = "windows") {
+ let _result = std::process::Command::new("cmd")
+ .args(&["/C", "start", "", self.pop_stack().get_string().as_str()])
872
+ .spawn();
873
+ } else if cfg!(target_os = "linux") {
874
+ let _result =
875
+ std::process::Command::new("xdg-open") // Linuxの場合
876
+ .arg(self.pop_stack().get_string().as_str())
877
878
+ } else if cfg!(target_os = "macos") {
879
+ let _result = std::process::Command::new("open")
880
881
882
+ }
883
}
884
885
// シェルコマンドを実行
0 commit comments