feature: supports mate-terminal on Linux

This commit is contained in:
leo 2024-06-29 11:53:12 +08:00
parent 1972e26da1
commit bfea573d4b
No known key found for this signature in database

View file

@ -93,11 +93,9 @@ namespace SourceGit.Native
{ {
var dir = Path.GetDirectoryName(path); var dir = Path.GetDirectoryName(path);
if (Directory.Exists(dir)) if (Directory.Exists(dir))
{
Process.Start(_xdgOpenPath, $"\"{dir}\""); Process.Start(_xdgOpenPath, $"\"{dir}\"");
} }
} }
}
public void OpenTerminal(string workdir) public void OpenTerminal(string workdir)
{ {
@ -133,10 +131,8 @@ namespace SourceGit.Native
{ {
var test = Path.Combine(path, filename); var test = Path.Combine(path, filename);
if (File.Exists(test)) if (File.Exists(test))
{
return test; return test;
} }
}
return string.Empty; return string.Empty;
} }
@ -149,33 +145,27 @@ namespace SourceGit.Native
{ {
var test = Path.Combine(path, "gnome-terminal"); var test = Path.Combine(path, "gnome-terminal");
if (File.Exists(test)) if (File.Exists(test))
{
return new Terminal(test, "--working-directory=\"{0}\""); return new Terminal(test, "--working-directory=\"{0}\"");
}
test = Path.Combine(path, "konsole"); test = Path.Combine(path, "konsole");
if (File.Exists(test)) if (File.Exists(test))
{
return new Terminal(test, "--workdir \"{0}\""); return new Terminal(test, "--workdir \"{0}\"");
}
test = Path.Combine(path, "xfce4-terminal"); test = Path.Combine(path, "xfce4-terminal");
if (File.Exists(test)) if (File.Exists(test))
{
return new Terminal(test, "--working-directory=\"{0}\""); return new Terminal(test, "--working-directory=\"{0}\"");
}
test = Path.Combine(path, "lxterminal"); test = Path.Combine(path, "lxterminal");
if (File.Exists(test)) if (File.Exists(test))
{
return new Terminal(test, "--working-directory=\"{0}\""); return new Terminal(test, "--working-directory=\"{0}\"");
}
test = Path.Combine(path, "deepin-terminal"); test = Path.Combine(path, "deepin-terminal");
if (File.Exists(test)) if (File.Exists(test))
{
return new Terminal(test, "--work-directory \"{0}\""); return new Terminal(test, "--work-directory \"{0}\"");
}
test = Path.Combine(path, "mate-terminal");
if (File.Exists(test))
return new Terminal(test, "--working-directory=\"{0}\"");
} }
return null; return null;