mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Merge remote-tracking branch 'origin/main' into feature/llm
This commit is contained in:
commit
e66bcad499
@ -174,9 +174,7 @@
|
||||
<DependentUpon>TerminalPaneContent.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Toast.h" />
|
||||
<ClInclude Include="TerminalSettingsCache.h">
|
||||
<DependentUpon>TerminalSettingsCache.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TerminalSettingsCache.h" />
|
||||
<ClInclude Include="SuggestionsControl.h">
|
||||
<DependentUpon>SuggestionsControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
@ -289,9 +287,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
<ClCompile Include="Toast.cpp" />
|
||||
<ClCompile Include="TerminalSettingsCache.cpp">
|
||||
<DependentUpon>TerminalSettingsCache.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalSettingsCache.cpp" />
|
||||
<ClCompile Include="SuggestionsControl.cpp">
|
||||
<DependentUpon>SuggestionsControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
@ -366,7 +362,6 @@
|
||||
<DependentUpon>TaskPaneContent.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="TerminalSettingsCache.idl" />
|
||||
<Midl Include="MarkdownPaneContent.idl">
|
||||
<DependentUpon>MarkdownPaneContent.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
||||
@ -90,7 +90,6 @@
|
||||
<Midl Include="TerminalWindow.idl" />
|
||||
<Midl Include="TaskbarState.idl" />
|
||||
<Midl Include="IPaneContent.idl" />
|
||||
<Midl Include="TerminalSettingsCache.idl" />
|
||||
<Midl Include="Monarch.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include "SettingsPaneContent.h"
|
||||
#include "SnippetsPaneContent.h"
|
||||
#include "TabRowControl.h"
|
||||
#include "TerminalSettingsCache.h"
|
||||
#include "../../types/inc/ColorFix.hpp"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
|
||||
@ -243,7 +244,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (_settings == nullptr)
|
||||
{
|
||||
// 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;
|
||||
|
||||
@ -3935,7 +3936,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// updating terminal panes, so that we don't have to build a _new_
|
||||
// TerminalSettings for every profile we update - we can just look them
|
||||
// up the previous ones we built.
|
||||
_terminalSettingsCache.Reset(_settings, *_bindings);
|
||||
_terminalSettingsCache->Reset(_settings, *_bindings);
|
||||
|
||||
for (const auto& tab : _tabs)
|
||||
{
|
||||
|
||||
@ -31,6 +31,8 @@ namespace Microsoft::Terminal::Core
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct TerminalSettingsCache;
|
||||
|
||||
inline constexpr uint32_t DefaultRowsToScroll{ 3 };
|
||||
inline constexpr std::wstring_view TabletInputServiceKey{ L"TabletInputService" };
|
||||
|
||||
@ -277,7 +279,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
TerminalApp::ContentManager _manager{ nullptr };
|
||||
|
||||
TerminalApp::TerminalSettingsCache _terminalSettingsCache{ nullptr };
|
||||
std::shared_ptr<TerminalSettingsCache> _terminalSettingsCache{};
|
||||
|
||||
struct StashedDragData
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "TerminalSettingsCache.h"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
|
||||
#include "BellEventArgs.g.cpp"
|
||||
@ -20,7 +21,7 @@ using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
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) :
|
||||
_control{ control },
|
||||
_cache{ cache },
|
||||
@ -346,7 +347,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto profile{ settings.FindProfile(_profile.Guid()) };
|
||||
_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());
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct TerminalSettingsCache;
|
||||
|
||||
struct BellEventArgs : public BellEventArgsT<BellEventArgs>
|
||||
{
|
||||
public:
|
||||
@ -20,7 +22,7 @@ namespace winrt::TerminalApp::implementation
|
||||
struct TerminalPaneContent : TerminalPaneContentT<TerminalPaneContent>, BasicPaneEvents
|
||||
{
|
||||
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);
|
||||
|
||||
winrt::Windows::UI::Xaml::FrameworkElement GetRoot();
|
||||
@ -59,7 +61,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
|
||||
winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
|
||||
TerminalApp::TerminalSettingsCache _cache{ nullptr };
|
||||
std::shared_ptr<TerminalSettingsCache> _cache{};
|
||||
bool _isDefTermSession{ false };
|
||||
|
||||
winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "IPaneContent.idl";
|
||||
import "TerminalSettingsCache.idl";
|
||||
import "FilteredCommand.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "TerminalSettingsCache.h"
|
||||
#include "TerminalSettingsCache.g.cpp"
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
|
||||
@ -13,14 +13,13 @@ Abstract:
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "TerminalSettingsCache.g.h"
|
||||
#include <inc/cppwinrt_utils.h>
|
||||
#include "winrt/Microsoft.Terminal.Settings.Model.h"
|
||||
#include "winrt/TerminalApp.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
class TerminalSettingsCache : public TerminalSettingsCacheT<TerminalSettingsCache>
|
||||
struct TerminalSettingsCache
|
||||
{
|
||||
public:
|
||||
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);
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(TerminalSettingsCache);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -1324,9 +1324,9 @@ void CascadiaSettings::_researchOnLoad()
|
||||
g_hSettingsModelProvider,
|
||||
"ThemesInUse",
|
||||
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."),
|
||||
TraceLoggingBool(changedTheme, "True if the user actually changed the theme from the default theme"),
|
||||
TraceLoggingInt32(numThemes, "Number of themes in the user's settings"),
|
||||
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, "ChangedTheme", "True if the user actually changed the theme from the default theme"),
|
||||
TraceLoggingInt32(numThemes, "NumberOfThemes", "Number of themes in the user's settings"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||
|
||||
@ -1348,7 +1348,7 @@ void CascadiaSettings::_researchOnLoad()
|
||||
g_hSettingsModelProvider,
|
||||
"SendInputUsage",
|
||||
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),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||
|
||||
@ -1365,8 +1365,8 @@ void CascadiaSettings::_researchOnLoad()
|
||||
g_hSettingsModelProvider,
|
||||
"MarksProfilesUsage",
|
||||
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(totalShowMarks, "Number of profiles for which ShowMarks is enabled"),
|
||||
TraceLoggingInt32(totalAutoMark, "NumberOfAutoMarkPromptsProfiles", "Number of profiles for which AutoMarkPrompts is enabled"),
|
||||
TraceLoggingInt32(totalShowMarks, "NumberOfShowMarksProfiles", "Number of profiles for which ShowMarks is enabled"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user