fix: handle file paths with spaces

This commit is contained in:
Chiahong Hong
2024-08-22 02:09:34 +08:00
parent fd7bc8b122
commit 9a1e95b7e5

View File

@@ -203,7 +203,7 @@ namespace SourceGit.Native
public void OpenWithDefaultEditor(string file)
{
var info = new FileInfo(file);
var start = new ProcessStartInfo("cmd", $"/c start {info.FullName}");
var start = new ProcessStartInfo("cmd", $"/c start \"\" \"{info.FullName}\"");
start.CreateNoWindow = true;
Process.Start(start);
}