mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
enhance: allow to specify custom terminal
This commit is contained in:
parent
53c915578e
commit
736ad02991
2 changed files with 6 additions and 1 deletions
|
@ -54,6 +54,7 @@ namespace SourceGit.Models
|
||||||
new ShellOrTerminal("deepin-terminal", "Deepin Terminal", "deepin-terminal"),
|
new ShellOrTerminal("deepin-terminal", "Deepin Terminal", "deepin-terminal"),
|
||||||
new ShellOrTerminal("mate-terminal", "MATE Terminal", "mate-terminal"),
|
new ShellOrTerminal("mate-terminal", "MATE Terminal", "mate-terminal"),
|
||||||
new ShellOrTerminal("foot", "Foot", "foot"),
|
new ShellOrTerminal("foot", "Foot", "foot"),
|
||||||
|
new ShellOrTerminal("custom", "Custom", ""),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
|
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
|
@ -27,6 +26,11 @@ namespace SourceGit.Native
|
||||||
|
|
||||||
public string FindTerminal(Models.ShellOrTerminal shell)
|
public string FindTerminal(Models.ShellOrTerminal shell)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(shell.Exec))
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
var pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
|
var pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
|
||||||
var pathes = pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
|
var pathes = pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
|
||||||
foreach (var path in pathes)
|
foreach (var path in pathes)
|
||||||
|
|
Loading…
Reference in a new issue