Skip to content

Commit 7ec5d91

Browse files
committed
Merge remote-tracking branch 'origin/main' into tmux_cc_pr
2 parents 71effe1 + 5c3e712 commit 7ec5d91

40 files changed

+406
-411
lines changed

.github/actions/spelling/expect/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ minkernel
10171017
MINMAXINFO
10181018
minwin
10191019
minwindef
1020+
misprediction
10201021
MMBB
10211022
mmcc
10221023
MMCPL

build/pipelines/templates-v2/job-build-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ jobs:
133133
$SignFragments += "wpfdotnet"
134134
}
135135
If ([bool]::Parse("${{ parameters.buildWPF }}")) {
136-
$BuildTargets += "Terminal\Control\Microsoft_Terminal_Control"
136+
$BuildTargets += "Terminal\Control\TerminalControl"
137137
$SignFragments += "wpf"
138138
}
139139
If ([bool]::Parse("${{ parameters.buildConPTY }}")) {
140-
$BuildTargets += "Conhost\Host_EXE;Conhost\winconpty_DLL"
140+
$BuildTargets += "Conhost\Host_EXE;Conhost\winconptydll"
141141
$SignFragments += "conpty"
142142
}
143143
Write-Host "Targets: $($BuildTargets -Join ";")"
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/Resources/en-US/Resources.resw

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,6 @@
149149
<data name="SettingsValidateErrorTitle" xml:space="preserve">
150150
<value>Encountered errors while loading user settings</value>
151151
</data>
152-
<data name="KeyboardServiceDisabledDialog.PrimaryButtonText" xml:space="preserve">
153-
<value>OK</value>
154-
</data>
155-
<data name="KeyboardServiceDisabledDialog.Title" xml:space="preserve">
156-
<value>Warning:</value>
157-
</data>
158152
<data name="KeyboardServiceWarningText" xml:space="preserve">
159153
<value>The "{0}" isn't running on your machine. This can prevent the Terminal from receiving keyboard input.</value>
160154
<comment>{0} will be replaced with the OS-localized name of the TabletInputService</comment>
@@ -165,28 +159,12 @@
165159
<data name="ReloadJsonParseErrorTitle" xml:space="preserve">
166160
<value>Failed to reload settings</value>
167161
</data>
168-
<data name="FeedbackUriValue" xml:space="preserve">
169-
<value>https://go.microsoft.com/fwlink/?linkid=2125419</value>
170-
<comment>{Locked}This is a FWLink, so it will be localized with the fwlink tool</comment>
171-
</data>
172162
<data name="AboutMenuItem" xml:space="preserve">
173163
<value>About</value>
174164
</data>
175-
<data name="FeedbackMenuItem" xml:space="preserve">
176-
<value>Feedback</value>
177-
</data>
178165
<data name="SettingsMenuItem" xml:space="preserve">
179166
<value>Settings</value>
180167
</data>
181-
<data name="Cancel" xml:space="preserve">
182-
<value>Cancel</value>
183-
</data>
184-
<data name="CloseAll" xml:space="preserve">
185-
<value>Close all</value>
186-
</data>
187-
<data name="Quit" xml:space="preserve">
188-
<value>Quit</value>
189-
</data>
190168
<data name="MultiplePanes" xml:space="preserve">
191169
<value>Multiple panes</value>
192170
</data>
@@ -293,17 +271,6 @@
293271
<value>• The specified "theme" was not found in the list of themes. Temporarily falling back to the default value.</value>
294272
<comment>{Locked="•"} This glyph is a bullet, used in a bulleted list.</comment>
295273
</data>
296-
<data name="LegacyGlobalsProperty" xml:space="preserve">
297-
<value>The "globals" property is deprecated - your settings might need updating. </value>
298-
<comment>{Locked="\"globals\""} </comment>
299-
</data>
300-
<data name="LegacyGlobalsPropertyHrefUrl" xml:space="preserve">
301-
<value>https://go.microsoft.com/fwlink/?linkid=2128258</value>
302-
<comment>{Locked}This is a FWLink, so it will be localized with the fwlink tool</comment>
303-
</data>
304-
<data name="LegacyGlobalsPropertyHrefLabel" xml:space="preserve">
305-
<value>For more info, see this web page.</value>
306-
</data>
307274
<data name="FailedToParseCommandJson" xml:space="preserve">
308275
<value>Failed to expand a command with "iterateOn" set. This command will be ignored.</value>
309276
<comment>{Locked="\"iterateOn\""} </comment>
@@ -484,21 +451,12 @@
484451
<data name="ElevatedRun.Text" xml:space="preserve">
485452
<value>Ctrl+Click to open as administrator</value>
486453
</data>
487-
<data name="WindowCloseButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
488-
<value>Close</value>
489-
</data>
490454
<data name="WindowCloseButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
491455
<value>Close</value>
492456
</data>
493457
<data name="WindowCloseButtonToolTip.Text" xml:space="preserve">
494458
<value>Close</value>
495459
</data>
496-
<data name="WindowMaximizeButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
497-
<value>Maximize</value>
498-
</data>
499-
<data name="WindowMinimizeButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
500-
<value>Minimize</value>
501-
</data>
502460
<data name="WindowMinimizeButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
503461
<value>Minimize</value>
504462
</data>
@@ -518,10 +476,6 @@
518476
<value>Version:</value>
519477
<comment>This is the heading for a version number label</comment>
520478
</data>
521-
<data name="AboutDialog_GettingStartedLink.Content" xml:space="preserve">
522-
<value>Getting started</value>
523-
<comment>A hyperlink name for a guide on how to get started using Terminal</comment>
524-
</data>
525479
<data name="AboutDialog_SourceCodeLink.Content" xml:space="preserve">
526480
<value>Source code</value>
527481
<comment>A hyperlink name for the Terminal's documentation</comment>
@@ -797,18 +751,9 @@
797751
<data name="ExportTabText" xml:space="preserve">
798752
<value>Export text</value>
799753
</data>
800-
<data name="ExportFailure" xml:space="preserve">
801-
<value>Failed to export terminal content</value>
802-
</data>
803-
<data name="ExportSuccess" xml:space="preserve">
804-
<value>Successfully exported terminal content</value>
805-
</data>
806754
<data name="FindText" xml:space="preserve">
807755
<value>Find</value>
808756
</data>
809-
<data name="PlainText" xml:space="preserve">
810-
<value>Plain text</value>
811-
</data>
812757
<data name="CloseOnExitInfoBar.Message" xml:space="preserve">
813758
<value>Termination behavior can be configured in advanced profile settings.</value>
814759
</data>
@@ -914,10 +859,6 @@
914859
<value>"{0}" tab moved to position "{1}"</value>
915860
<comment>{Locked="{0}"}{Locked="{1}"}This text is read out by screen readers upon a successful tab movement. {0} is the name of the tab. {1} is the new tab index in the tab row.</comment>
916861
</data>
917-
<data name="TerminalPage_PaneMovedAnnouncement_ExistingWindow" xml:space="preserve">
918-
<value>Active pane moved to "{0}" tab in "{1}" window</value>
919-
<comment>{Locked="{0}"}{Locked="{1}"}This text is read out by screen readers upon a successful pane movement. {0} is the name of the tab the pane was moved to. {1} is the name of the window the pane was moved to. Replaced in 1.19 by TerminalPage_PaneMovedAnnouncement_ExistingWindow2</comment>
920-
</data>
921862
<data name="TerminalPage_PaneMovedAnnouncement_ExistingWindow2" xml:space="preserve">
922863
<value>Active pane moved to "{0}" window</value>
923864
<comment>{Locked="{0}"}This text is read out by screen readers upon a successful pane movement. {0} is the name of the window the pane was moved to.</comment>
@@ -984,8 +925,9 @@
984925
</data>
985926
<data name="TmuxControlInfo" xml:space="preserve">
986927
<value>Running in tmux control mode; Press 'q' to detach:</value>
928+
<comment>{Locked="'q'"}</comment>
987929
</data>
988930
<data name="NewTmuxControlTab.Text" xml:space="preserve">
989931
<value>Tmux Control Tab</value>
990932
</data>
991-
</root>
933+
</root>

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <TerminalCore/ControlKeyStates.hpp>
99
#include <TerminalThemeHelpers.h>
1010
#include <til/hash.h>
11+
#include <til/unicode.h>
1112
#include <Utils.h>
1213

