From b3ac7a2b94f3d742665f9a97071105613a417291 Mon Sep 17 00:00:00 2001 From: LotP Date: Fri, 24 Apr 2026 23:08:29 +0000 Subject: [PATCH] fix arg parsing (!34) fixes parsing of args with spaces Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/34 --- src/Ryujinx/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 4340beaee..ce2a0eb11 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -58,9 +58,14 @@ namespace Ryujinx.Ava // this fixes the "hide console" option by forcing the emulator to launch in an old-school cmd if (!Console.Title.Contains("conhost.exe")) { - string sargs = string.Join(" ", args); + StringBuilder sb = new(); + + foreach (string arg in args) + { + sb.Append(arg.Contains(' ') ? $" \"{arg}\"" : $" {arg}"); + } - Process.Start("conhost.exe", $"{Environment.ProcessPath} {sargs}"); + Process.Start("conhost.exe", $"{Environment.ProcessPath} {sb}"); return 0; } #endif