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

Code before:
        }

        std::vector<hstring> suggestions;
        suggestions.reserve(1);
        suggestions.emplace_back(fmt::format(FMT_COMPILE(L"winget install {}"), args.MissingCommand()));

        co_await wil::resume_foreground(Dispatcher());

        auto term = _GetActiveControl();
        if (!term)
        {
            co_return;
        }
        term.UpdateWinGetSuggestions(single_threaded_vector<hstring>(std::move(suggestions)));
        term.RefreshQuickFixMenu();
    }

    winrt::fire_and_forget TerminalPage::_WindowSizeChanged(const IInspectable /*sender*/, const Microsoft::Terminal::Control::WindowSizeChangedEventArgs args)
    {
        co_await wil::resume_foreground(Dispatcher());

        // Raise if:
        // - Not in fullscreen
        // - Only one tab exists
        // - Only one pane exists
        if (!_isFullscreen && NumberOfTabs() == 1 && _GetFocusedTabImpl()->GetLeafPaneCount() == 1)
        {
            WindowSizeChanged.raise(*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;
            }
        }


Review comment (bug):
🛑: If we reject this resize, we need to make sure to let conpty know. We need to do something to signal a UserResize() back to the conpty. Otherwise, conpty will go on it's merry way at the new size, with the terminal at the wrong size

Code after:
        catalogRef.PackageCatalogBackgroundUpdateInterval(std::chrono::hours(24));

        ConnectResult connectResult{ nullptr };
        for (int retries = 0;;)
        {
            connectResult = catalogRef.Connect();
            if (connectResult.Status() == ConnectResultStatus::Ok)
            {
                break;
            }

            if (++retries == 3)
            {
                co_return nullptr;
            }
        }

        PackageCatalog catalog = connectResult.PackageCatalog();
        // clang-format off
        static constexpr std::array<WinGetSearchParams, 3> searches{ {
            { .Field = PackageMatchField::Command, .MatchOption = PackageFieldMatchOption::StartsWithCaseInsensitive },
            { .Field = PackageMatchField::Name, .MatchOption = PackageFieldMatchOption::ContainsCaseInsensitive },
            { .Field = PackageMatchField::Moniker, .MatchOption = PackageFieldMatchOption::ContainsCaseInsensitive } } };
        // clang-format on

        PackageMatchFilter filter = WindowsPackageManagerFactory::CreatePackageMatchFilter();
        filter.Value(query);

        FindPackagesOptions options = WindowsPackageManagerFactory::CreateFindPackagesOptions();
        options.Filters().Append(filter);
        options.ResultLimit(20);

        IVectorView<MatchResult> pkgList;
        for (const auto& search : searches)
        {
            filter.Field(search.Field);
            filter.Option(search.MatchOption);

            const auto result = co_await catalog.FindPackagesAsync(options);
            pkgList = result.Matches();
            if (pkgList.Size() > 0)
            {
                break;
            }
        }
        co_return pkgList;
    }

    Windows::Foundation::IAsyncAction TerminalPage::_SearchMissingCommandHandler(const IInspectable /*sender*/, const Microsoft::Terminal::Control::SearchMissingCommandEventArgs args)
    {
        if (!Feature_QuickFix::IsEnabled())