fix: crash when trying to open terminal from the Welcome screen

This commit is contained in:
Aikawa Yataro 2024-09-16 08:51:39 +00:00
parent 67b3952080
commit 4deac98c4e
No known key found for this signature in database
GPG key ID: 1C5D95FB10179404

View file

@ -78,7 +78,8 @@ namespace SourceGit.Native
}
var startInfo = new ProcessStartInfo();
startInfo.WorkingDirectory = string.IsNullOrEmpty(workdir) ? "~" : workdir;
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
startInfo.WorkingDirectory = string.IsNullOrEmpty(workdir) ? home : workdir;
startInfo.FileName = OS.ShellOrTerminal;
Process.Start(startInfo);
}