Merge remote-tracking branch 'origin/main' into feature/llm

This commit is contained in:
Console Service Bot 2025-08-20 01:31:21 +00:00
commit e66bcad499
11 changed files with 24 additions and 45 deletions

View File

@ -174,9 +174,7 @@
<DependentUpon>TerminalPaneContent.idl</DependentUpon> <DependentUpon>TerminalPaneContent.idl</DependentUpon>
</ClInclude> </ClInclude>
<ClInclude Include="Toast.h" /> <ClInclude Include="Toast.h" />
<ClInclude Include="TerminalSettingsCache.h"> <ClInclude Include="TerminalSettingsCache.h" />
<DependentUpon>TerminalSettingsCache.idl</DependentUpon>
</ClInclude>
<ClInclude Include="SuggestionsControl.h"> <ClInclude Include="SuggestionsControl.h">
<DependentUpon>SuggestionsControl.xaml</DependentUpon> <DependentUpon>SuggestionsControl.xaml</DependentUpon>
</ClInclude> </ClInclude>
@ -289,9 +287,7 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" /> <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="Toast.cpp" /> <ClCompile Include="Toast.cpp" />
<ClCompile Include="TerminalSettingsCache.cpp"> <ClCompile Include="TerminalSettingsCache.cpp" />
<DependentUpon>TerminalSettingsCache.idl</DependentUpon>
</ClCompile>
<ClCompile Include="SuggestionsControl.cpp"> <ClCompile Include="SuggestionsControl.cpp">
<DependentUpon>SuggestionsControl.xaml</DependentUpon> <DependentUpon>SuggestionsControl.xaml</DependentUpon>
</ClCompile> </ClCompile>
@ -366,7 +362,6 @@
<DependentUpon>TaskPaneContent.xaml</DependentUpon> <DependentUpon>TaskPaneContent.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Midl> </Midl>
<Midl Include="TerminalSettingsCache.idl" />
<Midl Include="MarkdownPaneContent.idl"> <Midl Include="MarkdownPaneContent.idl">
<DependentUpon>MarkdownPaneContent.xaml</DependentUpon> <DependentUpon>MarkdownPaneContent.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>

View File

