@@ -200,6 +200,7 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
200
200
WorkingDirectory = workingDirectory ,
201
201
} ;
202
202
var notifyStr = Context . API . GetTranslation ( "flowlauncher_plugin_cmd_press_any_key_to_close" ) ;
203
+ var addedCharacter = _settings . UseWindowsTerminal ? "\\ " : "" ;
203
204
switch ( _settings . Shell )
204
205
{
205
206
case Shell . Cmd :
@@ -213,9 +214,16 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
213
214
{
214
215
info . FileName = "cmd.exe" ;
215
216
}
216
-
217
+ if ( _settings . LeaveShellOpen )
218
+ {
219
+ info . ArgumentList . Add ( "/k" ) ;
220
+ }
221
+ else
222
+ {
223
+ info . ArgumentList . Add ( "/c" ) ;
224
+ }
217
225
info . ArgumentList . Add (
218
- $ "{ ( _settings . LeaveShellOpen ? "/k" : "/c" ) } { command } " +
226
+ $ "{ command } " +
219
227
$ "{ ( _settings . CloseShellAfterPress ?
220
228
$ " && echo { notifyStr } && pause > nul /c" :
221
229
"" ) } " ) ;
@@ -226,7 +234,6 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
226
234
{
227
235
// Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
228
236
// \\ must be escaped for it to work properly, or breaking it into multiple arguments
229
- var addedCharacter = _settings . UseWindowsTerminal ? "\\ " : "" ;
230
237
if ( _settings . UseWindowsTerminal )
231
238
{
232
239
info . FileName = "wt.exe" ;
@@ -257,7 +264,6 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
257
264
{
258
265
// Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
259
266
// \\ must be escaped for it to work properly, or breaking it into multiple arguments
260
- var addedCharacter = _settings . UseWindowsTerminal ? "\\ " : "" ;
261
267
if ( _settings . UseWindowsTerminal )
262
268
{
263
269
info . FileName = "wt.exe" ;
0 commit comments