diff --git a/src/cascadia/TerminalApp/App.cpp b/src/cascadia/TerminalApp/App.cpp index 9cb852ea594..e1f444c7dfa 100644 --- a/src/cascadia/TerminalApp/App.cpp +++ b/src/cascadia/TerminalApp/App.cpp @@ -630,7 +630,7 @@ namespace winrt::TerminalApp::implementation // reloading settings) const auto* const p = _settings->FindProfile(tabProfile); - // TODO: MSFT:21268795: Need a better story for what should happen when the last tab is closed. + // TODO: GitHub:627: Need a better story for what should happen when the last tab is closed. if (p != nullptr && p->GetCloseOnExit() && _tabs.size() > 1) { _RemoveTabViewItem(tabViewItem); @@ -662,6 +662,7 @@ namespace winrt::TerminalApp::implementation // - Close the currently focused tab. Focus will move to the left, if possible. void App::_CloseFocusedTab() { + // TODO: GitHub:627: Need a better story for what should happen when the last tab is closed. if (_tabs.size() > 1) { int focusedTabIndex = _GetFocusedTabIndex(); @@ -770,6 +771,7 @@ namespace winrt::TerminalApp::implementation // - eventArgs: the event's constituent arguments void App::_OnTabClosing(const IInspectable& sender, const MUX::Controls::TabViewTabClosingEventArgs& eventArgs) { + // TODO: GitHub:627: Need a better story for what should happen when the last tab is closed. // Don't allow the user to close the last tab .. // .. yet. if (_tabs.size() > 1) @@ -826,7 +828,11 @@ namespace winrt::TerminalApp::implementation { if (eventArgs.GetCurrentPoint(_root).Properties().IsMiddleButtonPressed()) { - _RemoveTabViewItem(sender); + // TODO: GitHub:627: Need a better story for what should happen when the last tab is closed. + if (_tabs.size() > 1) + { + _RemoveTabViewItem(sender); + } eventArgs.Handled(true); } }