From 736ad02991700411a7268b74093f95599dace90b Mon Sep 17 00:00:00 2001 From: Aikawa Yataro Date: Mon, 16 Sep 2024 12:03:56 +0000 Subject: [PATCH] enhance: allow to specify custom terminal --- src/Models/ShellOrTerminal.cs | 1 + src/Native/Linux.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Models/ShellOrTerminal.cs b/src/Models/ShellOrTerminal.cs index fa3a207b..02b294a0 100644 --- a/src/Models/ShellOrTerminal.cs +++ b/src/Models/ShellOrTerminal.cs @@ -54,6 +54,7 @@ namespace SourceGit.Models new ShellOrTerminal("deepin-terminal", "Deepin Terminal", "deepin-terminal"), new ShellOrTerminal("mate-terminal", "MATE Terminal", "mate-terminal"), new ShellOrTerminal("foot", "Foot", "foot"), + new ShellOrTerminal("custom", "Custom", ""), }; } } diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 191f4ddd..16fd1b78 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq.Expressions; using System.Runtime.Versioning; using Avalonia; @@ -27,6 +26,11 @@ namespace SourceGit.Native public string FindTerminal(Models.ShellOrTerminal shell) { + if (string.IsNullOrEmpty(shell.Exec)) + { + return string.Empty; + } + var pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty; var pathes = pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); foreach (var path in pathes)