From 393d106c151f8d243c5e3e1afa6a08440481c8d0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 13 Jun 2025 13:07:55 +0800 Subject: [PATCH] Fix command line pass issue --- Flow.Launcher.Infrastructure/Win32Helper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 7c72d0857..4fe995e8a 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -911,7 +911,9 @@ retry: // 7. Start the new process with that primary token fixed (char* appPtr = app) - fixed (char* cmdLinePtr = cmdLine) + // Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line + // So we add one more dash before the command line to make command line work correctly + fixed (char* cmdLinePtr = $"- {cmdLine}") fixed (char* currentDirPtr = currentDir) { if (!PInvoke.CreateProcessWithToken(hPrimaryToken,