Fix focus-tab --previous/next to ignore tab switcher order (#10947)
When creating `startupAction` use `TabSwitcherMode::Disabled` in action args to disable the tab switcher and prevent MRU logic to be applied. Closes #10070
This commit is contained in:
parent
638c6d0291
commit
46fd7caf5a
|
@ -380,6 +380,11 @@ void AppCommandlineArgs::_buildFocusTabParser()
|
|||
else if (_focusNextTab || _focusPrevTab)
|
||||
{
|
||||
focusTabAction.Action(_focusNextTab ? ShortcutAction::NextTab : ShortcutAction::PrevTab);
|
||||
// GH#10070 - make sure to not use the MRU order when switching
|
||||
// tabs on the commandline. That wouldn't make any sense!
|
||||
focusTabAction.Args(_focusNextTab ?
|
||||
static_cast<IActionArgs>(NextTabArgs(TabSwitcherMode::Disabled)) :
|
||||
static_cast<IActionArgs>(PrevTabArgs(TabSwitcherMode::Disabled)));
|
||||
_startupActions.push_back(std::move(focusTabAction));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1475,6 +1475,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
struct PrevTabArgs : public PrevTabArgsT<PrevTabArgs>
|
||||
{
|
||||
PrevTabArgs() = default;
|
||||
PrevTabArgs(TabSwitcherMode switcherMode) :
|
||||
_SwitcherMode(switcherMode) {}
|
||||
ACTION_ARG(Windows::Foundation::IReference<TabSwitcherMode>, SwitcherMode, nullptr);
|
||||
static constexpr std::string_view SwitcherModeKey{ "tabSwitcherMode" };
|
||||
|
||||
|
@ -1523,6 +1525,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
struct NextTabArgs : public NextTabArgsT<NextTabArgs>
|
||||
{
|
||||
NextTabArgs() = default;
|
||||
NextTabArgs(TabSwitcherMode switcherMode) :
|
||||
_SwitcherMode(switcherMode) {}
|
||||
ACTION_ARG(Windows::Foundation::IReference<TabSwitcherMode>, SwitcherMode, nullptr);
|
||||
static constexpr std::string_view SwitcherModeKey{ "tabSwitcherMode" };
|
||||
|
||||
|
@ -1772,4 +1776,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::factory_implementation
|
|||
BASIC_FACTORY(FindMatchArgs);
|
||||
BASIC_FACTORY(NewWindowArgs);
|
||||
BASIC_FACTORY(FocusPaneArgs);
|
||||
BASIC_FACTORY(PrevTabArgs);
|
||||
BASIC_FACTORY(NextTabArgs);
|
||||
}
|
||||
|
|
|
@ -276,11 +276,15 @@ namespace Microsoft.Terminal.Settings.Model
|
|||
|
||||
[default_interface] runtimeclass PrevTabArgs : IActionArgs
|
||||
{
|
||||
PrevTabArgs();
|
||||
PrevTabArgs(TabSwitcherMode SwitcherMode);
|
||||
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass NextTabArgs : IActionArgs
|
||||
{
|
||||
NextTabArgs();
|
||||
NextTabArgs(TabSwitcherMode SwitcherMode);
|
||||
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue