Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus-tab --previous/next to ignore tab switcher order #10947

Merged
merged 3 commits into from
Aug 19, 2021
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
5 changes: 5 additions & 0 deletions src/cascadia/TerminalApp/AppCommandlineArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
DHowett marked this conversation as resolved.
Show resolved Hide resolved
static_cast<IActionArgs>(NextTabArgs(TabSwitcherMode::Disabled)) :
static_cast<IActionArgs>(PrevTabArgs(TabSwitcherMode::Disabled)));
_startupActions.push_back(std::move(focusTabAction));
}
});
Expand Down
6 changes: 6 additions & 0 deletions src/cascadia/TerminalSettingsModel/ActionArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" };

Expand Down Expand Up @@ -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" };

Expand Down Expand Up @@ -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);
}
4 changes: 4 additions & 0 deletions src/cascadia/TerminalSettingsModel/ActionArgs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,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;
};

Expand Down