From 2b20b3f4d74ccdd296c7d81410138d4418d713ee Mon Sep 17 00:00:00 2001 From: mccloud1984 Date: Thu, 8 Jan 2026 18:58:05 -0500 Subject: [PATCH] Fix path quoting for directories with spaces - Add quotes around defaultApp and path arguments in Utils.cs - Fixes issue where Unity project paths containing spaces (like 'Cloud Repositories') would be split incorrectly when passed to external editor - Affects Linux and macOS terminal launching code paths --- Editor/Utils.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Editor/Utils.cs b/Editor/Utils.cs index 90d26e7..ec0dcc6 100644 --- a/Editor/Utils.cs +++ b/Editor/Utils.cs @@ -158,11 +158,11 @@ public static ProcessStartInfo BuildProcessStartInfo(string defaultApp, string p if (cmdFormat == "") { - args = $"{defaultApp} {path} {line}"; + args = $"\"{defaultApp}\" \"{path}\" {line}"; } else { - args = string.Format(cmdFormat, $"{defaultApp} {path} {line}"); + args = string.Format(cmdFormat, $"\"{defaultApp}\" \"{path}\" {line}"); } } @@ -173,7 +173,7 @@ public static ProcessStartInfo BuildProcessStartInfo(string defaultApp, string p if (IsTerminalAvailable(t.Key)) { fileName = t.Key; - args = $"{defaultApp} {path} {line}"; + args = $"\"{defaultApp}\" \"{path}\" {line}"; break; } } @@ -183,11 +183,11 @@ public static ProcessStartInfo BuildProcessStartInfo(string defaultApp, string p if (cmdFormat == "") { fileName = preferredTerminal; - args = $"-e {defaultApp} {path} {line}"; + args = $"-e \"{defaultApp}\" \"{path}\" {line}"; } else { - args = string.Format(cmdFormat, $"{defaultApp} {path} {line}"); + args = string.Format(cmdFormat, $"\"{defaultApp}\" \"{path}\" {line}"); } } @@ -197,7 +197,7 @@ public static ProcessStartInfo BuildProcessStartInfo(string defaultApp, string p { if (IsTerminalAvailable(t.Key)) { - args = string.Format(t.Value, $"{defaultApp} {path} {line}"); + args = string.Format(t.Value, $"\"{defaultApp}\" \"{path}\" {line}"); } } }