@ -90,7 +90,6 @@
<Midl Include="TerminalWindow.idl" /> <Midl Include="TerminalWindow.idl" />
<Midl Include="TaskbarState.idl" /> <Midl Include="TaskbarState.idl" />
<Midl Include="IPaneContent.idl" /> <Midl Include="IPaneContent.idl" />
<Midl Include="TerminalSettingsCache.idl" />
<Midl Include="Monarch.idl" /> <Midl Include="Monarch.idl" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -20,6 +20,7 @@
#include "SettingsPaneContent.h" #include "SettingsPaneContent.h"
#include "SnippetsPaneContent.h" #include "SnippetsPaneContent.h"
#include "TabRowControl.h" #include "TabRowControl.h"
#include "TerminalSettingsCache.h"
#include "../../types/inc/ColorFix.hpp" #include "../../types/inc/ColorFix.hpp"
#include "../../types/inc/utils.hpp" #include "../../types/inc/utils.hpp"
@ -243,7 +244,7 @@ namespace winrt::TerminalApp::implementation
if (_settings == nullptr) if (_settings == nullptr)
{ {
// Create this only on the first time we load the settings. // Create this only on the first time we load the settings.
_terminalSettingsCache = TerminalApp::TerminalSettingsCache{ settings, *_bindings }; _terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings, *_bindings);
} }
_settings = settings; _settings = settings;
@ -3935,7 +3936,7 @@ namespace winrt::TerminalApp::implementation
// updating terminal panes, so that we don't have to build a _new_ // updating terminal panes, so that we don't have to build a _new_
// TerminalSettings for every profile we update - we can just look them // TerminalSettings for every profile we update - we can just look them
// up the previous ones we built. // up the previous ones we built.
_terminalSettingsCache.Reset(_settings, *_bindings); _terminalSettingsCache->Reset(_settings, *_bindings);
for (const auto& tab : _tabs) for (const auto& tab : _tabs)
{ {

View File

@ -31,6 +31,8 @@ namespace Microsoft::Terminal::Core
namespace winrt::TerminalApp::implementation namespace winrt::TerminalApp::implementation
{ {
struct TerminalSettingsCache;
inline constexpr uint32_t DefaultRowsToScroll{ 3 }; inline constexpr uint32_t DefaultRowsToScroll{ 3 };
inline constexpr std::wstring_view TabletInputServiceKey{ L"TabletInputService" }; inline constexpr std::wstring_view TabletInputServiceKey{ L"TabletInputService" };
@ -277,7 +279,7 @@ namespace winrt::TerminalApp::implementation
TerminalApp::ContentManager _manager{ nullptr }; TerminalApp::ContentManager _manager{ nullptr };
TerminalApp::TerminalSettingsCache _terminalSettingsCache{ nullptr }; std::shared_ptr<TerminalSettingsCache> _terminalSettingsCache{};
struct StashedDragData struct StashedDragData
{ {

View File

@ -6,6 +6,7 @@
#include <mmsystem.h> #include <mmsystem.h>
#include "TerminalSettingsCache.h"
#include "../../types/inc/utils.hpp" #include "../../types/inc/utils.hpp"
#include "BellEventArgs.g.cpp" #include "BellEventArgs.g.cpp"
@ -20,7 +21,7 @@ using namespace winrt::Microsoft::Terminal::TerminalConnection;
namespace winrt::TerminalApp::implementation namespace winrt::TerminalApp::implementation
{ {
TerminalPaneContent::TerminalPaneContent(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile, TerminalPaneContent::TerminalPaneContent(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile,
const TerminalApp::TerminalSettingsCache& cache, const std::shared_ptr<TerminalSettingsCache>& cache,
const winrt::Microsoft::Terminal::Control::TermControl& control) : const winrt::Microsoft::Terminal::Control::TermControl& control) :
_control{ control }, _control{ control },
_cache{ cache }, _cache{ cache },
@ -346,7 +347,7 @@ namespace winrt::TerminalApp::implementation
const auto profile{ settings.FindProfile(_profile.Guid()) }; const auto profile{ settings.FindProfile(_profile.Guid()) };
_profile = profile ? profile : settings.ProfileDefaults(); _profile = profile ? profile : settings.ProfileDefaults();
if (const auto& settings{ _cache.TryLookup(_profile) }) if (const auto& settings{ _cache->TryLookup(_profile) })
{ {
_control.UpdateControlSettings(settings.DefaultSettings(), settings.UnfocusedSettings()); _control.UpdateControlSettings(settings.DefaultSettings(), settings.UnfocusedSettings());
} }

View File

@ -8,6 +8,8 @@
namespace winrt::TerminalApp::implementation namespace winrt::TerminalApp::implementation
{ {
struct TerminalSettingsCache;
struct BellEventArgs : public BellEventArgsT<BellEventArgs> struct BellEventArgs : public BellEventArgsT<BellEventArgs>
{ {
public: public:
@ -20,7 +22,7 @@ namespace winrt::TerminalApp::implementation
struct TerminalPaneContent : TerminalPaneContentT<TerminalPaneContent>, BasicPaneEvents struct TerminalPaneContent : TerminalPaneContentT<TerminalPaneContent>, BasicPaneEvents
{ {
TerminalPaneContent(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile, TerminalPaneContent(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile,
const TerminalApp::TerminalSettingsCache& cache, const std::shared_ptr<TerminalSettingsCache>& cache,
const winrt::Microsoft::Terminal::Control::TermControl& control); const winrt::Microsoft::Terminal::Control::TermControl& control);
winrt::Windows::UI::Xaml::FrameworkElement GetRoot(); winrt::Windows::UI::Xaml::FrameworkElement GetRoot();
@ -59,7 +61,7 @@ namespace winrt::TerminalApp::implementation
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr }; winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected }; winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr }; winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
TerminalApp::TerminalSettingsCache _cache{ nullptr }; std::shared_ptr<TerminalSettingsCache> _cache{};
bool _isDefTermSession{ false }; bool _isDefTermSession{ false };
winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr }; winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };

View File

@ -2,7 +2,6 @@
// Licensed under the MIT license. // Licensed under the MIT license.
import "IPaneContent.idl"; import "IPaneContent.idl";
import "TerminalSettingsCache.idl";
import "FilteredCommand.idl"; import "FilteredCommand.idl";
namespace TerminalApp namespace TerminalApp

View File

@ -3,7 +3,6 @@
#include "pch.h" #include "pch.h"
#include "TerminalSettingsCache.h" #include "TerminalSettingsCache.h"
#include "TerminalSettingsCache.g.cpp"
namespace winrt namespace winrt
{ {

View File

@ -13,14 +13,13 @@ Abstract:
--*/ --*/
#pragma once #pragma once
#include "TerminalSettingsCache.g.h" #include "winrt/Microsoft.Terminal.Settings.Model.h"
#include <inc/cppwinrt_utils.h> #include "winrt/TerminalApp.h"
namespace winrt::TerminalApp::implementation namespace winrt::TerminalApp::implementation
{ {
class TerminalSettingsCache : public TerminalSettingsCacheT<TerminalSettingsCache> struct TerminalSettingsCache
{ {
public:
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings); TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile); Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings); void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
@ -31,8 +30,3 @@ namespace winrt::TerminalApp::implementation
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult>> profileGuidSettingsMap; std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult>> profileGuidSettingsMap;
}; };
} }
namespace winrt::TerminalApp::factory_implementation
{
BASIC_FACTORY(TerminalSettingsCache);
}

View File

@ -1,13 +0,0 @@
import "AppKeyBindings.idl";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
{
[default_interface] runtimeclass TerminalSettingsCache
{
TerminalSettingsCache(Microsoft.Terminal.Settings.Model.CascadiaSettings settings, AppKeyBindings bindings);
Microsoft.Terminal.Settings.Model.TerminalSettingsCreateResult TryLookup(Microsoft.Terminal.Settings.Model.Profile profile);
void Reset(Microsoft.Terminal.Settings.Model.CascadiaSettings settings, AppKeyBindings bindings);
}
}

View File

@ -1324,9 +1324,9 @@ void CascadiaSettings::_researchOnLoad()
g_hSettingsModelProvider, g_hSettingsModelProvider,
"ThemesInUse", "ThemesInUse",
TraceLoggingDescription("Data about the themes in use"), TraceLoggingDescription("Data about the themes in use"),
TraceLoggingBool(themeChoice, "Identifier for the theme chosen. 0 is system, 1 is light, 2 is dark, and 3 indicates any custom theme."), TraceLoggingInt32(themeChoice, "ThemeClass", "Identifier for the theme chosen. 0 is system (legacySystem = 6), 1 is light (legacyLight = 5), 2 is dark (legacyDark = 4), and 3 indicates any custom theme."),
TraceLoggingBool(changedTheme, "True if the user actually changed the theme from the default theme"), TraceLoggingBool(changedTheme, "ChangedTheme", "True if the user actually changed the theme from the default theme"),
TraceLoggingInt32(numThemes, "Number of themes in the user's settings"), TraceLoggingInt32(numThemes, "NumberOfThemes", "Number of themes in the user's settings"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
@ -1348,7 +1348,7 @@ void CascadiaSettings::_researchOnLoad()
g_hSettingsModelProvider, g_hSettingsModelProvider,
"SendInputUsage", "SendInputUsage",
TraceLoggingDescription("Event emitted upon settings load, containing the number of sendInput actions a user has"), TraceLoggingDescription("Event emitted upon settings load, containing the number of sendInput actions a user has"),
TraceLoggingInt32(collectSendInput(), "Number of sendInput actions in the user's settings"), TraceLoggingInt32(collectSendInput(), "NumberOfSendInputActions", "Number of sendInput actions in the user's settings"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
@ -1365,8 +1365,8 @@ void CascadiaSettings::_researchOnLoad()
g_hSettingsModelProvider, g_hSettingsModelProvider,
"MarksProfilesUsage", "MarksProfilesUsage",
TraceLoggingDescription("Event emitted upon settings load, containing the number of profiles opted-in to scrollbar marks"), TraceLoggingDescription("Event emitted upon settings load, containing the number of profiles opted-in to scrollbar marks"),
TraceLoggingInt32(totalAutoMark, "Number of profiles for which AutoMarkPrompts is enabled"), TraceLoggingInt32(totalAutoMark, "NumberOfAutoMarkPromptsProfiles", "Number of profiles for which AutoMarkPrompts is enabled"),
TraceLoggingInt32(totalShowMarks, "Number of profiles for which ShowMarks is enabled"), TraceLoggingInt32(totalShowMarks, "NumberOfShowMarksProfiles", "Number of profiles for which ShowMarks is enabled"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
} }