Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Shell/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,19 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
break;
}

case Shell.Pwsh:
{
info.FileName = "pwsh.exe";
if (_settings.LeaveShellOpen)
{
info.ArgumentList.Add("-NoExit");
}
info.ArgumentList.Add("-Command");
info.ArgumentList.Add(command);

break;
}

case Shell.RunCommand:
{
var parts = command.Split(new[]
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Shell/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public enum Shell
Cmd = 0,
Powershell = 1,
RunCommand = 2,

Pwsh = 3,
}
}
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
HorizontalAlignment="Left">
<ComboBoxItem>CMD</ComboBoxItem>
<ComboBoxItem>PowerShell</ComboBoxItem>
<ComboBoxItem>Pwsh</ComboBoxItem>
<ComboBoxItem>RunCommand</ComboBoxItem>
</ComboBox>
<StackPanel Grid.Row="4" Orientation="Horizontal">
Expand Down
17 changes: 15 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,23 @@ private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
_settings.ReplaceWinR = false;
};

ShellComboBox.SelectedIndex = (int) _settings.Shell;
ShellComboBox.SelectedIndex = _settings.Shell switch
{
Shell.Cmd => 0,
Shell.Powershell => 1,
Shell.Pwsh => 2,
_ => ShellComboBox.Items.Count - 1
};

ShellComboBox.SelectionChanged += (o, e) =>
{
_settings.Shell = (Shell) ShellComboBox.SelectedIndex;
_settings.Shell = ShellComboBox.SelectedIndex switch
{
0 => Shell.Cmd,
1 => Shell.Powershell,
2 => Shell.Pwsh,
_ => Shell.RunCommand
};
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
};

Expand Down