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
194
194
195
195
ProcessStartInfo info = new ( )
196
196
{
197
- Verb = runAsAdministratorArg , WorkingDirectory = workingDirectory ,
197
+ Verb = runAsAdministratorArg ,
198
+ WorkingDirectory = workingDirectory ,
198
199
} ;
199
200
switch ( _settings . Shell )
200
201
{
201
202
case Shell . Cmd :
202
203
{
203
204
info . FileName = "cmd.exe" ;
204
205
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:
207
210
// 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
+
209
220
break ;
210
221
}
211
222
You can’t perform that action at this time.
0 commit comments