From bede3663ec431deee8c8c40713eafe8aa8bd683d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 10 Sep 2024 09:22:35 +0800 Subject: [PATCH] code_review: PR #453 * remove Visual Studio ENC0004 warning --- src/Native/MacOS.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 8c1c24c1..f68d7ac5 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -53,7 +53,11 @@ namespace SourceGit.Native { var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); var dir = string.IsNullOrEmpty(workdir) ? home : workdir; - var terminal = DetectTerminal(); + + var terminal = "Terminal"; + if (Directory.Exists("/Applications/iTerm.app")) + terminal = "iTerm"; + Process.Start("open", $"-a {terminal} \"{dir}\""); } @@ -61,13 +65,5 @@ namespace SourceGit.Native { Process.Start("open", $"\"{file}\""); } - - private static string DetectTerminal() - { - if (Directory.Exists("/Applications/iTerm.app")) - return "iTerm"; - - return "Terminal"; - } } }