fix: missing -d ${WORKDIR} parameter for wt.exe (#490)

This commit is contained in:
leo 2024-09-20 14:15:19 +08:00
parent cb2caa0930
commit 5f567460e2
No known key found for this signature in database

View file

@ -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);
}