Skip to content

Commit b2e754d

Browse files
committed
Fix command issue for pswh.exe
1 parent 3680440 commit b2e754d

File tree

1 file changed

+4
-1
lines changed
  • Plugins/Flow.Launcher.Plugin.Shell

1 file changed

+4
-1
lines changed

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
242242

243243
case Shell.Pwsh:
244244
{
245+
// Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
246+
// \\ must be escaped for it to work properly, or breaking it into multiple arguments
247+
var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
245248
if (_settings.UseWindowsTerminal)
246249
{
247250
info.FileName = "wt.exe";
@@ -256,7 +259,7 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
256259
info.ArgumentList.Add("-NoExit");
257260
}
258261
info.ArgumentList.Add("-Command");
259-
info.ArgumentList.Add($"{command}\\; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
262+
info.ArgumentList.Add($"{command}{addedCharacter}; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
260263
break;
261264
}
262265

0 commit comments

Comments
 (0)