fix: gnome-terminal name

This commit is contained in:
leo 2024-03-06 20:41:02 +08:00
parent 3bf962d745
commit b48c2b5ab5

View file

@ -42,14 +42,14 @@ namespace SourceGit.Native {
public void OpenTerminal(string workdir) { public void OpenTerminal(string workdir) {
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir; var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
if (File.Exists("/usr/bin/gnome-ternimal")) { if (File.Exists("/usr/bin/gnome-terminal")) {
Process.Start("/usr/bin/gnome-ternimal", $"--working-directory=\"{dir}\""); Process.Start("/usr/bin/gnome-terminal", $"--working-directory=\"{dir}\"");
} else if (File.Exists("/usr/bin/konsole")) { } else if (File.Exists("/usr/bin/konsole")) {
Process.Start("/usr/bin/konsole", $"--workdir \"{dir}\""); Process.Start("/usr/bin/konsole", $"--workdir \"{dir}\"");
} else if (File.Exists("/usr/bin/xfce4-terminal")) { } else if (File.Exists("/usr/bin/xfce4-terminal")) {
Process.Start("/usr/bin/xfce4-terminal", $"--working-directory=\"{dir}\""); Process.Start("/usr/bin/xfce4-terminal", $"--working-directory=\"{dir}\"");
} else { } else {
App.RaiseException("", $"Only supports gnome-ternimal/konsole/xfce4-terminal!"); App.RaiseException("", $"Only supports gnome-terminal/konsole/xfce4-terminal!");
return; return;
} }
} }