diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 6887e6c9..b62e3720 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -41,6 +41,22 @@ namespace SourceGit.ViewModels if (!_instance.IsGitConfigured()) _instance.GitInstallPath = Native.OS.FindGitExecutable(); + if (!_instance.IsTerminalConfigured()) + { + for (var i = 0; i < Models.ShellOrTerminal.Supported.Count; i++) + { + _instance.ShellOrTerminal = i; + if (string.IsNullOrEmpty(_instance.ShellOrTerminalPath)) + { + _instance.ShellOrTerminal = -1; + } + else + { + break; + } + } + } + if (_instance.Workspaces.Count == 0) _instance.Workspaces.Add(new Workspace() { Name = "Default", Color = 4278221015 }); @@ -380,6 +396,11 @@ namespace SourceGit.ViewModels return !string.IsNullOrEmpty(path) && File.Exists(path); } + public bool IsTerminalConfigured() + { + return ShellOrTerminal != -1; + } + public bool ShouldCheck4UpdateOnStartup() { if (!_check4UpdatesOnStartup)