From 5f567460e25ac678ba5316317a2364bf1f602c83 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 20 Sep 2024 14:15:19 +0800 Subject: [PATCH] fix: missing `-d ${WORKDIR}` parameter for `wt.exe` (#490) --- src/Native/Windows.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 8bb4a0f0..0f2e458d 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -155,6 +155,11 @@ namespace SourceGit.Native var startInfo = new ProcessStartInfo(); startInfo.WorkingDirectory = workdir; startInfo.FileName = OS.ShellOrTerminal; + + // Directly launching `Windows Terminal` need to specify the `-d` parameter + if (OS.ShellOrTerminal.EndsWith("wt.exe", StringComparison.OrdinalIgnoreCase)) + startInfo.Arguments = $"-d \"{workdir}\""; + Process.Start(startInfo); }