diff --git a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs index 749e9ec80..f4e8229b7 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Windows; using System.Windows.Controls; @@ -68,10 +68,21 @@ namespace Flow.Launcher.Plugin.Shell _settings.ReplaceWinR = false; }; - ShellComboBox.SelectedIndex = (int) _settings.Shell; + ShellComboBox.SelectedIndex = _settings.Shell switch + { + Shell.Cmd => 0, + Shell.Powershell => 1, + _ => ShellComboBox.Items.Count - 1 + }; + ShellComboBox.SelectionChanged += (o, e) => { - _settings.Shell = (Shell) ShellComboBox.SelectedIndex; + _settings.Shell = ShellComboBox.SelectedIndex switch + { + 0 => Shell.Cmd, + 1 => Shell.Powershell, + _ => Shell.RunCommand + }; LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand; };