File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Plugins/Flow.Launcher.Plugin.Shell Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -194,18 +194,29 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
194194
195195 ProcessStartInfo info = new ( )
196196 {
197- Verb = runAsAdministratorArg , WorkingDirectory = workingDirectory ,
197+ Verb = runAsAdministratorArg ,
198+ WorkingDirectory = workingDirectory ,
198199 } ;
199200 switch ( _settings . Shell )
200201 {
201202 case Shell . Cmd :
202203 {
203204 info . FileName = "cmd.exe" ;
204205 info . Arguments = $ "{ ( _settings . LeaveShellOpen ? "/k" : "/c" ) } { command } ";
205-
206- // ArgumentList may break original shell command separation with quote.
206+
207+ //// Use info.Arguments instead of info.ArgumentList to enable user better control over the argument they are writing.
208+ //// Previous code using ArgumentList, commands needed to be seperated correctly:
209+ //// Incorrect:
207210 // info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
208- // info.ArgumentList.Add(command);
211+ // info.ArgumentList.Add(command); //<== info.ArgumentList.Add("mkdir \"c:\\test new\"");
212+
213+ //// Correct version should be:
214+ //info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
215+ //info.ArgumentList.Add("mkdir");
216+ //info.ArgumentList.Add(@"c:\test new");
217+
218+ //https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist?view=net-6.0#remarks
219+
209220 break ;
210221 }
211222
You can’t perform that action at this time.
0 commit comments