Skip to content

Commit

Permalink
Make duplicate tabs consider the existing configuration option for it…
Browse files Browse the repository at this point in the history
…s insertion (microsoft#15972)

Previously, the duplication method considered only the next to the selected tab(`tab.TabViewIndex() + 1`) as the insert position. Changed that to consider the setting.

Closes microsoft#15776
  • Loading branch information
codecruisedor authored Sep 18, 2023
1 parent 8daf89e commit 5f9624f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ namespace winrt::TerminalApp::implementation
// In the future, it may be preferable to just duplicate the
// current control's live settings (which will include changes
// made through VT).
_CreateNewTabFromPane(_MakePane(nullptr, tab, nullptr), tab.TabViewIndex() + 1);
uint32_t insertPosition = _tabs.Size();
if (_settings.GlobalSettings().NewTabPosition() == NewTabPosition::AfterCurrentTab)
{
insertPosition = tab.TabViewIndex() + 1;
}
_CreateNewTabFromPane(_MakePane(nullptr, tab, nullptr), insertPosition);

const auto runtimeTabText{ tab.GetTabText() };
if (!runtimeTabText.empty())
Expand Down

0 comments on commit 5f9624f

Please sign in to comment.