mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Fix persistence of empty windows (#18622)
This is a theoretical fix for #18584 as I cannot reproduce the issue anymore. It did happen briefly on one of my devices though, and at the time I observed that it would persist a window with no startup actions. (cherry picked from commit 265d8415094f41e161c2287aa80876b82d809c0c) Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpj1U Service-Version: 1.23
This commit is contained in:
parent
2590ff1383
commit
a72531014c
@ -1988,6 +1988,12 @@ namespace winrt::TerminalApp::implementation
|
||||
actions.insert(actions.end(), std::make_move_iterator(tabActions.begin()), std::make_move_iterator(tabActions.end()));
|
||||
}
|
||||
|
||||
// Avoid persisting a window with zero tabs, because `BuildStartupActions` happened to return an empty vector.
|
||||
if (actions.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// if the focused tab was not the last tab, restore that
|
||||
auto idx = _GetFocusedTabIndex();
|
||||
if (idx && idx != tabCount - 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user