1314
#include "../../types/inc/ColorFix.hpp"
@@ -3024,7 +3025,19 @@ namespace winrt::TerminalApp::implementation
30243025
{
30253026
// We have to initialize the dialog here to be able to change the text of the text block within it
30263027
std::ignore = FindName(L"MultiLinePasteDialog");
3027-
ClipboardText().Text(text);
3028+
3029+
// WinUI absolutely cannot deal with large amounts of text (at least O(n), possibly O(n^2),
3030+
// so we limit the string length here and add an ellipsis if necessary.
3031+
auto clipboardText = text;
3032+
if (clipboardText.size() > 1024)
3033+
{
3034+
const std::wstring_view view{ text };
3035+
// Make sure we don't cut in the middle of a surrogate pair
3036+
const auto len = til::utf16_iterate_prev(view, 512);
3037+
clipboardText = til::hstring_format(FMT_COMPILE(L"{}\n"), view.substr(0, len));
3038+
}
3039+
3040+
ClipboardText().Text(std::move(clipboardText));
30283041

30293042
// The vertical offset on the scrollbar does not reset automatically, so reset it manually
30303043
ClipboardContentScrollViewer().ScrollToVerticalOffset(0);
@@ -3040,7 +3053,7 @@ namespace winrt::TerminalApp::implementation
30403053
}
30413054

30423055
// Clear the clipboard text so it doesn't lie around in memory
3043-
ClipboardText().Text(L"");
3056+
ClipboardText().Text({});
30443057

30453058
if (warningResult != ContentDialogResult::Primary)
30463059
{

0 commit comments

Comments
 (0)