File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -933,6 +933,13 @@ namespace winrt::TerminalApp::implementation
933933 return res;
934934 }
935935
936+ void Tab::Close ()
937+ {
938+ ASSERT_UI_THREAD ();
939+
940+ Closed.raise (nullptr , nullptr );
941+ }
942+
936943 // Method Description:
937944 // - Prepares this tab for being removed from the UI hierarchy by shutting down all active connections.
938945 void Tab::Shutdown ()
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ namespace winrt::TerminalApp::implementation
6161 void UpdateSettings (const winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
6262 void UpdateTitle ();
6363
64+ void Close ();
6465 void Shutdown ();
6566 void ClosePane ();
6667
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ namespace TerminalApp
2222 UInt32 TabViewNumTabs;
2323
2424 void Focus(Windows.UI.Xaml.FocusState focusState);
25+ void Close();
2526 void Shutdown();
2627
2728 void SetDispatch(ShortcutActionDispatch dispatch);
Original file line number Diff line number Diff line change @@ -411,13 +411,11 @@ namespace winrt::TerminalApp::implementation
411411 auto actions = t->BuildStartupActions (BuildStartupKind::None);
412412 _AddPreviouslyClosedPaneOrTab (std::move (actions));
413413
414- _RemoveTab ( tab);
414+ tab. Close ( );
415415 }
416416
417- // Method Description:
418- // - Removes the tab (both TerminalControl and XAML)
419- // Arguments:
420- // - tab: the tab to remove
417+ // Removes the tab (both TerminalControl and XAML).
418+ // NOTE: Don't call this directly, but rather `tab.Close()`.
421419 void TerminalPage::_RemoveTab (const winrt::TerminalApp::Tab& tab)
422420 {
423421 uint32_t tabIndex{};
You can’t perform that action at this time.
0 commit comments