mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
update comment regarding usage of Argument vs ArgumentList
This commit is contained in:
parent
b11e5740ef
commit
9b894b3b92
1 changed files with 15 additions and 4 deletions
|
|
@ -194,7 +194,8 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
|
||||
ProcessStartInfo info = new()
|
||||
{
|
||||
Verb = runAsAdministratorArg, WorkingDirectory = workingDirectory,
|
||||
Verb = runAsAdministratorArg,
|
||||
WorkingDirectory = workingDirectory,
|
||||
};
|
||||
switch (_settings.Shell)
|
||||
{
|
||||
|
|
@ -202,10 +203,20 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
info.FileName = "cmd.exe";
|
||||
info.Arguments = $"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command}";
|
||||
|
||||
// ArgumentList may break original shell command separation with quote.
|
||||
|
||||
//// Use info.Arguments instead of info.ArgumentList to enable user better control over the argument they are writing.
|
||||
//// Previous code using ArgumentList, commands needed to be seperated correctly:
|
||||
//// Incorrect:
|
||||
// info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
|
||||
// info.ArgumentList.Add(command);
|
||||
// info.ArgumentList.Add(command); //<== info.ArgumentList.Add("mkdir \"c:\\test new\"");
|
||||
|
||||
//// Correct version should be:
|
||||
//info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
|
||||
//info.ArgumentList.Add("mkdir");
|
||||
//info.ArgumentList.Add(@"c:\test new");
|
||||
|
||||
//https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist?view=net-6.0#remarks
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue