Repository: microsoft/terminal
File: src/cascadia/TerminalApp/TerminalPage.cpp (C++)

Code before:
        _isAlwaysOnTop = _settings.GlobalSettings().AlwaysOnTop();
        _AlwaysOnTopChangedHandlers(*this, nullptr);

        // Settings AllowDependentAnimations will affect whether animations are
        // enabled application-wide, so we don't need to check it each time we
        // want to create an animation.
        WUX::Media::Animation::Timeline::AllowDependentAnimations(!_settings.GlobalSettings().DisableAnimations());

        _tabRow.ShowElevationShield(IsElevated() && _settings.GlobalSettings().ShowAdminShield());

        Media::SolidColorBrush transparent{ Windows::UI::Colors::Transparent() };
        _tabView.Background(transparent);

        ////////////////////////////////////////////////////////////////////////
        // Begin Theme handling
        _updateThemeColors();

        // Update the state of the CloseButtonOverlayMode property of
        // our TabView, to match the tab.showCloseButton property in the theme.
        //
        // Also update every tab's individual IsClosable to match.
        //
        // This is basically the same as _updateTabCloseButton, but with some
        // code moved around to better facilitate updating every tab view item
        // at once
        if (const auto theme = _settings.GlobalSettings().CurrentTheme())
        {
            const auto visibility = theme.Tab() ? theme.Tab().ShowCloseButton() : Settings::Model::TabCloseButtonVisibility::Always;

            for (const auto& tab : _tabs)
            {
                switch (visibility)
                {
                case Settings::Model::TabCloseButtonVisibility::Never:
                    tab.TabViewItem().IsClosable(false);
                    break;
                case Settings::Model::TabCloseButtonVisibility::Hover:
                    tab.TabViewItem().IsClosable(true);
                    break;
                default:
                    tab.TabViewItem().IsClosable(true);
                    break;
                }
            }

            switch (visibility)
            {
            case Settings::Model::TabCloseButtonVisibility::Never:
                _tabView.CloseButtonOverlayMode(MUX::Controls::TabViewCloseButtonOverlayMode::Auto);
                break;
            case Settings::Model::TabCloseButtonVisibility::Hover:

Review comment (suggestion):
Idle thought... should this not go via the same path as RawWriteString? PasteTextFromClipboard means "ask the app for the clipboard content," which could result in one ContentDialog per control (!) confirming the paste.

I'd expect this:

```mermaid
sequenceDiagram
    TerminalPage-->>TermControl: PasteTextFromClipboard
    TermControl-->>TerminalPage: GetTextFromClipboard
    TerminalPage-->>TermControl: Here's the text bud
    TermControl-->>Pane: SentString("here's the...")
    Pane-->>OtherTermControl: RawWriteString("here's the...")
    Pane-->>OtherTermControl: RawWriteString("here's the...")
    Pane-->>OtherTermControl: RawWriteString("here's the...")
```

Code after:
    }

    // Method Description:
    // - Send an event (which will be caught by AppHost) to change the show window state of the entire hosting window
    // Arguments:
    // - sender (not used)
    // - args: the arguments specifying how to set the display status to ShowWindow for our window handle
    void TerminalPage::_ShowWindowChangedHandler(const IInspectable& /*sender*/, const Microsoft::Terminal::Control::ShowWindowArgs args)
    {
        _ShowWindowChangedHandlers(*this, args);
    }

    // Method Description:
    // - Paste text from the Windows Clipboard to the focused terminal
    void TerminalPage::_PasteText()
    {
        // First, check if we're in broadcast input mode. If so, let's tell all
        // the controls to paste.
        if (const auto& tab{ _GetFocusedTabImpl() })
        {
            if (tab->TabStatus().IsInputBroadcastActive())
            {
                tab->GetRootPane()->WalkTree([](auto&& pane) {
                    if (auto control = pane->GetTerminalControl())
                    {
                        control.PasteTextFromClipboard();
                    }
                });
                return;
            }
        }

        // The focused tab wasn't in broadcast mode. No matter. Just ask the
        // current one to paste.
        if (const auto& control{ _GetActiveControl() })
        {
            control.PasteTextFromClipboard();
        }
    }

    // Function Description:
    // - Called when the settings button is clicked. ShellExecutes the settings
    //   file, as to open it in the default editor for .json files. Does this in
    //   a background thread, as to not hang/crash the UI thread.
    fire_and_forget TerminalPage::_LaunchSettings(const SettingsTarget target)
    {
        if (target == SettingsTarget::SettingsUI)
        {
            OpenSettingsUI();
        }
        else