Fix tab movement while running multiple actions (#11144)
## Summary of the Pull Request Make sure to always synchronously set the selected tab. This way when changing tabs while running multiple actions further calls to _GetFocusedTab will return the correct one. **Edit** #11146 discovered while trying to test this so while I fixed the case I wanted, things seem to be broken generally so it is hard for me to test if I broke anything else. ## References ## PR Checklist * [x] Closes #11107 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA ## Validation Steps Performed Ran the command specified in the issue and confirmed that the correct tab was focused and that the correct pane was zoomed.
This commit is contained in:
parent
43c76ee240
commit
0a48836e83
|
@ -599,9 +599,13 @@ namespace winrt::TerminalApp::implementation
|
|||
tabIndex = std::clamp(tabIndex, 0u, _tabs.Size() - 1);
|
||||
|
||||
auto tab{ _tabs.GetAt(tabIndex) };
|
||||
// GH#11107 - Always just set the item directly first so that if
|
||||
// tab movement is done as part of multiple actions following calls
|
||||
// to _GetFocusedTab will return the correct tab.
|
||||
_tabView.SelectedItem(tab.TabViewItem());
|
||||
|
||||
if (_startupState == StartupState::InStartup)
|
||||
{
|
||||
_tabView.SelectedItem(tab.TabViewItem());
|
||||
_UpdatedSelectedTab(tab);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue