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
No known key found for this signature in database
GPG key ID: 77021906D88E7150

View file

@ -203,7 +203,7 @@ namespace SourceGit.Native
public void OpenWithDefaultEditor(string file) public void OpenWithDefaultEditor(string file)
{ {
var info = new FileInfo(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; start.CreateNoWindow = true;
Process.Start(start); Process.Start(start);
} }