Skip to content

Commit 14dfdda

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/llm
# Conflicts: # src/cascadia/TerminalApp/TerminalPage.cpp # src/cascadia/TerminalSettingsEditor/MainPage.cpp
2 parents 404c167 + 3c2eb59 commit 14dfdda

19 files changed

+175
-47
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Same as the official arm64-windows-static triplet
2+
set(VCPKG_TARGET_ARCHITECTURE arm64)
3+
set(VCPKG_CRT_LINKAGE static)
4+
set(VCPKG_LIBRARY_LINKAGE static)
5+
6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# Same as the official arm64-windows-static triplet
12
set(VCPKG_TARGET_ARCHITECTURE arm64)
23
set(VCPKG_CRT_LINKAGE static)
34
set(VCPKG_LIBRARY_LINKAGE static)
45

6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)
9+
510
set(VCPKG_CXX_FLAGS /fsanitize=address)
611
set(VCPKG_C_FLAGS /fsanitize=address)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# Same as the official x64-windows-static triplet
12
set(VCPKG_TARGET_ARCHITECTURE x64)
23
set(VCPKG_CRT_LINKAGE static)
34
set(VCPKG_LIBRARY_LINKAGE static)
45

6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)
9+
510
set(VCPKG_CXX_FLAGS /fsanitize=address)
611
set(VCPKG_C_FLAGS /fsanitize=address)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# Same as the official x86-windows-static triplet
12
set(VCPKG_TARGET_ARCHITECTURE x86)
23
set(VCPKG_CRT_LINKAGE static)
34
set(VCPKG_LIBRARY_LINKAGE static)
45

6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)
9+
510
set(VCPKG_CXX_FLAGS /fsanitize=address)
611
set(VCPKG_C_FLAGS /fsanitize=address)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Same as the official x64-windows-static triplet
2+
set(VCPKG_TARGET_ARCHITECTURE x64)
3+
set(VCPKG_CRT_LINKAGE static)
4+
set(VCPKG_LIBRARY_LINKAGE static)
5+
6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Same as the official x86-windows-static triplet
2+
set(VCPKG_TARGET_ARCHITECTURE x86)
3+
set(VCPKG_CRT_LINKAGE static)
4+
set(VCPKG_LIBRARY_LINKAGE static)
5+
6+
# ...but with explicit platform toolset, so that future toolsets
7+
# aren't automatically picked up (it defaults to the latest one).
8+
set(VCPKG_PLATFORM_TOOLSET v143)

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
#include <TerminalCore/ControlKeyStates.hpp>
99
#include <TerminalThemeHelpers.h>
10-
#include <til/hash.h>
1110
#include <til/io.h>
11+
#include <til/hash.h>
12+
#include <til/unicode.h>
1213
#include <shlobj.h>
1314
#include <Utils.h>
1415

@@ -3198,7 +3199,19 @@ namespace winrt::TerminalApp::implementation
31983199
{
31993200
// We have to initialize the dialog here to be able to change the text of the text block within it
32003201
std::ignore = FindName(L"MultiLinePasteDialog");
3201-
ClipboardText().Text(text);
3202+
3203+
// WinUI absolutely cannot deal with large amounts of text (at least O(n), possibly O(n^2),
3204+
// so we limit the string length here and add an ellipsis if necessary.
3205+
auto clipboardText = text;
3206+
if (clipboardText.size() > 1024)
3207+
{
3208+
const std::wstring_view view{ text };
3209+
// Make sure we don't cut in the middle of a surrogate pair
3210+
const auto len = til::utf16_iterate_prev(view, 512);
3211+
clipboardText = til::hstring_format(FMT_COMPILE(L"{}\n"), view.substr(0, len));
3212+
}
3213+
3214+
ClipboardText().Text(std::move(clipboardText));
32023215

32033216
// The vertical offset on the scrollbar does not reset automatically, so reset it manually
32043217
ClipboardContentScrollViewer().ScrollToVerticalOffset(0);
@@ -3214,7 +3227,7 @@ namespace winrt::TerminalApp::implementation
32143227
}
32153228

32163229
// Clear the clipboard text so it doesn't lie around in memory
3217-
ClipboardText().Text(L"");
3230+
ClipboardText().Text({});
32183231

32193232
if (warningResult != ContentDialogResult::Primary)
32203233
{

src/cascadia/TerminalSettingsEditor/Appearances.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
202202
return _isFontFeature;
203203
}
204204

205+
winrt::hstring FontKeyValuePair::AutomationName()
206+
{
207+
return hstring{ fmt::format(FMT_COMPILE(L"{}: {}"), KeyDisplayStringRef(), _value) };
208+
}
209+
205210
AppearanceViewModel::AppearanceViewModel(const Model::AppearanceConfig& appearance) :
206211
_appearance{ appearance }
207212
{

src/cascadia/TerminalSettingsEditor/Appearances.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
4747
uint32_t Key() const noexcept;
4848
float Value() const noexcept;
4949
void Value(float v);
50+
winrt::hstring AutomationName();
5051

5152
void SetValueDirect(float v);
5253
bool IsFontFeature() const noexcept;

src/cascadia/TerminalSettingsEditor/Appearances.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace Microsoft.Terminal.Settings.Editor
2828
UInt32 Key { get; };
2929
String KeyDisplayString { get; };
3030
Single Value;
31+
String AutomationName { get; };
3132
}
3233

3334
runtimeclass AppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged

0 commit comments

Comments
 (0)