mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 22:29:43 +00:00
Compare commits
68 Commits
dev/lhecke
...
v1.12.1039
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84ba7364e | ||
|
|
26a001fa6a | ||
|
|
2f18fc1a25 | ||
|
|
3e5e0dbc1c | ||
|
|
1da3c7f080 | ||
|
|
4eaeaad3ac | ||
|
|
25e67fee59 | ||
|
|
c4826198dc | ||
|
|
4b9dc5ba84 | ||
|
|
093ab06272 | ||
|
|
d3d68ac874 | ||
|
|
a84d988473 | ||
|
|
9ec2667ae3 | ||
|
|
89f9a55258 | ||
|
|
7438669930 | ||
|
|
e103a7364b | ||
|
|
5664cf84e5 | ||
|
|
b53a902b55 | ||
|
|
99dd8549f3 | ||
|
|
0837b186cb | ||
|
|
38b4a858c9 | ||
|
|
a03fde9cac | ||
|
|
8baf3af5e1 | ||
|
|
adbf2fa7e2 | ||
|
|
0655dfd354 | ||
|
|
c4398bac5d | ||
|
|
0d1e4d3461 | ||
|
|
2c3bf1880d | ||
|
|
42e5671a79 | ||
|
|
fffcb63877 | ||
|
|
75745df774 | ||
|
|
d91b4ca899 | ||
|
|
b512e7d5a4 | ||
|
|
6d86429522 | ||
|
|
d8170bcbb6 | ||
|
|
503e27e475 | ||
|
|
b30137b94f | ||
|
|
c197ca5f5d | ||
|
|
717d9b77c3 | ||
|
|
48cb5f0bfa | ||
|
|
df2d9fc542 | ||
|
|
789d22ef2b | ||
|
|
db5ddccc17 | ||
|
|
3f385f11a1 | ||
|
|
a3b9cd2369 | ||
|
|
5f7c66bc0c | ||
|
|
757399650d | ||
|
|
1ce8424ab7 | ||
|
|
e0c4277777 | ||
|
|
3a51afc375 | ||
|
|
a303c63b07 | ||
|
|
ccc74686a2 | ||
|
|
0c022811e6 | ||
|
|
83b482a05f | ||
|
|
217196e592 | ||
|
|
ab683c00cc | ||
|
|
4ad3156f42 | ||
|
|
bf27a79ace | ||
|
|
3a615149da | ||
|
|
dadee5bdaf | ||
|
|
4c364e9342 | ||
|
|
aaabce77c7 | ||
|
|
c9cde49716 | ||
|
|
5198c8e2e4 | ||
|
|
2aa2458b22 | ||
|
|
aacfc2a424 | ||
|
|
39b72f78c3 | ||
|
|
89674ac4fb |
1
.github/actions/spelling/allow/allow.txt
vendored
1
.github/actions/spelling/allow/allow.txt
vendored
@@ -30,6 +30,7 @@ hyperlink
|
||||
hyperlinking
|
||||
hyperlinks
|
||||
img
|
||||
inlined
|
||||
It'd
|
||||
kje
|
||||
liga
|
||||
|
||||
7
.github/actions/spelling/allow/apis.txt
vendored
7
.github/actions/spelling/allow/apis.txt
vendored
@@ -38,12 +38,14 @@ fullkbd
|
||||
futex
|
||||
GETDESKWALLPAPER
|
||||
GETHIGHCONTRAST
|
||||
GETMOUSEHOVERTIME
|
||||
Hashtable
|
||||
HIGHCONTRASTON
|
||||
HIGHCONTRASTW
|
||||
hotkeys
|
||||
href
|
||||
hrgn
|
||||
HTCLOSE
|
||||
IActivation
|
||||
IApp
|
||||
IAppearance
|
||||
@@ -87,11 +89,14 @@ MENUDATA
|
||||
MENUINFO
|
||||
memicmp
|
||||
mptt
|
||||
MOUSELEAVE
|
||||
mov
|
||||
msappx
|
||||
MULTIPLEUSE
|
||||
NCHITTEST
|
||||
NCLBUTTONDBLCLK
|
||||
NCMOUSELEAVE
|
||||
NCMOUSEMOVE
|
||||
NCRBUTTONDBLCLK
|
||||
NIF
|
||||
NIN
|
||||
@@ -153,9 +158,11 @@ TASKBARCREATED
|
||||
TBPF
|
||||
THEMECHANGED
|
||||
tlg
|
||||
TME
|
||||
tmp
|
||||
tolower
|
||||
toupper
|
||||
TRACKMOUSEEVENT
|
||||
TTask
|
||||
TVal
|
||||
UChar
|
||||
|
||||
7
.github/actions/spelling/allow/math.txt
vendored
7
.github/actions/spelling/allow/math.txt
vendored
@@ -1,11 +1,4 @@
|
||||
atan
|
||||
CPrime
|
||||
HBar
|
||||
HPrime
|
||||
isnan
|
||||
LPrime
|
||||
LStep
|
||||
powf
|
||||
RSub
|
||||
sqrtf
|
||||
ULP
|
||||
|
||||
23
.github/actions/spelling/expect/expect.txt
vendored
23
.github/actions/spelling/expect/expect.txt
vendored
@@ -385,12 +385,14 @@ CPINFOEX
|
||||
CPLINFO
|
||||
cplusplus
|
||||
cpp
|
||||
CPPARM
|
||||
CPPCORECHECK
|
||||
cppcorecheckrules
|
||||
cppm
|
||||
cpprest
|
||||
cpprestsdk
|
||||
cppwinrt
|
||||
CPPx
|
||||
CProc
|
||||
cpx
|
||||
crbegin
|
||||
@@ -470,6 +472,7 @@ cygwin
|
||||
CYHSCROLL
|
||||
CYMIN
|
||||
CYPADDEDBORDER
|
||||
CYRL
|
||||
CYSIZE
|
||||
CYSIZEFRAME
|
||||
CYSMICON
|
||||
@@ -935,9 +938,12 @@ groupbox
|
||||
gset
|
||||
gsl
|
||||
GTP
|
||||
GTR
|
||||
guardxfg
|
||||
guc
|
||||
gui
|
||||
guidatom
|
||||
guiddef
|
||||
GValue
|
||||
GWL
|
||||
GWLP
|
||||
@@ -1232,12 +1238,14 @@ KLF
|
||||
KLMNO
|
||||
KLMNOPQRST
|
||||
KLMNOPQRSTQQQQQ
|
||||
KOK
|
||||
KPRIORITY
|
||||
KVM
|
||||
langid
|
||||
LANGUAGELIST
|
||||
lasterror
|
||||
lastexitcode
|
||||
LATN
|
||||
LAYOUTRTL
|
||||
LBN
|
||||
LBound
|
||||
@@ -1453,6 +1461,7 @@ msctls
|
||||
msdata
|
||||
msdn
|
||||
msft
|
||||
MSDL
|
||||
MSGCMDLINEF
|
||||
MSGF
|
||||
MSGFILTER
|
||||
@@ -1535,6 +1544,7 @@ NOCOLOR
|
||||
NOCOMM
|
||||
NOCONTEXTHELP
|
||||
NOCOPYBITS
|
||||
nodefaultlib
|
||||
nodiscard
|
||||
NODUP
|
||||
noexcept
|
||||
@@ -1574,6 +1584,7 @@ nothrow
|
||||
NOTICKS
|
||||
NOTIMPL
|
||||
notin
|
||||
notmatch
|
||||
NOTNULL
|
||||
NOTOPMOST
|
||||
NOTRACK
|
||||
@@ -1758,6 +1769,7 @@ PFONTENUMDATA
|
||||
PFS
|
||||
pgd
|
||||
pgdn
|
||||
PGONu
|
||||
pgorepro
|
||||
pgort
|
||||
PGU
|
||||
@@ -1781,6 +1793,9 @@ placeholders
|
||||
platforming
|
||||
playsound
|
||||
plist
|
||||
PLOC
|
||||
PLOCA
|
||||
PLOCM
|
||||
PLOGICAL
|
||||
plugin
|
||||
PMv
|
||||
@@ -1792,6 +1807,7 @@ PNTSTATUS
|
||||
POBJECT
|
||||
Podcast
|
||||
POINTSLIST
|
||||
Poli
|
||||
POLYTEXTW
|
||||
popd
|
||||
POPF
|
||||
@@ -1913,6 +1929,7 @@ qsort
|
||||
queryable
|
||||
QUESTIONMARK
|
||||
quickedit
|
||||
QUZ
|
||||
QWER
|
||||
qzmp
|
||||
RAII
|
||||
@@ -2232,6 +2249,7 @@ STARTWPARMSW
|
||||
Statusline
|
||||
stdafx
|
||||
STDAPI
|
||||
stdc
|
||||
stdcall
|
||||
stdcpp
|
||||
stderr
|
||||
@@ -2377,6 +2395,7 @@ TIcon
|
||||
tif
|
||||
tilunittests
|
||||
Timeline
|
||||
timelines
|
||||
titlebar
|
||||
TITLEISLINKNAME
|
||||
TJson
|
||||
@@ -2475,6 +2494,7 @@ uint
|
||||
uintptr
|
||||
ulcch
|
||||
ulong
|
||||
umd
|
||||
Unadvise
|
||||
unattend
|
||||
uncomment
|
||||
@@ -2645,6 +2665,7 @@ wddmcon
|
||||
wddmconrenderer
|
||||
WDDMCONSOLECONTEXT
|
||||
wdm
|
||||
webclient
|
||||
webpage
|
||||
website
|
||||
websocket
|
||||
@@ -2719,6 +2740,7 @@ Winperf
|
||||
WInplace
|
||||
winres
|
||||
winrt
|
||||
winsdk
|
||||
wintelnet
|
||||
winternl
|
||||
winuser
|
||||
@@ -2813,6 +2835,7 @@ xdy
|
||||
XEncoding
|
||||
xes
|
||||
xff
|
||||
xfg
|
||||
XFile
|
||||
XFORM
|
||||
xIcon
|
||||
|
||||
2
.github/actions/spelling/expect/web.txt
vendored
2
.github/actions/spelling/expect/web.txt
vendored
@@ -1,7 +1,5 @@
|
||||
http
|
||||
www
|
||||
easyrgb
|
||||
php
|
||||
ecma
|
||||
rapidtables
|
||||
WCAG
|
||||
|
||||
37
NOTICE.md
37
NOTICE.md
@@ -276,43 +276,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
## ConEmu
|
||||
**Source**: [https://github.com/Maximus5/ConEmu](https://github.com/Maximus5/ConEmu)
|
||||
|
||||
### License
|
||||
|
||||
```
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2009-2017, Maximus5 <ConEmu.Maximus5@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
# Microsoft Open Source
|
||||
|
||||
This product also incorporates source code from other Microsoft open source projects, all licensed under the MIT license.
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<clear />
|
||||
</disabledPackageSources>
|
||||
<config>
|
||||
<!-- TODO: TEMPORARY UNTIL PGO-Helpers is updated to search both. We shouldn't need to keep the globals path here. -->
|
||||
<add key="globalPackagesFolder" value=".\packages" />
|
||||
<add key="repositorypath" value=".\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
||||
@@ -268,8 +268,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RendererUia", "src\renderer
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinRTUtils", "src\cascadia\WinRTUtils\WinRTUtils.vcxproj", "{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsTerminalUniversal", "src\cascadia\WindowsTerminalUniversal\WindowsTerminalUniversal.vcxproj", "{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winconpty.LIB", "src\winconpty\lib\winconptylib.vcxproj", "{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winconpty.DLL", "src\winconpty\dll\winconptydll.vcxproj", "{A22EC5F6-7851-4B88-AC52-47249D437A52}"
|
||||
@@ -2352,50 +2350,6 @@ Global
|
||||
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}.Release|x64.Build.0 = Release|x64
|
||||
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}.Release|x86.Build.0 = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|Any CPU.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|Any CPU.Build.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|Any CPU.Deploy.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|ARM.ActiveCfg = AuditMode|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|ARM64.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|ARM64.Build.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|ARM64.Deploy.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|DotNet_x64Test.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|DotNet_x86Test.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|x64.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|x86.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|x86.Build.0 = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.AuditMode|x86.Deploy.0 = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|ARM64.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|DotNet_x64Test.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x64.Build.0 = Debug|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|DotNet_x64Test.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x64.ActiveCfg = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x64.Build.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x64.Deploy.0 = Release|x64
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x86.Build.0 = Release|Win32
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1}.Release|x86.Deploy.0 = Release|Win32
|
||||
{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A}.AuditMode|ARM.ActiveCfg = AuditMode|Win32
|
||||
{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
|
||||
@@ -3404,7 +3358,6 @@ Global
|
||||
{CA5CAD1A-B11C-4DDB-A4FE-C3AFAE9B5506} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
|
||||
{48D21369-3D7B-4431-9967-24E81292CF63} = {05500DEF-2294-41E3-AF9A-24E580B82836}
|
||||
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{B0AC39D6-7B40-49A9-8202-58549BAE1FB1} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
|
||||
{A22EC5F6-7851-4B88-AC52-47249D437A52} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
|
||||
{A021EDFF-45C8-4DC2-BEF7-36E1B3B8CFE8} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
|
||||
|
||||
@@ -31,7 +31,7 @@ $totalTestsExecutedCount = 0
|
||||
|
||||
# We assume that we only have one testRun with a given name that we care about
|
||||
# We only process the last testRun with a given name (based on completedDate)
|
||||
# The name of a testRun is set to the Helix queue that it was run on (e.g. windows.10.amd64.client19h1.xaml)
|
||||
# The name of a testRun is set to the Helix queue that it was run on (e.g. windows.10.amd64.client21h1.xaml)
|
||||
# If we have multiple test runs on the same queue that we care about, we will need to re-visit this logic
|
||||
foreach ($testRun in ($testRuns.value | Sort-Object -Property "completedDate" -Descending))
|
||||
{
|
||||
|
||||
11
build/config/PolicheckExclusions.xml
Normal file
11
build/config/PolicheckExclusions.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<PoliCheckExclusions>
|
||||
<!-- All strings must be UPPER CASE -->
|
||||
<!--Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped -->
|
||||
<Exclusion Type="FolderPathFull">winrt|.git|oss|packages</Exclusion>
|
||||
<!--Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped -->
|
||||
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>-->
|
||||
<!--Each of these file types will be completely skipped for the entire scan -->
|
||||
<Exclusion Type="FileType">.PNG|.SVG|.BMP|.ICO</Exclusion>
|
||||
<!--The specified file names will be skipped during the scan regardless which folder they are in -->
|
||||
<!--<Exclusion Type="FileName">ABC.TXT|XYZ.CS</Exclusion>-->
|
||||
</PoliCheckExclusions>
|
||||
@@ -2,4 +2,5 @@
|
||||
<packages>
|
||||
<package id="MUXCustomBuildTasks" version="1.0.48" targetFramework="native" />
|
||||
<package id="Microsoft.Taef" version="10.60.210621002" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
4
build/pgo/PGO.DB.proj
Normal file
4
build/pgo/PGO.DB.proj
Normal file
@@ -0,0 +1,4 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="Terminal.PGO.props" />
|
||||
<Import Project="$(PkgMicrosoft_PGO_Helpers_Cpp)\build\Microsoft.PGO-Helpers.Cpp.targets" />
|
||||
</Project>
|
||||
16
build/pgo/Terminal.PGO.DB.nuspec
Normal file
16
build/pgo/Terminal.PGO.DB.nuspec
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Microsoft.Internal.Windows.Terminal.PGODatabase</id>
|
||||
<version>0</version>
|
||||
<title>Windows Terminal PGO Database</title>
|
||||
<authors>Microsoft</authors>
|
||||
<owners>Microsoft</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Windows Terminal PGO Database</description>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- The target directories for pgd files need to remain as is. PGO optimization pass will rely on this exact directory layout. -->
|
||||
<file src="x64\*.pgd" target="tools\x64"/>
|
||||
</files>
|
||||
</package>
|
||||
51
build/pgo/Terminal.PGO.props
Normal file
51
build/pgo/Terminal.PGO.props
Normal file
@@ -0,0 +1,51 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<NuGetPackageDirectory>$(MSBuildThisFileDirectory)..\..\packages</NuGetPackageDirectory>
|
||||
<PkgMicrosoft_PGO_Helpers_Cpp>$(NuGetPackageDirectory)\Microsoft.Internal.PGO-Helpers.Cpp.0.2.34</PkgMicrosoft_PGO_Helpers_Cpp>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Get version information -->
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\custom.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Optional, defaults to main. Name of the branch which will be used for calculating branch point. -->
|
||||
<PGOBranch>release-1.12</PGOBranch>
|
||||
|
||||
<!-- Mandatory. Name of the NuGet package which will contain PGO databases for consumption by build system. -->
|
||||
<PGOPackageName>Microsoft.Internal.Windows.Terminal.PGODatabase</PGOPackageName>
|
||||
|
||||
<!-- Mandatory. Major version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionMajor>$(VersionMajor)</PGOPackageVersionMajor>
|
||||
|
||||
<!-- Mandatory. Minor version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionMinor>$(VersionMinor)</PGOPackageVersionMinor>
|
||||
|
||||
<!-- Mandatory, defaults to 0. Patch version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionPatch>0</PGOPackageVersionPatch>
|
||||
|
||||
<!-- Optional, defaults to empty. Prerelease version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionPrerelease></PGOPackageVersionPrerelease>
|
||||
|
||||
<!-- Mandatory. Path to nuget.config file for the project. Path is relative to where the props file will be. -->
|
||||
<PGONuGetConfigPath>$(MSBuildThisFileDirectory)..\..\nuget.config</PGONuGetConfigPath>
|
||||
|
||||
<!-- Mandatory. Path to PGO database NuSpec, see section below. -->
|
||||
<PGONuspecPath>$(MSBuildThisFileDirectory)Terminal.PGO.DB.nuspec</PGONuspecPath>
|
||||
|
||||
<!-- Optional, defaults to true. Should verification result in build failure or error? -->
|
||||
<PGOVerifyFailureTreatedAsError>true</PGOVerifyFailureTreatedAsError>
|
||||
|
||||
<!-- Optional, defaults to $(IntDir)\Nuspec. Temporary path where PGD files are copied to. -->
|
||||
<PGONuspecBasePath>$(PGDPathForAllArch)</PGONuspecBasePath>
|
||||
|
||||
<!-- Optional, defaults to true. Specifies whether to use default information for PGD files. -->
|
||||
<PGOUseDefaultPGDFileInfo>true</PGOUseDefaultPGDFileInfo>
|
||||
|
||||
<!-- Copying the PGO runtime brings along a CRT. If we do that under normal circumstances, WAPPROJ will get its grubby hands on it and mess up all the CRT shenanigans we have to pull to make MSIX packages happy. So only pull it in for Instrument builds.-->
|
||||
<PGOCopyRuntime>false</PGOCopyRuntime>
|
||||
<PGOCopyRuntime Condition="'$(PGOBuildMode)' == 'Instrument'">true</PGOCopyRuntime>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Import PGO-Helpers -->
|
||||
<Import Project="$(PkgMicrosoft_PGO_Helpers_Cpp)\build\Microsoft.PGO-Helpers.Cpp.props" />
|
||||
</Project>
|
||||
@@ -18,6 +18,10 @@ parameters:
|
||||
displayName: "Build Windows Terminal MSIX"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: runCompliance
|
||||
displayName: "Run Compliance and Security Build"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildTerminalVPack
|
||||
displayName: "Build Windows Terminal VPack"
|
||||
type: boolean
|
||||
@@ -34,7 +38,6 @@ parameters:
|
||||
- Optimize
|
||||
- Instrument
|
||||
- None
|
||||
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
default:
|
||||
@@ -65,6 +68,7 @@ jobs:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
displayName: Build
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
steps:
|
||||
- checkout: self
|
||||
@@ -89,6 +93,17 @@ jobs:
|
||||
displayName: Use NuGet 5.10
|
||||
inputs:
|
||||
versionSpec: 5.10
|
||||
- task: NuGetAuthenticate@0
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
- task: NuGetCommand@2
|
||||
displayName: NuGet custom
|
||||
inputs:
|
||||
@@ -96,6 +111,8 @@ jobs:
|
||||
selectOrConfig: config
|
||||
nugetConfigPath: NuGet.Config
|
||||
arguments: restore OpenConsole.sln -SolutionDirectory $(Build.SourcesDirectory)
|
||||
# Pull the Windows SDK for the developer tools like the debuggers so we can index sources later
|
||||
- template: .\templates\install-winsdk-steps.yml
|
||||
- task: UniversalPackages@0
|
||||
displayName: Download terminal-internal Universal Package
|
||||
inputs:
|
||||
@@ -111,6 +128,8 @@ jobs:
|
||||
resourceFilePath: >-
|
||||
src\cascadia\TerminalApp\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalApp\Resources\en-US\ContextMenu.resw
|
||||
|
||||
src\cascadia\TerminalControl\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalConnection\Resources\en-US\Resources.resw
|
||||
@@ -119,8 +138,6 @@ jobs:
|
||||
|
||||
src\cascadia\TerminalSettingsEditor\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\WindowsTerminalUniversal\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\CascadiaPackage\Resources\en-US\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
@@ -140,19 +157,14 @@ jobs:
|
||||
filePath: .\build\scripts\Generate-ThirdPartyNotices.ps1
|
||||
arguments: -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html
|
||||
pwsh: true
|
||||
- ${{ if eq(parameters.pgoBuildMode, 'Optimize') }}:
|
||||
- task: PowerShell@2
|
||||
displayName: Restore PGO Database
|
||||
inputs:
|
||||
filePath: tools/PGODatabase/restore-pgodb.ps1
|
||||
workingDirectory: $(Build.SourcesDirectory)\tools\PGODatabase
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln
|
||||
condition: true
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
vsVersion: 16.0
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage;Terminal\WindowsTerminalUniversal /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -164,20 +176,6 @@ jobs:
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
||||
ArtifactName: binlog-$(BuildPlatform)
|
||||
- ${{ if eq(parameters.pgoBuildMode, 'Optimize') }}:
|
||||
- task: PowerShell@2
|
||||
displayName: Validate binaries are optimized
|
||||
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64'))
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Binaries = 'OpenConsole.exe', 'WindowsTerminal.exe', 'TerminalApp.dll', 'TerminalConnection.dll', 'Microsoft.Terminal.Control.dll', 'Microsoft.Terminal.Remoting.dll', 'Microsoft.Terminal.Settings.Editor.dll', 'Microsoft.Terminal.Settings.Model.dll'
|
||||
|
||||
foreach ($BinFile in $Binaries) {
|
||||
|
||||
& "$(Build.SourcesDirectory)\tools\PGODatabase\verify-pgo.ps1" "$(Build.SourcesDirectory)/src/cascadia/CascadiaPackage/bin/$(BuildPlatform)/$(BuildConfiguration)/$BinFile"
|
||||
|
||||
}
|
||||
- task: PowerShell@2
|
||||
displayName: Check MSIX for common regressions
|
||||
inputs:
|
||||
@@ -203,8 +201,6 @@ jobs:
|
||||
filePath: build\scripts\Index-Pdbs.ps1
|
||||
arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
errorActionPreference: silentlyContinue
|
||||
- task: ComponentGovernanceComponentDetection@0
|
||||
displayName: Component Detection
|
||||
- task: PowerShell@2
|
||||
displayName: Run Unit Tests
|
||||
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||
@@ -234,6 +230,10 @@ jobs:
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/appx
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (appx)
|
||||
inputs:
|
||||
@@ -257,14 +257,21 @@ jobs:
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/wpf
|
||||
ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)
|
||||
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish symbols path
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SearchPattern: '**/*.pdb'
|
||||
SearchPattern: |
|
||||
$(Build.SourcesDirectory)/bin/**/*.pdb
|
||||
$(Build.SourcesDirectory)/bin/**/*.exe
|
||||
$(Build.SourcesDirectory)/bin/**/*.dll
|
||||
IndexSources: false
|
||||
SymbolServerType: TeamServices
|
||||
|
||||
- ${{ if eq(parameters.runCompliance, true) }}:
|
||||
- template: ./templates/build-console-compliance-job.yml
|
||||
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- job: BundleAndSign
|
||||
displayName: Create and sign AppX/MSIX bundles
|
||||
@@ -279,24 +286,22 @@ jobs:
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Artifacts (*.appx, *.msix)
|
||||
displayName: Download Artifacts (*.appx, *.msix, *.appxsym)
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: >-
|
||||
**/*.msix
|
||||
|
||||
**/*.appx
|
||||
|
||||
**/*.appxsym
|
||||
extractTars: false
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Create WindowsTerminal*.msixbundle
|
||||
inputs:
|
||||
filePath: build\scripts\Create-AppxBundle.ps1
|
||||
arguments: -InputPath "$(System.ArtifactsDirectory)" -ProjectName CascadiaPackage -BundleVersion 0.0.0.0 -OutputPath "$(System.ArtifactsDirectory)\Microsoft.WindowsTerminal_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
- task: PowerShell@2
|
||||
displayName: Create WindowsTerminalUniversal*.msixbundle
|
||||
inputs:
|
||||
filePath: build\scripts\Create-AppxBundle.ps1
|
||||
arguments: -InputPath "$(System.ArtifactsDirectory)" -ProjectName WindowsTerminalUniversal -BundleVersion $(XES_APPXMANIFESTVERSION) -OutputPath "$(System.ArtifactsDirectory)\Microsoft.WindowsTerminalUniversal_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.msixbundle to ESRP for code signing
|
||||
inputs:
|
||||
@@ -331,6 +336,43 @@ jobs:
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
# It seems easier to do this -- download every appxsym -- then enumerate all the PDBs in the build directory for the
|
||||
# public symbol push. Otherwise, we would have to list all of the PDB files one by one.
|
||||
- pwsh: |-
|
||||
mkdir $(Build.SourcesDirectory)/appxsym-temp
|
||||
Get-ChildItem "$(System.ArtifactsDirectory)" -Filter *.appxsym -Recurse | % {
|
||||
$src = $_.FullName
|
||||
$dest = Join-Path "$(Build.SourcesDirectory)/appxsym-temp/" $_.Name
|
||||
|
||||
mkdir $dest
|
||||
Write-Host "Extracting $src to $dest..."
|
||||
tar -x -v -f $src -C $dest
|
||||
}
|
||||
displayName: Extract symbols for public consumption
|
||||
|
||||
# Publish the app symbols to the public MSDL symbol server
|
||||
# accessible via https://msdl.microsoft.com/download/symbols
|
||||
- task: PublishSymbols@2
|
||||
displayName: 'Publish app symbols to MSDL'
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.SourcesDirectory)/appxsym-temp'
|
||||
searchPattern: '**/*.pdb'
|
||||
SymbolsMaximumWaitTime: 30
|
||||
SymbolServerType: 'TeamServices'
|
||||
SymbolsProduct: 'Windows Terminal Application Binaries'
|
||||
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
||||
# The ADO task does not support indexing of GitHub sources.
|
||||
indexSources: false
|
||||
detailedLog: true
|
||||
# There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
|
||||
# To work around this issue, we just force LIB to be any dir that we know exists.
|
||||
# Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
|
||||
env:
|
||||
LIB: $(Build.SourcesDirectory)
|
||||
ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
|
||||
ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: appxbundle-signed'
|
||||
inputs:
|
||||
@@ -402,7 +444,10 @@ jobs:
|
||||
displayName: Publish symbols path
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SearchPattern: '**/*.pdb'
|
||||
SearchPattern: |
|
||||
$(Build.SourcesDirectory)/bin/**/*.pdb
|
||||
$(Build.SourcesDirectory)/bin/**/*.exe
|
||||
$(Build.SourcesDirectory)/bin/**/*.dll
|
||||
IndexSources: false
|
||||
SymbolServerType: TeamServices
|
||||
SymbolsArtifactName: Symbols_WPF_$(BuildConfiguration)
|
||||
|
||||
@@ -25,6 +25,17 @@ jobs:
|
||||
inputs:
|
||||
versionSpec: 4.8.1
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
|
||||
222
build/pipelines/templates/build-console-compliance-job.yml
Normal file
222
build/pipelines/templates/build-console-compliance-job.yml
Normal file
@@ -0,0 +1,222 @@
|
||||
jobs:
|
||||
- job: Compliance
|
||||
# We don't *need* a matrix but there's no other way to set parameters on a "job"
|
||||
# in the AzDO YAML syntax. It would have to be a "stage" or a "template".
|
||||
# Doesn't matter. We're going to do compliance on Release x64 because
|
||||
# that's the one all the tooling works against for sure.
|
||||
strategy:
|
||||
matrix:
|
||||
Release_x64:
|
||||
BuildConfiguration: Release
|
||||
BuildPlatform: x64
|
||||
displayName: Validate Security and Compliance
|
||||
timeoutInMinutes: 240
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- task: PowerShell@2
|
||||
displayName: Rationalize Build Platform
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Arch = "$(BuildPlatform)"
|
||||
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 5.10
|
||||
inputs:
|
||||
versionSpec: 5.10
|
||||
- task: NuGetAuthenticate@0
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
- task: NuGetCommand@2
|
||||
displayName: NuGet custom
|
||||
inputs:
|
||||
command: custom
|
||||
selectOrConfig: config
|
||||
nugetConfigPath: NuGet.Config
|
||||
arguments: restore OpenConsole.sln -SolutionDirectory $(Build.SourcesDirectory)
|
||||
- task: UniversalPackages@0
|
||||
displayName: Download terminal-internal Universal Package
|
||||
inputs:
|
||||
feedListDownload: 2b3f8893-a6e8-411f-b197-a9e05576da48
|
||||
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
|
||||
versionListDownload: $(TerminalInternalPackageVersion)
|
||||
- task: TouchdownBuildTask@1
|
||||
displayName: Download Localization Files
|
||||
inputs:
|
||||
teamId: 7105
|
||||
authId: $(TouchdownAppId)
|
||||
authKey: $(TouchdownAppKey)
|
||||
resourceFilePath: >-
|
||||
src\cascadia\TerminalApp\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalControl\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalConnection\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsModel\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsEditor\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\CascadiaPackage\Resources\en-US\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
pseudoSetting: Included
|
||||
- task: PowerShell@2
|
||||
displayName: Move Loc files one level up
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
|
||||
|
||||
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
||||
pwsh: true
|
||||
|
||||
# 1ES Component Governance onboarding (Detects open source components). See https://docs.opensource.microsoft.com/tools/cg.html
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: Component Detection
|
||||
|
||||
# # PREfast and PoliCheck need Node. Install that first.
|
||||
- task: NodeTool@0
|
||||
|
||||
# !!! NOTE !!! Run PREfast first. Some of the other tasks are going to run on a completed build.
|
||||
# PREfast is going to build the code as a part of its analysis and the generated sources
|
||||
# and output binaries will be sufficient for the rest of the analysis.
|
||||
# If you disable this, the other tasks won't likely work. You would have to add a build
|
||||
# step instead that builds the code normally before calling them.
|
||||
# Also... PREfast will rebuild anyway so that's why we're not running a normal build first.
|
||||
# Waste of time to build twice.
|
||||
# PREfast. See https://www.1eswiki.com/wiki/SDL_Native_Rules_Build_Task
|
||||
|
||||
# The following 1ES tasks all operate completely differently and have a different syntax for usage.
|
||||
# Most notable is every one of them has a different way of excluding things.
|
||||
# Go see their 1eswiki.com pages to figure out how to exclude things.
|
||||
# When writing exclusions, try to make them narrow so when new projects/binaries are added, they
|
||||
# cause an error here and have to be explicitly pulled out. Don't write an exclusion so broad
|
||||
# that it will catch other new stuff.
|
||||
|
||||
# https://www.1eswiki.com/wiki/PREfast_Build_Task
|
||||
# Builds the project with C/C++ static analysis tools to find coding flaws and vulnerabilities
|
||||
# !!! WARNING !!! It doesn't work with WAPPROJ packaging projects. Build the sub-projects instead.
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-prefast.SDLNativeRules@3
|
||||
displayName: 'Run the PREfast SDL Native Rules for MSBuild'
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
msBuildCommandline: msbuild.exe /nologo /m /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }} /p:WindowsTerminalReleaseBuild=true /p:platform=$(BuildPlatform) /p:configuration=$(BuildConfiguration) /t:Terminal\Window\WindowsTerminal /p:VisualStudioVersion=16.0 $(Build.SourcesDirectory)\OpenConsole.sln
|
||||
|
||||
# Copies output from PREfast SDL Native Rules task to expected location for consumption by PkgESSecComp
|
||||
- task: CopyFiles@1
|
||||
displayName: 'Copy PREfast xml files to SDLNativeRulesDir'
|
||||
inputs:
|
||||
SourceFolder: '$(Agent.BuildDirectory)'
|
||||
Contents: |
|
||||
**\*.nativecodeanalysis.xml
|
||||
TargetFolder: '$(Agent.BuildDirectory)\_sdt\logs\SDLNativeRules'
|
||||
|
||||
# https://www.1eswiki.com/index.php?title=PoliCheck_Build_Task
|
||||
# Scans the text of source code, comments, and content for terminology that could be sensitive for legal, cultural, or geopolitical reasons.
|
||||
# (Also finds vulgarities... takes all the fun out of everything.)
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
|
||||
displayName: 'Run PoliCheck'
|
||||
inputs:
|
||||
targetType: F
|
||||
targetArgument: $(Build.SourcesDirectory)
|
||||
result: PoliCheck.xml
|
||||
optionsFC: 1
|
||||
optionsXS: 1
|
||||
optionsUEPath: $(Build.SourcesDirectory)\build\config\PolicheckExclusions.xml
|
||||
optionsHMENABLE: 0
|
||||
continueOnError: true
|
||||
|
||||
# https://www.1eswiki.com/wiki/CredScan_Azure_DevOps_Build_Task
|
||||
# Searches through source code and build outputs for a credential left behind in the open
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
|
||||
displayName: 'Run CredScan'
|
||||
inputs:
|
||||
outputFormat: pre
|
||||
# suppressionsFile: LocalSuppressions.json
|
||||
batchSize: 20
|
||||
debugMode: false
|
||||
continueOnError: true
|
||||
|
||||
# https://www.1eswiki.com/wiki/BinSkim_Build_Task
|
||||
# Searches managed and unmanaged binaries for known security vulnerabilities.
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
|
||||
displayName: 'Run BinSkim'
|
||||
inputs:
|
||||
TargetPattern: guardianGlob
|
||||
# See https://aka.ms/gdn-globs for how to do match patterns
|
||||
AnalyzeTargetGlob: $(Build.SourcesDirectory)\bin\**\*.dll;$(Build.SourcesDirectory)\bin\**\*.exe;-:file|**\Microsoft.UI.Xaml.dll;-:file|**\Microsoft.Toolkit.Win32.UI.XamlHost.dll;-:file|**\vcruntime*.dll;-:file|**\vcomp*.dll;-:file|**\vccorlib*.dll;-:file|**\vcamp*.dll;-:file|**\msvcp*.dll;-:file|**\concrt*.dll;-:file|**\TerminalThemeHelpers*.dll;-:file|**\cpprest*.dll
|
||||
continueOnError: true
|
||||
|
||||
# Set XES_SERIALPOSTBUILDREADY to run Security and Compliance task once per build
|
||||
- powershell: Write-Host “##vso[task.setvariable variable=XES_SERIALPOSTBUILDREADY;]true”
|
||||
displayName: 'Set XES_SERIALPOSTBUILDREADY Vars'
|
||||
|
||||
# https://www.osgwiki.com/wiki/Package_ES_Security_and_Compliance
|
||||
# Does a few things:
|
||||
# - Ensures that Windows-required compliance tasks are run either inside this task
|
||||
# or were run as a previous step prior to this one
|
||||
# (PREfast, PoliCheck, Credscan)
|
||||
# - Runs Windows-specific compliance tasks inside the task
|
||||
# + CheckCFlags - ensures that compiler and linker flags meet Windows standards
|
||||
# + CFGCheck/XFGCheck - ensures that Control Flow Guard (CFG) or
|
||||
# eXtended Flow Guard (XFG) are enabled on binaries
|
||||
# NOTE: CFG is deprecated and XFG isn't fully ready yet.
|
||||
# NOTE2: CFG fails on an XFG'd binary
|
||||
# - Brokers all security/compliance task logs to "Trust Services Automation (TSA)" (https://aka.ms/tsa)
|
||||
# which is a system that maps all errors into the appropriate bug database
|
||||
# template for each organization since they all vary. It should also suppress
|
||||
# new bugs when one already exists for the product.
|
||||
# This one is set up to go to the OS repository and use the given parameters
|
||||
# to file bugs to our AzDO product path.
|
||||
# If we don't use PkgESSecComp to do this for us, we need to install the TSA task
|
||||
# ourselves in this pipeline to finalize data upload and bug creation.
|
||||
# !!! NOTE !!! This task goes *LAST* after any other compliance tasks so it catches their logs
|
||||
- task: PkgESSecComp@10
|
||||
displayName: 'Security and Compliance tasks'
|
||||
inputs:
|
||||
fileNewBugs: false
|
||||
areaPath: 'OS\WDX\DXP\WinDev\Terminal'
|
||||
teamProject: 'OS'
|
||||
iterationPath: 'OS\Future'
|
||||
bugTags: 'TerminalReleaseCompliance'
|
||||
scanAll: true
|
||||
errOnBugs: false
|
||||
failOnStdErr: true
|
||||
taskLogVerbosity: Diagnostic
|
||||
secCompConfigFromTask: |
|
||||
# Overrides default build sources directory
|
||||
sourceTargetOverrideAll: $(Build.SourcesDirectory)
|
||||
# Overrides default build binaries directory when "Scan all" option is specified
|
||||
binariesTargetOverrideAll: $(Build.SourcesDirectory)\bin
|
||||
|
||||
# Set the tools to false if they should not run in the build
|
||||
tools:
|
||||
- toolName: CheckCFlags
|
||||
enable: true
|
||||
- toolName: CFGCheck
|
||||
enable: true
|
||||
- toolName: Policheck
|
||||
enable: false
|
||||
- toolName: CredScan
|
||||
enable: false
|
||||
- toolName: XFGCheck
|
||||
enable: false
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
steps:
|
||||
- template: build-console-steps.yml
|
||||
parameters:
|
||||
additionalBuildArguments: ${{ parameters.additionalBuildArguments }}
|
||||
additionalBuildArguments: '${{ parameters.additionalBuildArguments }}'
|
||||
|
||||
- template: helix-runtests-job.yml
|
||||
parameters:
|
||||
@@ -52,3 +52,4 @@ jobs:
|
||||
- ProcessTestResults
|
||||
pgoArtifact: 'PGO'
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
|
||||
@@ -12,17 +12,10 @@ steps:
|
||||
inputs:
|
||||
versionSpec: 5.2.0
|
||||
|
||||
- task: NuGetAuthenticate@0
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for solution
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: OpenConsole.sln
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
@@ -32,6 +25,15 @@ steps:
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for solution
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: OpenConsole.sln
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
@@ -47,14 +49,6 @@ steps:
|
||||
inputs:
|
||||
filename: 'set'
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'Restore PGO database'
|
||||
condition: eq(variables['PGOBuildMode'], 'Optimize')
|
||||
inputs:
|
||||
targetType: filePath
|
||||
workingDirectory: $(Build.SourcesDirectory)\tools\PGODatabase
|
||||
filePath: $(Build.SourcesDirectory)\tools\PGODatabase\restore-pgodb.ps1
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\OpenConsole.sln'
|
||||
inputs:
|
||||
@@ -62,7 +56,7 @@ steps:
|
||||
vsVersion: 16.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
||||
msbuildArgs: "${{ parameters.additionalBuildArguments }} /p:PGOBuildMode=$(PGOBuildMode) /bl:$(Build.SourcesDirectory)\\msbuild.binlog"
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
@@ -95,18 +89,6 @@ steps:
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Validate binaries are optimized'
|
||||
condition: eq(variables['pgoBuildMode'], 'Optimize')
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Binaries = 'OpenConsole.exe', 'WindowsTerminal.exe', 'TerminalApp.dll', 'TerminalConnection.dll', 'Microsoft.Terminal.Control.dll', 'Microsoft.Terminal.Remoting.dll', 'Microsoft.Terminal.Settings.Editor.dll', 'Microsoft.Terminal.Settings.Model.dll'
|
||||
foreach ($BinFile in $Binaries)
|
||||
{
|
||||
& "$(Build.SourcesDirectory)\tools\PGODatabase\verify-pgo.ps1" "$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/$BinFile"
|
||||
}
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run Unit Tests'
|
||||
inputs:
|
||||
@@ -211,3 +193,11 @@ steps:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/PGO'
|
||||
ArtifactName: 'PGO'
|
||||
condition: and(succeeded(), eq(variables['PGOBuildMode'], 'Instrument'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: binlog'
|
||||
condition: failed()
|
||||
continueOnError: True
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
||||
ArtifactName: binlog-$(BuildPlatform)
|
||||
|
||||
@@ -14,8 +14,8 @@ parameters:
|
||||
platform: ''
|
||||
# if 'useBuildOutputFromBuildId' is set, we will default to using a build from this pipeline:
|
||||
useBuildOutputFromPipeline: $(System.DefinitionId)
|
||||
openHelixTargetQueues: 'windows.10.amd64.client19h1.open.xaml'
|
||||
closedHelixTargetQueues: 'windows.10.amd64.client19h1.xaml'
|
||||
openHelixTargetQueues: 'windows.10.amd64.client21h1.open.xaml'
|
||||
closedHelixTargetQueues: 'windows.10.amd64.client21h1.xaml'
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
|
||||
9
build/pipelines/templates/install-winsdk-steps.yml
Normal file
9
build/pipelines/templates/install-winsdk-steps.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
parameters:
|
||||
sdkVersion: 18362
|
||||
steps:
|
||||
- task: powershell@2
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Install-WindowsSdkISO.ps1
|
||||
arguments: ${{ parameters.sdkVersion }}
|
||||
displayName: 'Install Windows SDK (${{ parameters.sdkVersion }})'
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
artifactsPath: $(Build.SourcesDirectory)\Artifacts
|
||||
pgoToolsPath: $(Build.SourcesDirectory)\tools\PGODatabase
|
||||
pgoToolsPath: $(Build.SourcesDirectory)\build\PGO
|
||||
nuspecPath: $(pgoToolsPath)\NuSpecs
|
||||
nuspecFilename: PGO.nuspec
|
||||
|
||||
@@ -30,28 +30,22 @@ jobs:
|
||||
inputs:
|
||||
versionSpec: 5.8.0
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy pgd files to NuGet build directory'
|
||||
inputs:
|
||||
sourceFolder: $(artifactsPath)\${{ parameters.pgoArtifact }}
|
||||
contents: '**\*.pgd'
|
||||
targetFolder: $(nuspecPath)\tools
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'Generate NuSpec file'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: $(pgoToolsPath)\generate-nuspec.ps1
|
||||
workingDirectory: $(pgoToolsPath)
|
||||
arguments: $(nuspecPath)\$(nuspecFilename).template $(nuspecPath)\$(nuspecFilename)
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: 'NuGet pack'
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: '$(nuspecPath)\$(nuspecFilename)'
|
||||
basePath: '$(nuspecPath)'
|
||||
packDestination: '$(Build.ArtifactStagingDirectory)'
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Create PGO Nuget'
|
||||
inputs:
|
||||
solution: $(pgoToolsPath)\PGO.DB.proj
|
||||
msbuildArguments: '/t:CreatePGONuGet /p:PGOBuildMode=Instrument /p:PGDPathForAllArch=$(artifactsPath)\${{ parameters.pgoArtifact }} /p:PGOOutputPath=$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
@@ -69,4 +63,4 @@ jobs:
|
||||
# This is the name of that connection
|
||||
publishFeedCredentials: 'Terminal Public Artifact Feed'
|
||||
feedsToUse: config
|
||||
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
|
||||
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
|
||||
|
||||
@@ -2,6 +2,7 @@ parameters:
|
||||
dependsOn: ''
|
||||
pgoArtifact: PGO
|
||||
platform: ''
|
||||
configuration: ''
|
||||
|
||||
jobs:
|
||||
- job: MergePGD
|
||||
@@ -12,6 +13,7 @@ jobs:
|
||||
artifactsPath: $(Build.SourcesDirectory)\Artifacts
|
||||
pgoArtifactsPath: $(artifactsPath)\${{ parameters.pgoArtifact }}
|
||||
buildPlatform: ${{ parameters.platform }}
|
||||
buildConfiguration: ${{ parameters.configuration }}
|
||||
|
||||
steps:
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
@@ -24,58 +26,36 @@ jobs:
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 5.2.0'
|
||||
inputs:
|
||||
versionSpec: 5.2.0
|
||||
|
||||
- task: NuGetAuthenticate@0
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
downloadPath: $(artifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge WindowsTerminal*.pgc WindowsTerminal.pgd
|
||||
displayName: 'Merge Terminal pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge OpenConsole*.pgc OpenConsole.pgd
|
||||
displayName: 'Merge OpenConsole pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge Microsoft.Terminal.Control*.pgc Microsoft.Terminal.Control.pgd
|
||||
displayName: 'Merge Microsoft.Terminal.Control pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge Microsoft.Terminal.Remoting*.pgc Microsoft.Terminal.Remoting.pgd
|
||||
displayName: 'Merge Microsoft.Terminal.Remoting pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge Microsoft.Terminal.Settings.Editor*.pgc Microsoft.Terminal.Settings.Editor.pgd
|
||||
displayName: 'Merge Microsoft.Terminal.Settings.Editor pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge Microsoft.Terminal.Settings.Model*.pgc Microsoft.Terminal.Settings.Model.pgd
|
||||
displayName: 'Merge Microsoft.Terminal.Settings.Model pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge TerminalApp*.pgc TerminalApp.pgd
|
||||
displayName: 'Merge TerminalApp pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
|
||||
- script: |
|
||||
cd $(buildPlatform)
|
||||
"%VCToolsInstallDir%\bin\hostx64\x64\pgomgr.exe" /merge TerminalConnection*.pgc TerminalConnection.pgd
|
||||
displayName: 'Merge TerminalConnection pgc files into pgd'
|
||||
workingDirectory: $(pgoArtifactsPath)
|
||||
- task: MSBuild@1
|
||||
displayName: Merge counts into PGD
|
||||
inputs:
|
||||
solution: $(Build.SourcesDirectory)\OpenConsole.sln
|
||||
platform: $(buildPlatform)
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: '/t:MergePGOCounts /p:PGOBuildMode=Instrument /p:PGDPath=$(pgoArtifactsPath)\$(buildPlatform) /p:PGCRootPath=$(pgoArtifactsPath)\$(buildPlatform)'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy merged pgd to artifact staging'
|
||||
@@ -87,4 +67,4 @@ jobs:
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathToPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
|
||||
@@ -23,6 +23,7 @@ $mappedFiles = New-Object System.Collections.ArrayList
|
||||
|
||||
foreach ($file in (Get-ChildItem -r:$recursive "$SearchDir\*.pdb"))
|
||||
{
|
||||
$mappedFiles = New-Object System.Collections.ArrayList
|
||||
Write-Verbose "Found $file"
|
||||
|
||||
$ErrorActionPreference = "Continue" # Azure Pipelines defaults to "Stop", continue past errors in this script.
|
||||
@@ -50,7 +51,7 @@ foreach ($file in (Get-ChildItem -r:$recursive "$SearchDir\*.pdb"))
|
||||
if ($relative)
|
||||
{
|
||||
$mapping = $allFiles[$i] + "*$relative"
|
||||
$mappedFiles.Add($mapping)
|
||||
$ignore = $mappedFiles.Add($mapping)
|
||||
|
||||
Write-Verbose "Mapped path $($i): $mapping"
|
||||
}
|
||||
@@ -78,7 +79,26 @@ $($mappedFiles -join "`r`n")
|
||||
SRCSRV: end ------------------------------------------------
|
||||
"@ | Set-Content $pdbstrFile
|
||||
|
||||
Write-Host
|
||||
Write-Host
|
||||
Write-Host (Get-Content $pdbstrFile)
|
||||
Write-Host
|
||||
Write-Host
|
||||
|
||||
Write-Host "$pdbstrExe -p:""$file"" -w -s:srcsrv -i:$pdbstrFile"
|
||||
& $pdbstrExe -p:"$file" -w -s:srcsrv -i:$pdbstrFile
|
||||
Write-Host
|
||||
Write-Host
|
||||
|
||||
Write-Host "$pdbstrExe -p:""$file"" -r -s:srcsrv"
|
||||
& $pdbstrExe -p:"$file" -r -s:srcsrv
|
||||
Write-Host
|
||||
Write-Host
|
||||
|
||||
Write-Host "$srctoolExe $file"
|
||||
& $srctoolExe "$file"
|
||||
Write-Host
|
||||
Write-Host
|
||||
}
|
||||
|
||||
# Return with exit 0 to override any weird error code from other tools
|
||||
|
||||
346
build/scripts/Install-WindowsSdkISO.ps1
Normal file
346
build/scripts/Install-WindowsSdkISO.ps1
Normal file
@@ -0,0 +1,346 @@
|
||||
[CmdletBinding()]
|
||||
param([Parameter(Mandatory=$true, Position=0)]
|
||||
[string]$buildNumber)
|
||||
|
||||
# Ensure the error action preference is set to the default for PowerShell3, 'Stop'
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Constants
|
||||
$WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionId.DesktopCPPARM64", "OptionId.DesktopCPPARM", "OptionId.WindowsDesktopDebuggers")
|
||||
$WindowsSDKRegPath = "HKLM:\Software\WOW6432Node\Microsoft\Windows Kits\Installed Roots"
|
||||
$WindowsSDKRegRootKey = "KitsRoot10"
|
||||
$WindowsSDKVersion = "10.0.$buildNumber.0"
|
||||
$WindowsSDKInstalledRegPath = "$WindowsSDKRegPath\$WindowsSDKVersion\Installed Options"
|
||||
$StrongNameRegPath = "HKLM:\SOFTWARE\Microsoft\StrongName\Verification"
|
||||
$PublicKeyTokens = @("31bf3856ad364e35")
|
||||
|
||||
if ($buildNumber -notmatch "^\d{5,}$")
|
||||
{
|
||||
Write-Host "ERROR: '$buildNumber' doesn't look like a windows build number"
|
||||
Write-Host
|
||||
Exit 1
|
||||
}
|
||||
|
||||
function Download-File
|
||||
{
|
||||
param ([string] $outDir,
|
||||
[string] $downloadUrl,
|
||||
[string] $downloadName)
|
||||
|
||||
$downloadPath = Join-Path $outDir "$downloadName.download"
|
||||
$downloadDest = Join-Path $outDir $downloadName
|
||||
$downloadDestTemp = Join-Path $outDir "$downloadName.tmp"
|
||||
|
||||
Write-Host -NoNewline "Downloading $downloadName..."
|
||||
|
||||
$retries = 10
|
||||
$downloaded = $false
|
||||
while (-not $downloaded)
|
||||
{
|
||||
try
|
||||
{
|
||||
$webclient = new-object System.Net.WebClient
|
||||
$webclient.DownloadFile($downloadUrl, $downloadPath)
|
||||
$downloaded = $true
|
||||
}
|
||||
catch [System.Net.WebException]
|
||||
{
|
||||
Write-Host
|
||||
Write-Warning "Failed to fetch updated file from $downloadUrl : $($error[0])"
|
||||
if (!(Test-Path $downloadDest))
|
||||
{
|
||||
if ($retries -gt 0)
|
||||
{
|
||||
Write-Host "$retries retries left, trying download again"
|
||||
$retries--
|
||||
start-sleep -Seconds 10
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "$downloadName was not found at $downloadDest"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Warning "$downloadName may be out of date"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Unblock-File $downloadPath
|
||||
|
||||
$downloadDestTemp = $downloadPath;
|
||||
|
||||
# Delete and rename to final dest
|
||||
Write-Host "testing $downloadDest"
|
||||
if (Test-Path $downloadDest)
|
||||
{
|
||||
Write-Host "Deleting: $downloadDest"
|
||||
Remove-Item $downloadDest -Force
|
||||
}
|
||||
|
||||
Move-Item -Force $downloadDestTemp $downloadDest
|
||||
Write-Host "Done"
|
||||
|
||||
return $downloadDest
|
||||
}
|
||||
|
||||
function Get-ISODriveLetter
|
||||
{
|
||||
param ([string] $isoPath)
|
||||
|
||||
$diskImage = Get-DiskImage -ImagePath $isoPath
|
||||
if ($diskImage)
|
||||
{
|
||||
$volume = Get-Volume -DiskImage $diskImage
|
||||
|
||||
if ($volume)
|
||||
{
|
||||
$driveLetter = $volume.DriveLetter
|
||||
if ($driveLetter)
|
||||
{
|
||||
$driveLetter += ":"
|
||||
return $driveLetter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $null
|
||||
}
|
||||
|
||||
function Mount-ISO
|
||||
{
|
||||
param ([string] $isoPath)
|
||||
|
||||
# Check if image is already mounted
|
||||
$isoDrive = Get-ISODriveLetter $isoPath
|
||||
|
||||
if (!$isoDrive)
|
||||
{
|
||||
Mount-DiskImage -ImagePath $isoPath -StorageType ISO | Out-Null
|
||||
}
|
||||
|
||||
$isoDrive = Get-ISODriveLetter $isoPath
|
||||
Write-Verbose "$isoPath mounted to ${isoDrive}:"
|
||||
}
|
||||
|
||||
function Dismount-ISO
|
||||
{
|
||||
param ([string] $isoPath)
|
||||
|
||||
$isoDrive = (Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter
|
||||
|
||||
if ($isoDrive)
|
||||
{
|
||||
Write-Verbose "$isoPath dismounted"
|
||||
Dismount-DiskImage -ImagePath $isoPath | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
function Disable-StrongName
|
||||
{
|
||||
param ([string] $publicKeyToken = "*")
|
||||
|
||||
reg ADD "HKLM\SOFTWARE\Microsoft\StrongName\Verification\*,$publicKeyToken" /f | Out-Null
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64")
|
||||
{
|
||||
reg ADD "HKLM\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,$publicKeyToken" /f | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
function Test-Admin
|
||||
{
|
||||
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$principal = New-Object Security.Principal.WindowsPrincipal $identity
|
||||
$principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||
}
|
||||
|
||||
function Test-RegistryPathAndValue
|
||||
{
|
||||
param (
|
||||
[parameter(Mandatory=$true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $path,
|
||||
[parameter(Mandatory=$true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $value)
|
||||
|
||||
try
|
||||
{
|
||||
if (Test-Path $path)
|
||||
{
|
||||
Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null
|
||||
return $true
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
function Test-InstallWindowsSDK
|
||||
{
|
||||
$retval = $true
|
||||
|
||||
if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey)
|
||||
{
|
||||
# A Windows SDK is installed
|
||||
# Is an SDK of our version installed with the options we need?
|
||||
$allRequiredSdkOptionsInstalled = $true
|
||||
foreach($sdkOption in $WindowsSDKOptions)
|
||||
{
|
||||
if (!(Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value $sdkOption))
|
||||
{
|
||||
$allRequiredSdkOptionsInstalled = $false
|
||||
}
|
||||
}
|
||||
|
||||
if($allRequiredSdkOptionsInstalled)
|
||||
{
|
||||
# It appears we have what we need. Double check the disk
|
||||
$sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey
|
||||
if ($sdkRoot)
|
||||
{
|
||||
if (Test-Path $sdkRoot)
|
||||
{
|
||||
$refPath = Join-Path $sdkRoot "References\$WindowsSDKVersion"
|
||||
if (Test-Path $refPath)
|
||||
{
|
||||
$umdPath = Join-Path $sdkRoot "UnionMetadata\$WindowsSDKVersion"
|
||||
if (Test-Path $umdPath)
|
||||
{
|
||||
# Pretty sure we have what we need
|
||||
$retval = $false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $retval
|
||||
}
|
||||
|
||||
function Test-InstallStrongNameHijack
|
||||
{
|
||||
foreach($publicKeyToken in $PublicKeyTokens)
|
||||
{
|
||||
$key = "$StrongNameRegPath\*,$publicKeyToken"
|
||||
if (!(Test-Path $key))
|
||||
{
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
Write-Host -NoNewline "Checking for installed Windows SDK $WindowsSDKVersion..."
|
||||
$InstallWindowsSDK = Test-InstallWindowsSDK
|
||||
if ($InstallWindowsSDK)
|
||||
{
|
||||
Write-Host "Installation required"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "INSTALLED"
|
||||
}
|
||||
|
||||
$StrongNameHijack = Test-InstallStrongNameHijack
|
||||
Write-Host -NoNewline "Checking if StrongName bypass required..."
|
||||
|
||||
if ($StrongNameHijack)
|
||||
{
|
||||
Write-Host "REQUIRED"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Done"
|
||||
}
|
||||
|
||||
if ($StrongNameHijack -or $InstallWindowsSDK)
|
||||
{
|
||||
if (!(Test-Admin))
|
||||
{
|
||||
Write-Host
|
||||
throw "ERROR: Elevation required"
|
||||
}
|
||||
}
|
||||
|
||||
if ($InstallWindowsSDK)
|
||||
{
|
||||
# Static(ish) link for Windows SDK
|
||||
# Note: there is a delay from Windows SDK announcements to availability via the static link
|
||||
$uri = "https://software-download.microsoft.com/download/sg/Windows_InsiderPreview_SDK_en-us_$($buildNumber)_1.iso";
|
||||
|
||||
if ($env:TEMP -eq $null)
|
||||
{
|
||||
$env:TEMP = Join-Path $env:SystemDrive 'temp'
|
||||
}
|
||||
|
||||
$winsdkTempDir = Join-Path (Join-Path $env:TEMP ([System.IO.Path]::GetRandomFileName())) "WindowsSDK"
|
||||
|
||||
if (![System.IO.Directory]::Exists($winsdkTempDir))
|
||||
{
|
||||
[void][System.IO.Directory]::CreateDirectory($winsdkTempDir)
|
||||
}
|
||||
|
||||
$file = "winsdk_$buildNumber.iso"
|
||||
|
||||
Write-Verbose "Getting WinSDK from $uri"
|
||||
$downloadFile = Download-File $winsdkTempDir $uri $file
|
||||
Write-Verbose "File is at $downloadFile"
|
||||
$downloadFileItem = Get-Item $downloadFile
|
||||
|
||||
# Check to make sure the file is at least 10 MB.
|
||||
if ($downloadFileItem.Length -lt 10*1024*1024)
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "ERROR: Downloaded file doesn't look large enough to be an ISO. The requested version may not be on microsoft.com yet."
|
||||
Write-Host
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# TODO Check if zip, exe, iso, etc.
|
||||
try
|
||||
{
|
||||
Write-Host -NoNewline "Mounting ISO $file..."
|
||||
Mount-ISO $downloadFile
|
||||
Write-Host "Done"
|
||||
|
||||
$isoDrive = Get-ISODriveLetter $downloadFile
|
||||
|
||||
if (Test-Path $isoDrive)
|
||||
{
|
||||
Write-Host -NoNewLine "Installing WinSDK..."
|
||||
|
||||
$setupPath = Join-Path "$isoDrive" "WinSDKSetup.exe"
|
||||
Start-Process -Wait $setupPath "/features $WindowsSDKOptions /q"
|
||||
Write-Host "Done"
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Could not find mounted ISO at ${isoDrive}"
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Write-Host -NoNewline "Dismounting ISO $file..."
|
||||
Dismount-ISO $downloadFile
|
||||
Write-Host "Done"
|
||||
}
|
||||
}
|
||||
|
||||
if ($StrongNameHijack)
|
||||
{
|
||||
Write-Host -NoNewline "Disabling StrongName for Windows SDK..."
|
||||
|
||||
foreach($key in $PublicKeyTokens)
|
||||
{
|
||||
Disable-StrongName $key
|
||||
}
|
||||
|
||||
Write-Host "Done"
|
||||
}
|
||||
@@ -188,10 +188,6 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"adjustIndistinguishableColors": {
|
||||
"description": "When set to true, we will (when necessary) adjust the foreground color to make it more visible, based on the background color.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"experimental.retroTerminalEffect": {
|
||||
"description": "When set to true, enable retro terminal effects when unfocused. This is an experimental feature, and its continued existence is not guaranteed.",
|
||||
"type": "boolean"
|
||||
@@ -1545,7 +1541,7 @@
|
||||
},
|
||||
"startOnUserLogin": {
|
||||
"default": false,
|
||||
"description": "When set to true, this enables the launch of Windows Terminal at startup. Setting this to false will disable the startup task entry. If the Windows Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.",
|
||||
"description": "When set to true, this enables the launch of Terminal at startup. Setting this to false will disable the startup task entry. If the Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"firstWindowPreference": {
|
||||
@@ -1983,10 +1979,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"adjustIndistinguishableColors": {
|
||||
"description": "When set to true, we will (when necessary) adjust the foreground color to make it more visible, based on the background color.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"scrollbarState": {
|
||||
"default": "visible",
|
||||
"description": "Defines the visibility of the scrollbar.",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,5 +8,5 @@ Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadi
|
||||
|
||||
### Fonts Included
|
||||
|
||||
* Cascadia Code, Cascadia Mono (2108.26)
|
||||
* from microsoft/cascadia-code@f91d08f703ee61cf4ae936b9700ca974de2748fe
|
||||
* Cascadia Code, Cascadia Mono (2111.01)
|
||||
* from microsoft/cascadia-code@de36d62e777d34d3bed92a7e23988e5d61e0ba02
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "../types/inc/utils.hpp"
|
||||
#include "../types/inc/convert.hpp"
|
||||
#include "../../types/inc/Utf16Parser.hpp"
|
||||
#include "../../types/inc/GlyphWidth.hpp"
|
||||
|
||||
#pragma hdrstop
|
||||
@@ -2585,16 +2586,17 @@ PointTree TextBuffer::GetPatterns(const size_t firstRow, const size_t lastRow) c
|
||||
// match and the previous match, so we use the size of the prefix
|
||||
// along with the size of the match to determine the locations
|
||||
size_t prefixSize = 0;
|
||||
|
||||
for (const auto ch : i->prefix().str())
|
||||
for (const std::vector<wchar_t> parsedGlyph : Utf16Parser::Parse(i->prefix().str()))
|
||||
{
|
||||
prefixSize += IsGlyphFullWidth(ch) ? 2 : 1;
|
||||
const std::wstring_view glyph{ parsedGlyph.data(), parsedGlyph.size() };
|
||||
prefixSize += IsGlyphFullWidth(glyph) ? 2 : 1;
|
||||
}
|
||||
const auto start = lenUpToThis + prefixSize;
|
||||
size_t matchSize = 0;
|
||||
for (const auto ch : i->str())
|
||||
for (const std::vector<wchar_t> parsedGlyph : Utf16Parser::Parse(i->str()))
|
||||
{
|
||||
matchSize += IsGlyphFullWidth(ch) ? 2 : 1;
|
||||
const std::wstring_view glyph{ parsedGlyph.data(), parsedGlyph.size() };
|
||||
matchSize += IsGlyphFullWidth(glyph) ? 2 : 1;
|
||||
}
|
||||
const auto end = start + matchSize;
|
||||
lenUpToThis = end;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
Version="0.0.1.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Windows Terminal Dev</DisplayName>
|
||||
<DisplayName>ms-resource:TerminalApp/ContextMenu/AppStoreNameDev</DisplayName>
|
||||
<PublisherDisplayName>A Lone Developer</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -30,7 +30,7 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
<Resource Language="EN-US" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -38,8 +38,8 @@
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="ms-resource:AppNameDev"
|
||||
Description="ms-resource:AppDescriptionDev"
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppNameDev"
|
||||
Description="ms-resource:TerminalApp/ContextMenu/AppDescriptionDev"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Images\Square150x150Logo.png"
|
||||
Square44x44Logo="Images\Square44x44Logo.png">
|
||||
@@ -47,7 +47,7 @@
|
||||
Wide310x150Logo="Images\Wide310x150Logo.png"
|
||||
Square71x71Logo="Images\SmallTile.png"
|
||||
Square310x310Logo="Images\LargeTile.png"
|
||||
ShortName="ms-resource:AppShortNameDev">
|
||||
ShortName="ms-resource:TerminalApp/ContextMenu/AppShortNameDev">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo"/>
|
||||
<uap:ShowOn Tile="wide310x150Logo"/>
|
||||
@@ -66,7 +66,7 @@
|
||||
<uap5:StartupTask
|
||||
TaskId="StartTerminalOnLoginTask"
|
||||
Enabled="false"
|
||||
DisplayName="ms-resource:AppNameDev" />
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppNameDev" />
|
||||
</uap5:Extension>
|
||||
<uap3:Extension Category="windows.appExtensionHost">
|
||||
<uap3:AppExtensionHost>
|
||||
@@ -87,7 +87,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal-Dev"
|
||||
DisplayName="Windows Terminal Dev"
|
||||
DisplayName="Terminal Dev"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Version="0.5.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Windows Terminal Preview</DisplayName>
|
||||
<DisplayName>ms-resource:TerminalApp/ContextMenu/AppStoreNamePre</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -31,7 +31,95 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
<Resource Language="EN-US" />
|
||||
<Resource Language="EN-GB" />
|
||||
<Resource Language="AF-ZA" />
|
||||
<Resource Language="AM-ET" />
|
||||
<Resource Language="AR-SA" />
|
||||
<Resource Language="AS-IN" />
|
||||
<Resource Language="AZ-LATN-AZ" />
|
||||
<Resource Language="BG-BG" />
|
||||
<Resource Language="BN-IN" />
|
||||
<Resource Language="BS-LATN-BA" />
|
||||
<Resource Language="CA-ES" />
|
||||
<Resource Language="CA-ES-VALENCIA" />
|
||||
<Resource Language="CS-CZ" />
|
||||
<Resource Language="CY-GB" />
|
||||
<Resource Language="DA-DK" />
|
||||
<Resource Language="DE-DE" />
|
||||
<Resource Language="EL-GR" />
|
||||
<Resource Language="ES-ES" />
|
||||
<Resource Language="ES-MX" />
|
||||
<Resource Language="ET-EE" />
|
||||
<Resource Language="EU-ES" />
|
||||
<Resource Language="FA-IR" />
|
||||
<Resource Language="FI-FI" />
|
||||
<Resource Language="FIL-PH" />
|
||||
<Resource Language="FR-CA" />
|
||||
<Resource Language="FR-FR" />
|
||||
<Resource Language="GA-IE" />
|
||||
<Resource Language="GD-GB" />
|
||||
<Resource Language="GL-ES" />
|
||||
<Resource Language="GU-IN" />
|
||||
<Resource Language="HE-IL" />
|
||||
<Resource Language="HI-IN" />
|
||||
<Resource Language="HR-HR" />
|
||||
<Resource Language="HU-HU" />
|
||||
<Resource Language="HY-AM" />
|
||||
<Resource Language="ID-ID" />
|
||||
<Resource Language="IS-IS" />
|
||||
<Resource Language="IT-IT" />
|
||||
<Resource Language="JA-JP" />
|
||||
<Resource Language="KA-GE" />
|
||||
<Resource Language="KK-KZ" />
|
||||
<Resource Language="KM-KH" />
|
||||
<Resource Language="KN-IN" />
|
||||
<Resource Language="KO-KR" />
|
||||
<Resource Language="KOK-IN" />
|
||||
<Resource Language="LB-LU" />
|
||||
<Resource Language="LO-LA" />
|
||||
<Resource Language="LT-LT" />
|
||||
<Resource Language="LV-LV" />
|
||||
<Resource Language="MI-NZ" />
|
||||
<Resource Language="MK-MK" />
|
||||
<Resource Language="ML-IN" />
|
||||
<Resource Language="MR-IN" />
|
||||
<Resource Language="MS-MY" />
|
||||
<Resource Language="MT-MT" />
|
||||
<Resource Language="NB-NO" />
|
||||
<Resource Language="NE-NP" />
|
||||
<Resource Language="NL-NL" />
|
||||
<Resource Language="NN-NO" />
|
||||
<Resource Language="OR-IN" />
|
||||
<Resource Language="PA-IN" />
|
||||
<Resource Language="PL-PL" />
|
||||
<Resource Language="PT-BR" />
|
||||
<Resource Language="PT-PT" />
|
||||
<Resource Language="QPS-PLOC" />
|
||||
<Resource Language="QPS-PLOCA" />
|
||||
<Resource Language="QPS-PLOCM" />
|
||||
<Resource Language="QUZ-PE" />
|
||||
<Resource Language="RO-RO" />
|
||||
<Resource Language="RU-RU" />
|
||||
<Resource Language="SK-SK" />
|
||||
<Resource Language="SL-SI" />
|
||||
<Resource Language="SQ-AL" />
|
||||
<Resource Language="SR-CYRL-BA" />
|
||||
<Resource Language="SR-CYRL-RS" />
|
||||
<Resource Language="SR-LATN-RS" />
|
||||
<Resource Language="SV-SE" />
|
||||
<Resource Language="TA-IN" />
|
||||
<Resource Language="TE-IN" />
|
||||
<Resource Language="TH-TH" />
|
||||
<Resource Language="TR-TR" />
|
||||
<Resource Language="TT-RU" />
|
||||
<Resource Language="UG-CN" />
|
||||
<Resource Language="UK-UA" />
|
||||
<Resource Language="UR-PK" />
|
||||
<Resource Language="UZ-LATN-UZ" />
|
||||
<Resource Language="VI-VN" />
|
||||
<Resource Language="ZH-CN" />
|
||||
<Resource Language="ZH-TW" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -39,8 +127,8 @@
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="ms-resource:AppNamePre"
|
||||
Description="ms-resource:AppDescriptionPre"
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppNamePre"
|
||||
Description="ms-resource:TerminalApp/ContextMenu/AppDescriptionPre"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Images\Square150x150Logo.png"
|
||||
Square44x44Logo="Images\Square44x44Logo.png">
|
||||
@@ -48,7 +136,7 @@
|
||||
Wide310x150Logo="Images\Wide310x150Logo.png"
|
||||
Square71x71Logo="Images\SmallTile.png"
|
||||
Square310x310Logo="Images\LargeTile.png"
|
||||
ShortName="ms-resource:AppShortNamePre">
|
||||
ShortName="ms-resource:TerminalApp/ContextMenu/AppShortNamePre">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo"/>
|
||||
<uap:ShowOn Tile="wide310x150Logo"/>
|
||||
@@ -72,7 +160,7 @@
|
||||
<uap5:StartupTask
|
||||
TaskId="StartTerminalOnLoginTask"
|
||||
Enabled="false"
|
||||
DisplayName="ms-resource:AppNamePre" />
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppNamePre" />
|
||||
</uap5:Extension>
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.console.host"
|
||||
@@ -88,7 +176,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal-Pre"
|
||||
DisplayName="Windows Terminal Preview"
|
||||
DisplayName="Terminal Preview"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Windows Terminal</DisplayName>
|
||||
<DisplayName>ms-resource:TerminalApp/ContextMenu/AppStoreName</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -31,7 +31,95 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
<Resource Language="EN-US" />
|
||||
<Resource Language="EN-GB" />
|
||||
<Resource Language="AF-ZA" />
|
||||
<Resource Language="AM-ET" />
|
||||
<Resource Language="AR-SA" />
|
||||
<Resource Language="AS-IN" />
|
||||
<Resource Language="AZ-LATN-AZ" />
|
||||
<Resource Language="BG-BG" />
|
||||
<Resource Language="BN-IN" />
|
||||
<Resource Language="BS-LATN-BA" />
|
||||
<Resource Language="CA-ES" />
|
||||
<Resource Language="CA-ES-VALENCIA" />
|
||||
<Resource Language="CS-CZ" />
|
||||
<Resource Language="CY-GB" />
|
||||
<Resource Language="DA-DK" />
|
||||
<Resource Language="DE-DE" />
|
||||
<Resource Language="EL-GR" />
|
||||
<Resource Language="ES-ES" />
|
||||
<Resource Language="ES-MX" />
|
||||
<Resource Language="ET-EE" />
|
||||
<Resource Language="EU-ES" />
|
||||
<Resource Language="FA-IR" />
|
||||
<Resource Language="FI-FI" />
|
||||
<Resource Language="FIL-PH" />
|
||||
<Resource Language="FR-CA" />
|
||||
<Resource Language="FR-FR" />
|
||||
<Resource Language="GA-IE" />
|
||||
<Resource Language="GD-GB" />
|
||||
<Resource Language="GL-ES" />
|
||||
<Resource Language="GU-IN" />
|
||||
<Resource Language="HE-IL" />
|
||||
<Resource Language="HI-IN" />
|
||||
<Resource Language="HR-HR" />
|
||||
<Resource Language="HU-HU" />
|
||||
<Resource Language="HY-AM" />
|
||||
<Resource Language="ID-ID" />
|
||||
<Resource Language="IS-IS" />
|
||||
<Resource Language="IT-IT" />
|
||||
<Resource Language="JA-JP" />
|
||||
<Resource Language="KA-GE" />
|
||||
<Resource Language="KK-KZ" />
|
||||
<Resource Language="KM-KH" />
|
||||
<Resource Language="KN-IN" />
|
||||
<Resource Language="KO-KR" />
|
||||
<Resource Language="KOK-IN" />
|
||||
<Resource Language="LB-LU" />
|
||||
<Resource Language="LO-LA" />
|
||||
<Resource Language="LT-LT" />
|
||||
<Resource Language="LV-LV" />
|
||||
<Resource Language="MI-NZ" />
|
||||
<Resource Language="MK-MK" />
|
||||
<Resource Language="ML-IN" />
|
||||
<Resource Language="MR-IN" />
|
||||
<Resource Language="MS-MY" />
|
||||
<Resource Language="MT-MT" />
|
||||
<Resource Language="NB-NO" />
|
||||
<Resource Language="NE-NP" />
|
||||
<Resource Language="NL-NL" />
|
||||
<Resource Language="NN-NO" />
|
||||
<Resource Language="OR-IN" />
|
||||
<Resource Language="PA-IN" />
|
||||
<Resource Language="PL-PL" />
|
||||
<Resource Language="PT-BR" />
|
||||
<Resource Language="PT-PT" />
|
||||
<Resource Language="QPS-PLOC" />
|
||||
<Resource Language="QPS-PLOCA" />
|
||||
<Resource Language="QPS-PLOCM" />
|
||||
<Resource Language="QUZ-PE" />
|
||||
<Resource Language="RO-RO" />
|
||||
<Resource Language="RU-RU" />
|
||||
<Resource Language="SK-SK" />
|
||||
<Resource Language="SL-SI" />
|
||||
<Resource Language="SQ-AL" />
|
||||
<Resource Language="SR-CYRL-BA" />
|
||||
<Resource Language="SR-CYRL-RS" />
|
||||
<Resource Language="SR-LATN-RS" />
|
||||
<Resource Language="SV-SE" />
|
||||
<Resource Language="TA-IN" />
|
||||
<Resource Language="TE-IN" />
|
||||
<Resource Language="TH-TH" />
|
||||
<Resource Language="TR-TR" />
|
||||
<Resource Language="TT-RU" />
|
||||
<Resource Language="UG-CN" />
|
||||
<Resource Language="UK-UA" />
|
||||
<Resource Language="UR-PK" />
|
||||
<Resource Language="UZ-LATN-UZ" />
|
||||
<Resource Language="VI-VN" />
|
||||
<Resource Language="ZH-CN" />
|
||||
<Resource Language="ZH-TW" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -39,8 +127,8 @@
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="ms-resource:AppName"
|
||||
Description="ms-resource:AppDescription"
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppName"
|
||||
Description="ms-resource:TerminalApp/ContextMenu/AppDescription"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Images\Square150x150Logo.png"
|
||||
Square44x44Logo="Images\Square44x44Logo.png">
|
||||
@@ -48,7 +136,7 @@
|
||||
Wide310x150Logo="Images\Wide310x150Logo.png"
|
||||
Square71x71Logo="Images\SmallTile.png"
|
||||
Square310x310Logo="Images\LargeTile.png"
|
||||
ShortName="ms-resource:AppShortName">
|
||||
ShortName="ms-resource:TerminalApp/ContextMenu/AppShortName">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo"/>
|
||||
<uap:ShowOn Tile="wide310x150Logo"/>
|
||||
@@ -72,7 +160,7 @@
|
||||
<uap5:StartupTask
|
||||
TaskId="StartTerminalOnLoginTask"
|
||||
Enabled="false"
|
||||
DisplayName="ms-resource:AppName" />
|
||||
DisplayName="ms-resource:TerminalApp/ContextMenu/AppName" />
|
||||
</uap5:Extension>
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.console.host"
|
||||
@@ -88,7 +176,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal"
|
||||
DisplayName="Windows Terminal"
|
||||
DisplayName="Terminal"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
|
||||
@@ -117,22 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AppName" xml:space="preserve">
|
||||
<value>Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppNameDev" xml:space="preserve">
|
||||
<value>Windows Terminal Dev</value>
|
||||
</data>
|
||||
<data name="AppNamePre" xml:space="preserve">
|
||||
<value>Windows Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppShortName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppShortNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
</data>
|
||||
<data name="AppShortNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@@ -117,13 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AppDescription" xml:space="preserve">
|
||||
<value>The New Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppDescriptionDev" xml:space="preserve">
|
||||
<value>The Windows Terminal, but Unofficial</value>
|
||||
</data>
|
||||
<data name="AppDescriptionPre" xml:space="preserve">
|
||||
<value>Windows Terminal with a preview of upcoming features</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include "../TerminalSettingsModel/CascadiaSettings.h"
|
||||
#include "JsonTestClass.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
#include <defaults.h>
|
||||
#include <userDefaults.h>
|
||||
|
||||
using namespace Microsoft::Console;
|
||||
using namespace WEX::Logging;
|
||||
@@ -70,6 +72,7 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(TestCloneInheritanceTree);
|
||||
TEST_METHOD(TestValidDefaults);
|
||||
TEST_METHOD(TestInheritedCommand);
|
||||
TEST_METHOD(LoadFragmentsWithMultipleUpdates);
|
||||
|
||||
private:
|
||||
static winrt::com_ptr<implementation::CascadiaSettings> createSettings(const std::string_view& userJSON)
|
||||
@@ -1979,4 +1982,34 @@ namespace SettingsModelLocalTests
|
||||
VERIFY_IS_NULL(actualKeyChord);
|
||||
}
|
||||
}
|
||||
|
||||
// This test ensures GH#11597 doesn't regress.
|
||||
void DeserializationTests::LoadFragmentsWithMultipleUpdates()
|
||||
{
|
||||
static constexpr std::wstring_view fragmentSource{ L"fragment" };
|
||||
static constexpr std::string_view fragmentJson{ R"({
|
||||
"profiles": [
|
||||
{
|
||||
"updates": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"cursorShape": "filledBox"
|
||||
},
|
||||
{
|
||||
"updates": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
"cursorShape": "filledBox"
|
||||
},
|
||||
{
|
||||
"guid": "{6239a42c-0000-49a3-80bd-e8fdd045185c}",
|
||||
"commandline": "cmd.exe"
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
implementation::SettingsLoader loader{ std::string_view{}, DefaultJson };
|
||||
loader.MergeInboxIntoUserSettings();
|
||||
loader.MergeFragmentIntoUserSettings(winrt::hstring{ fragmentSource }, fragmentJson);
|
||||
loader.FinalizeLayering();
|
||||
|
||||
VERIFY_IS_FALSE(loader.duplicateProfile);
|
||||
VERIFY_ARE_EQUAL(3u, loader.userSettings.profiles.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(LayerProfilesOnArray);
|
||||
TEST_METHOD(DuplicateProfileTest);
|
||||
TEST_METHOD(TestGenGuidsForProfiles);
|
||||
|
||||
TEST_METHOD(TestCorrectOldDefaultShellPaths);
|
||||
};
|
||||
|
||||
void ProfileTests::ProfileGeneratesGuid()
|
||||
@@ -347,4 +349,59 @@ namespace SettingsModelLocalTests
|
||||
|
||||
VERIFY_ARE_NOT_EQUAL(settings->AllProfiles().GetAt(0).Guid(), settings->AllProfiles().GetAt(1).Guid());
|
||||
}
|
||||
|
||||
void ProfileTests::TestCorrectOldDefaultShellPaths()
|
||||
{
|
||||
static constexpr std::string_view inboxProfiles{ R"({
|
||||
"profiles": [
|
||||
{
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"name": "Windows PowerShell",
|
||||
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
||||
},
|
||||
{
|
||||
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
"name": "Command Prompt",
|
||||
"commandline": "%SystemRoot%\\System32\\cmd.exe",
|
||||
}
|
||||
]
|
||||
})" };
|
||||
static constexpr std::string_view userProfiles{ R"({
|
||||
"profiles": [
|
||||
{
|
||||
"name" : "powershell 1",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
{
|
||||
"name" : "powershell 2",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-0000-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 1",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 2",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-0000-5f56-a8ff-afceeeaa6101}"
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
const auto settings = winrt::make_self<implementation::CascadiaSettings>(userProfiles, inboxProfiles);
|
||||
const auto allProfiles = settings->AllProfiles();
|
||||
VERIFY_ARE_EQUAL(4u, allProfiles.Size());
|
||||
VERIFY_ARE_EQUAL(L"powershell 1", allProfiles.GetAt(0).Name());
|
||||
VERIFY_ARE_EQUAL(L"powershell 2", allProfiles.GetAt(1).Name());
|
||||
VERIFY_ARE_EQUAL(L"cmd 1", allProfiles.GetAt(2).Name());
|
||||
VERIFY_ARE_EQUAL(L"cmd 2", allProfiles.GetAt(3).Name());
|
||||
|
||||
VERIFY_ARE_EQUAL(L"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", allProfiles.GetAt(0).Commandline());
|
||||
VERIFY_ARE_EQUAL(L"powershell.exe", allProfiles.GetAt(1).Commandline());
|
||||
VERIFY_ARE_EQUAL(L"%SystemRoot%\\System32\\cmd.exe", allProfiles.GetAt(2).Commandline());
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", allProfiles.GetAt(3).Commandline());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(TryCreateWinRTType);
|
||||
TEST_METHOD(TestTerminalArgsForBinding);
|
||||
TEST_METHOD(CommandLineToArgvW);
|
||||
TEST_METHOD(NormalizeCommandLine);
|
||||
TEST_METHOD(GetProfileForArgsWithCommandline);
|
||||
TEST_METHOD(MakeSettingsForProfile);
|
||||
TEST_METHOD(MakeSettingsForDefaultProfileThatDoesntExist);
|
||||
@@ -116,6 +117,59 @@ namespace SettingsModelLocalTests
|
||||
VERIFY_ARE_EQUAL(0, memcmp(beg, expectedArgv.data(), expectedArgv.size()));
|
||||
}
|
||||
|
||||
// This unit test covers GH#12345.
|
||||
// * paths with more than 1 whitespace
|
||||
// * paths sharing a common prefix with another directory
|
||||
void TerminalSettingsTests::NormalizeCommandLine()
|
||||
{
|
||||
using namespace std::string_literals;
|
||||
|
||||
static constexpr auto touch = [](const auto& path) {
|
||||
std::ofstream file{ path };
|
||||
};
|
||||
|
||||
std::wstring guid;
|
||||
{
|
||||
GUID g{};
|
||||
THROW_IF_FAILED(CoCreateGuid(&g));
|
||||
guid = fmt::format(
|
||||
L"{:08x}-{:04x}-{:04x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
|
||||
g.Data1,
|
||||
g.Data2,
|
||||
g.Data3,
|
||||
g.Data4[0],
|
||||
g.Data4[1],
|
||||
g.Data4[2],
|
||||
g.Data4[3],
|
||||
g.Data4[4],
|
||||
g.Data4[5],
|
||||
g.Data4[6],
|
||||
g.Data4[7]);
|
||||
}
|
||||
|
||||
const auto tmpdir = std::filesystem::temp_directory_path();
|
||||
const auto dir1 = tmpdir / guid;
|
||||
const auto dir2 = tmpdir / (guid + L" two");
|
||||
const auto file1 = dir1 / L"file 1.exe";
|
||||
const auto file2 = dir2 / L"file 2.exe";
|
||||
|
||||
const auto cleanup = wil::scope_exit([&]() {
|
||||
std::error_code ec;
|
||||
remove_all(dir1, ec);
|
||||
remove_all(dir2, ec);
|
||||
});
|
||||
|
||||
create_directory(dir1);
|
||||
create_directory(dir2);
|
||||
touch(file1);
|
||||
touch(file2);
|
||||
|
||||
const auto commandLine = file2.native() + LR"( -foo "bar1 bar2" -baz)"s;
|
||||
const auto expected = file2.native() + L"\0-foo\0bar1 bar2\0-baz"s;
|
||||
const auto actual = implementation::CascadiaSettings::NormalizeCommandLine(commandLine.c_str());
|
||||
VERIFY_ARE_EQUAL(expected, actual);
|
||||
}
|
||||
|
||||
void TerminalSettingsTests::GetProfileForArgsWithCommandline()
|
||||
{
|
||||
// I'm exclusively using cmd.exe as I know exactly where it resides at.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -33,5 +33,5 @@ DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Usurp the TerminalApp's resource group.
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/Resources")
|
||||
// Usurp the TerminalApp's Context Menu specific resource group.
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/ContextMenu")
|
||||
|
||||
@@ -556,7 +556,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto actions = winrt::single_threaded_vector<ActionAndArgs>(std::move(
|
||||
TerminalPage::ConvertExecuteCommandlineToActions(realArgs)));
|
||||
|
||||
if (_startupActions.Size() != 0)
|
||||
if (actions.Size() != 0)
|
||||
{
|
||||
actionArgs.Handled(true);
|
||||
ProcessStartupActions(actions, false);
|
||||
|
||||
@@ -532,8 +532,26 @@ namespace winrt::TerminalApp::implementation
|
||||
if (keyboardServiceIsDisabled)
|
||||
{
|
||||
_root->ShowKeyboardServiceWarning();
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider,
|
||||
"KeyboardServiceWasDisabled",
|
||||
TraceLoggingDescription("Event emitted when the keyboard service is disabled, and we warned them about it"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// For when the warning was disabled in the settings
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider,
|
||||
"KeyboardServiceWarningWasDisabledBySetting",
|
||||
TraceLoggingDescription("Event emitted when the user has disabled the KB service warning"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
|
||||
}
|
||||
|
||||
if (FAILED(_settingsLoadedResult))
|
||||
{
|
||||
@@ -1077,18 +1095,18 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Gets the title of the currently focused terminal control. If there
|
||||
// isn't a control selected for any reason, returns "Windows Terminal"
|
||||
// isn't a control selected for any reason, returns "Terminal"
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title of the focused control if there is one, else "Windows Terminal"
|
||||
// - the title of the focused control if there is one, else "Terminal"
|
||||
hstring AppLogic::Title()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
return _root->Title();
|
||||
}
|
||||
return { L"Windows Terminal" };
|
||||
return { L"Terminal" };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1557,6 +1575,11 @@ namespace winrt::TerminalApp::implementation
|
||||
return _root->IsQuakeWindow();
|
||||
}
|
||||
|
||||
void AppLogic::RequestExitFullscreen()
|
||||
{
|
||||
_root->SetFullscreen(false);
|
||||
}
|
||||
|
||||
bool AppLogic::GetMinimizeToNotificationArea()
|
||||
{
|
||||
if constexpr (Feature_NotificationIcon::IsEnabled())
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void SetPersistedLayoutIdx(const uint32_t idx);
|
||||
void SetNumberOfOpenWindows(const uint64_t num);
|
||||
bool IsQuakeWindow() const noexcept;
|
||||
void RequestExitFullscreen();
|
||||
|
||||
Windows::Foundation::Size GetLaunchDimensions(uint32_t dpi);
|
||||
bool CenterOnLaunch();
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace TerminalApp
|
||||
void SetPersistedLayoutIdx(UInt32 idx);
|
||||
void SetNumberOfOpenWindows(UInt64 num);
|
||||
void RenameFailed();
|
||||
void RequestExitFullscreen();
|
||||
Boolean IsQuakeWindow();
|
||||
|
||||
Windows.Foundation.Size GetLaunchDimensions(UInt32 dpi);
|
||||
|
||||
@@ -822,16 +822,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
const auto currentNeedleHasResults{ _filteredActions.Size() > 0 };
|
||||
_noMatchesText().Visibility(currentNeedleHasResults ? Visibility::Collapsed : Visibility::Visible);
|
||||
if (!currentNeedleHasResults)
|
||||
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(_searchBox()) })
|
||||
{
|
||||
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(_searchBox()) })
|
||||
{
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
NoMatchesText(), // NoMatchesText contains the right text for the current mode
|
||||
L"CommandPaletteResultAnnouncement" /* unique name for this notification */);
|
||||
}
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
currentNeedleHasResults ? RS_(L"CommandPalette_MatchesAvailable") : NoMatchesText(), // what to announce if results were found
|
||||
L"CommandPaletteResultAnnouncement" /* unique name for this group of notifications */);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -62,6 +62,19 @@ static std::wstring _normalizeIconPath(std::wstring_view path)
|
||||
// - <none>
|
||||
winrt::fire_and_forget Jumplist::UpdateJumplist(const CascadiaSettings& settings) noexcept
|
||||
{
|
||||
if (!settings)
|
||||
{
|
||||
// By all accounts, this shouldn't be null. Seemingly however (GH
|
||||
// #12360), it sometimes is. So just check this case here and log a
|
||||
// message.
|
||||
TraceLoggingWrite(g_hTerminalAppProvider,
|
||||
"Jumplist_UpdateJumplist_NullSettings",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
// make sure to capture the settings _before_ the co_await
|
||||
const auto strongSettings = settings;
|
||||
|
||||
|
||||
@@ -1,25 +1,67 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// MinMaxCloseControl.xaml.cpp
|
||||
// Implementation of the MinMaxCloseControl class
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "MinMaxCloseControl.h"
|
||||
|
||||
#include "MinMaxCloseControl.g.cpp"
|
||||
|
||||
#include <LibraryResources.h>
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
static void closeToolTipForButton(const Controls::Button& button)
|
||||
{
|
||||
if (auto tt{ Controls::ToolTipService::GetToolTip(button) })
|
||||
{
|
||||
if (auto tooltip{ tt.try_as<Controls::ToolTip>() })
|
||||
{
|
||||
tooltip.IsOpen(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MinMaxCloseControl::MinMaxCloseControl()
|
||||
{
|
||||
// Get our dispatcher. This will get us the same dispatcher as
|
||||
// Dispatcher(), but it's a DispatcherQueue, so we can use it with
|
||||
// ThrottledFunc
|
||||
auto dispatcher = winrt::Windows::System::DispatcherQueue::GetForCurrentThread();
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
// Get the tooltip hover time from the system, or default to 400ms
|
||||
// (which should be the default, see:
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-trackmouseevent#remarks)
|
||||
unsigned int hoverTimeoutMillis{ 400 };
|
||||
LOG_IF_WIN32_BOOL_FALSE(SystemParametersInfoW(SPI_GETMOUSEHOVERTIME, 0, &hoverTimeoutMillis, 0));
|
||||
const auto toolTipInterval = std::chrono::milliseconds(hoverTimeoutMillis);
|
||||
|
||||
// Create a ThrottledFunc for opening the tooltip after the hover
|
||||
// timeout. If we hover another button, we should make sure to call
|
||||
// Run() with the new button. Calling `_displayToolTip.Run(nullptr)`,
|
||||
// which will cause us to not display a tooltip, which is used when we
|
||||
// leave the control entirely.
|
||||
_displayToolTip = std::make_shared<ThrottledFuncTrailing<Controls::Button>>(
|
||||
dispatcher,
|
||||
toolTipInterval,
|
||||
[weakThis = get_weak()](Controls::Button button) {
|
||||
// If we provide a button, then open the tooltip on that button.
|
||||
// We can "dismiss" this throttled func by calling it with null,
|
||||
// which will cause us to do nothing at the end of the timeout
|
||||
// instead.
|
||||
if (button)
|
||||
{
|
||||
if (auto tt{ Controls::ToolTipService::GetToolTip(button) })
|
||||
{
|
||||
if (auto tooltip{ tt.try_as<Controls::ToolTip>() })
|
||||
{
|
||||
tooltip.IsOpen(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// These event handlers simply forward each buttons click events up to the
|
||||
@@ -95,4 +137,104 @@ namespace winrt::TerminalApp::implementation
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called when the mouse hovers a button.
|
||||
// - Transition that button to `PointerOver`
|
||||
// - run the throttled func with this button, to display the tooltip after
|
||||
// a timeout
|
||||
// - dismiss any open tooltips on other buttons.
|
||||
// Arguments:
|
||||
// - button: the button that was hovered
|
||||
void MinMaxCloseControl::HoverButton(CaptionButton button)
|
||||
{
|
||||
// Keep track of the button that's been pressed. we get a mouse move
|
||||
// message when we open the tooltip. If we move the mouse on top of this
|
||||
// button, that we've already pressed, then no need to move to the
|
||||
// "hovered" state, we should stay in the pressed state.
|
||||
if (_lastPressedButton && _lastPressedButton.value() == button)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (button)
|
||||
{
|
||||
// Make sure to use true for the useTransitions parameter, to
|
||||
// animate the fade in/out transition between colors.
|
||||
case CaptionButton::Minimize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"PointerOver", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
_displayToolTip->Run(MinimizeButton());
|
||||
closeToolTipForButton(MaximizeButton());
|
||||
closeToolTipForButton(CloseButton());
|
||||
break;
|
||||
case CaptionButton::Maximize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"PointerOver", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
_displayToolTip->Run(MaximizeButton());
|
||||
closeToolTipForButton(CloseButton());
|
||||
break;
|
||||
case CaptionButton::Close:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"PointerOver", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
closeToolTipForButton(MaximizeButton());
|
||||
_displayToolTip->Run(CloseButton());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called when the mouse presses down on a button. NOT when it is
|
||||
// released. That's handled one level above, in
|
||||
// TitleBarControl::ReleaseButtons
|
||||
// - Transition that button to `Pressed`
|
||||
// Arguments:
|
||||
// - button: the button that was pressed
|
||||
void MinMaxCloseControl::PressButton(CaptionButton button)
|
||||
{
|
||||
switch (button)
|
||||
{
|
||||
case CaptionButton::Minimize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Pressed", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
break;
|
||||
case CaptionButton::Maximize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Pressed", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
break;
|
||||
case CaptionButton::Close:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Pressed", true);
|
||||
break;
|
||||
}
|
||||
_lastPressedButton = button;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called when buttons are no longer hovered or pressed. Return them all
|
||||
// to the normal state, and dismiss the tooltips.
|
||||
void MinMaxCloseControl::ReleaseButtons()
|
||||
{
|
||||
_displayToolTip->Run(nullptr);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
closeToolTipForButton(MaximizeButton());
|
||||
closeToolTipForButton(CloseButton());
|
||||
|
||||
_lastPressedButton = std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "winrt/Windows.UI.Xaml.h"
|
||||
#include "winrt/Windows.UI.Xaml.Markup.h"
|
||||
#include "winrt/Windows.UI.Xaml.Interop.h"
|
||||
#include "MinMaxCloseControl.g.h"
|
||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||
#include <ThrottledFunc.h>
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
@@ -20,6 +18,10 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void SetWindowVisualState(WindowVisualState visualState);
|
||||
|
||||
void HoverButton(CaptionButton button);
|
||||
void PressButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
|
||||
void _MinimizeClick(winrt::Windows::Foundation::IInspectable const& sender,
|
||||
winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
void _MaximizeClick(winrt::Windows::Foundation::IInspectable const& sender,
|
||||
@@ -30,6 +32,9 @@ namespace winrt::TerminalApp::implementation
|
||||
TYPED_EVENT(MinimizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(MaximizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(CloseClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
|
||||
std::shared_ptr<ThrottledFuncTrailing<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
|
||||
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ namespace TerminalApp
|
||||
|
||||
void SetWindowVisualState(WindowVisualState visualState);
|
||||
|
||||
void HoverButton(CaptionButton button);
|
||||
void PressButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
|
||||
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MinimizeClick;
|
||||
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MaximizeClick;
|
||||
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> CloseClick;
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
</StackPanel.Resources>
|
||||
|
||||
<Button x:Name="MinimizeButton"
|
||||
x:Uid="WindowMinimizeButton"
|
||||
x:Uid="MinimizeButton"
|
||||
Width="46.0"
|
||||
Height="{StaticResource CaptionButtonHeightWindowed}"
|
||||
MinWidth="46.0"
|
||||
@@ -232,9 +232,14 @@
|
||||
<x:String x:Key="CaptionButtonPath">M 0 0 H 10</x:String>
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip>
|
||||
<TextBlock x:Uid="WindowMinimizeButtonToolTip" />
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
<Button x:Name="MaximizeButton"
|
||||
x:Uid="WindowMaximizeButton"
|
||||
x:Uid="MaximizeButton"
|
||||
Width="46.0"
|
||||
Height="{StaticResource CaptionButtonHeightWindowed}"
|
||||
MinWidth="46.0"
|
||||
@@ -256,7 +261,7 @@
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
<Button x:Name="CloseButton"
|
||||
x:Uid="WindowCloseButton"
|
||||
x:Uid="CloseButton"
|
||||
Width="46.0"
|
||||
Height="{StaticResource CaptionButtonHeightWindowed}"
|
||||
MinWidth="46.0"
|
||||
@@ -309,5 +314,10 @@
|
||||
<x:String x:Key="CaptionButtonPath">M 0 0 L 10 10 M 10 0 L 0 10</x:String>
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip>
|
||||
<TextBlock x:Uid="WindowCloseButtonToolTip" />
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
172
src/cascadia/TerminalApp/Resources/en-US/ContextMenu.resw
Normal file
172
src/cascadia/TerminalApp/Resources/en-US/ContextMenu.resw
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AppName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppStoreName" xml:space="preserve">
|
||||
<value>Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppStoreNameDev" xml:space="preserve">
|
||||
<value>Windows Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppStoreNamePre" xml:space="preserve">
|
||||
<value>Windows Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppShortName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppShortNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppShortNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppDescription" xml:space="preserve">
|
||||
<value>The New Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppDescriptionDev" xml:space="preserve">
|
||||
<value>The Windows Terminal, but Unofficial</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppDescriptionPre" xml:space="preserve">
|
||||
<value>Windows Terminal with a preview of upcoming features</value>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
|
||||
<value>Open in Terminal (Dev)</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
|
||||
<value>Open in Terminal Preview</value>
|
||||
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
|
||||
<value>Open in Terminal</value>
|
||||
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -411,6 +411,9 @@
|
||||
<data name="WindowCloseButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
</data>
|
||||
<data name="WindowCloseButtonToolTip.Text" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
</data>
|
||||
<data name="WindowMaximizeButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Maximize</value>
|
||||
</data>
|
||||
@@ -420,6 +423,9 @@
|
||||
<data name="WindowMinimizeButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Minimize</value>
|
||||
</data>
|
||||
<data name="WindowMinimizeButtonToolTip.Text" xml:space="preserve">
|
||||
<value>Minimize</value>
|
||||
</data>
|
||||
<data name="AboutDialog.Title" xml:space="preserve">
|
||||
<value>About</value>
|
||||
</data>
|
||||
@@ -679,18 +685,6 @@
|
||||
<value>Windows</value>
|
||||
<comment>This is displayed as a label for the context menu item that holds the submenu of available windows.</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
|
||||
<value>Open in Windows Terminal (Dev)</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
|
||||
<value>Open in Windows Terminal Preview</value>
|
||||
<comment>{Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
|
||||
<value>Open in Windows Terminal</value>
|
||||
<comment>{Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
<data name="DropPathTabRun.Text" xml:space="preserve">
|
||||
<value>Open a new tab in given starting directory</value>
|
||||
</data>
|
||||
@@ -731,4 +725,7 @@
|
||||
<value>Open Settings</value>
|
||||
<comment>This is a call-to-action hyperlink; it will open the settings.</comment>
|
||||
</data>
|
||||
</root>
|
||||
<data name="CommandPalette_MatchesAvailable" xml:space="preserve">
|
||||
<value>Suggestions available</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -251,4 +251,5 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -301,6 +301,7 @@
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Resources\en-US\Resources.resw" />
|
||||
<PRIResource Include="Resources\en-US\ContextMenu.resw" />
|
||||
<OCResourceDirectory Include="Resources" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "../inc/WindowingBehavior.h"
|
||||
|
||||
#include <til/latch.h>
|
||||
#include <TerminalCore/ControlKeyStates.hpp>
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
@@ -35,6 +36,7 @@ using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace ::Microsoft::Console;
|
||||
using namespace ::Microsoft::Terminal::Core;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define HOOKUP_ACTION(action) _actionDispatch->action({ this, &TerminalPage::_Handle##action });
|
||||
@@ -943,8 +945,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// process until later, on another thread, after we've already
|
||||
// restored the CWD to it's original value.
|
||||
winrt::hstring newWorkingDirectory{ settings.StartingDirectory() };
|
||||
if (newWorkingDirectory.size() <= 1 ||
|
||||
!(newWorkingDirectory[0] == L'~' || newWorkingDirectory[0] == L'/'))
|
||||
if (newWorkingDirectory.size() == 0 || newWorkingDirectory.size() == 1 &&
|
||||
!(newWorkingDirectory[0] == L'~' || newWorkingDirectory[0] == L'/'))
|
||||
{ // We only want to resolve the new WD against the CWD if it doesn't look like a Linux path (see GH#592)
|
||||
std::wstring cwdString{ wil::GetCurrentDirectoryW<std::wstring>() };
|
||||
std::filesystem::path cwd{ cwdString };
|
||||
@@ -1038,29 +1040,159 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Called when the users pressed keyBindings while CommandPalette is open.
|
||||
// - Called when the users pressed keyBindings while CommandPalette is open.
|
||||
// - As of GH#8480, this is also bound to the TabRowControl's KeyUp event.
|
||||
// That should only fire when focus is in the tab row, which is hard to
|
||||
// do. Notably, that's possible:
|
||||
// - When you have enough tabs to make the little scroll arrows appear,
|
||||
// click one, then hit tab
|
||||
// - When Narrator is in Scan mode (which is the a11y bug we're fixing here)
|
||||
// - This method is effectively an extract of TermControl::_KeyHandler and TermControl::_TryHandleKeyBinding.
|
||||
// Arguments:
|
||||
// - e: the KeyRoutedEventArgs containing info about the keystroke.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_KeyDownHandler(Windows::Foundation::IInspectable const& /*sender*/, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e)
|
||||
{
|
||||
const auto key = e.OriginalKey();
|
||||
const auto scanCode = e.KeyStatus().ScanCode;
|
||||
const auto coreWindow = CoreWindow::GetForCurrentThread();
|
||||
const auto ctrlDown = WI_IsFlagSet(coreWindow.GetKeyState(winrt::Windows::System::VirtualKey::Control), CoreVirtualKeyStates::Down);
|
||||
const auto altDown = WI_IsFlagSet(coreWindow.GetKeyState(winrt::Windows::System::VirtualKey::Menu), CoreVirtualKeyStates::Down);
|
||||
const auto shiftDown = WI_IsFlagSet(coreWindow.GetKeyState(winrt::Windows::System::VirtualKey::Shift), CoreVirtualKeyStates::Down);
|
||||
const auto keyStatus = e.KeyStatus();
|
||||
const auto vkey = gsl::narrow_cast<WORD>(e.OriginalKey());
|
||||
const auto scanCode = gsl::narrow_cast<WORD>(keyStatus.ScanCode);
|
||||
const auto modifiers = _GetPressedModifierKeys();
|
||||
|
||||
winrt::Microsoft::Terminal::Control::KeyChord kc{ ctrlDown, altDown, shiftDown, false, static_cast<int32_t>(key), static_cast<int32_t>(scanCode) };
|
||||
if (const auto cmd{ _settings.ActionMap().GetActionByKeyChord(kc) })
|
||||
// GH#11076:
|
||||
// For some weird reason we sometimes receive a WM_KEYDOWN
|
||||
// message without vkey or scanCode if a user drags a tab.
|
||||
// The KeyChord constructor has a debug assertion ensuring that all KeyChord
|
||||
// either have a valid vkey/scanCode. This is important, because this prevents
|
||||
// accidential insertion of invalid KeyChords into classes like ActionMap.
|
||||
if (!vkey && !scanCode)
|
||||
{
|
||||
if (CommandPalette().Visibility() == Visibility::Visible && cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
|
||||
return;
|
||||
}
|
||||
|
||||
// Alt-Numpad# input will send us a character once the user releases
|
||||
// Alt, so we should be ignoring the individual keydowns. The character
|
||||
// will be sent through the TSFInputControl. See GH#1401 for more
|
||||
// details
|
||||
if (modifiers.IsAltPressed() && (vkey >= VK_NUMPAD0 && vkey <= VK_NUMPAD9))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// GH#2235: Terminal::Settings hasn't been modified to differentiate
|
||||
// between AltGr and Ctrl+Alt yet.
|
||||
// -> Don't check for key bindings if this is an AltGr key combination.
|
||||
if (modifiers.IsAltGrPressed())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto actionMap = _settings.ActionMap();
|
||||
if (!actionMap)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto cmd = actionMap.GetActionByKeyChord({
|
||||
modifiers.IsCtrlPressed(),
|
||||
modifiers.IsAltPressed(),
|
||||
modifiers.IsShiftPressed(),
|
||||
modifiers.IsWinPressed(),
|
||||
vkey,
|
||||
scanCode,
|
||||
});
|
||||
if (!cmd)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_actionDispatch->DoAction(cmd.ActionAndArgs()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (const auto p = CommandPalette(); p.Visibility() == Visibility::Visible && cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
|
||||
{
|
||||
p.Visibility(Visibility::Collapsed);
|
||||
}
|
||||
|
||||
// Let's assume the user has bound the dead key "^" to a sendInput command that sends "b".
|
||||
// If the user presses the two keys "^a" it'll produce "bâ", despite us marking the key event as handled.
|
||||
// The following is used to manually "consume" such dead keys and clear them from the keyboard state.
|
||||
_ClearKeyboardState(vkey, scanCode);
|
||||
e.Handled(true);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Get the modifier keys that are currently pressed. This can be used to
|
||||
// find out which modifiers (ctrl, alt, shift) are pressed in events that
|
||||
// don't necessarily include that state.
|
||||
// - This is a copy of TermControl::_GetPressedModifierKeys.
|
||||
// Return Value:
|
||||
// - The Microsoft::Terminal::Core::ControlKeyStates representing the modifier key states.
|
||||
ControlKeyStates TerminalPage::_GetPressedModifierKeys() noexcept
|
||||
{
|
||||
const CoreWindow window = CoreWindow::GetForCurrentThread();
|
||||
// DONT USE
|
||||
// != CoreVirtualKeyStates::None
|
||||
// OR
|
||||
// == CoreVirtualKeyStates::Down
|
||||
// Sometimes with the key down, the state is Down | Locked.
|
||||
// Sometimes with the key up, the state is Locked.
|
||||
// IsFlagSet(Down) is the only correct solution.
|
||||
|
||||
struct KeyModifier
|
||||
{
|
||||
VirtualKey vkey;
|
||||
ControlKeyStates flags;
|
||||
};
|
||||
|
||||
constexpr std::array<KeyModifier, 7> modifiers{ {
|
||||
{ VirtualKey::RightMenu, ControlKeyStates::RightAltPressed },
|
||||
{ VirtualKey::LeftMenu, ControlKeyStates::LeftAltPressed },
|
||||
{ VirtualKey::RightControl, ControlKeyStates::RightCtrlPressed },
|
||||
{ VirtualKey::LeftControl, ControlKeyStates::LeftCtrlPressed },
|
||||
{ VirtualKey::Shift, ControlKeyStates::ShiftPressed },
|
||||
{ VirtualKey::RightWindows, ControlKeyStates::RightWinPressed },
|
||||
{ VirtualKey::LeftWindows, ControlKeyStates::LeftWinPressed },
|
||||
} };
|
||||
|
||||
ControlKeyStates flags;
|
||||
|
||||
for (const auto& mod : modifiers)
|
||||
{
|
||||
const auto state = window.GetKeyState(mod.vkey);
|
||||
const auto isDown = WI_IsFlagSet(state, CoreVirtualKeyStates::Down);
|
||||
|
||||
if (isDown)
|
||||
{
|
||||
CommandPalette().Visibility(Visibility::Collapsed);
|
||||
flags |= mod.flags;
|
||||
}
|
||||
_actionDispatch->DoAction(cmd.ActionAndArgs());
|
||||
e.Handled(true);
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Discards currently pressed dead keys.
|
||||
// - This is a copy of TermControl::_ClearKeyboardState.
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
void TerminalPage::_ClearKeyboardState(const WORD vkey, const WORD scanCode) noexcept
|
||||
{
|
||||
std::array<BYTE, 256> keyState;
|
||||
if (!GetKeyboardState(keyState.data()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// As described in "Sometimes you *want* to interfere with the keyboard's state buffer":
|
||||
// http://archives.miloush.net/michkap/archive/2006/09/10/748775.html
|
||||
// > "The key here is to keep trying to pass stuff to ToUnicode until -1 is not returned."
|
||||
std::array<wchar_t, 16> buffer;
|
||||
while (ToUnicodeEx(vkey, scanCode, keyState.data(), buffer.data(), gsl::narrow_cast<int>(buffer.size()), 0b1, nullptr) < 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1597,7 +1729,10 @@ namespace winrt::TerminalApp::implementation
|
||||
// the control here instead.
|
||||
if (_startupState == StartupState::Initialized)
|
||||
{
|
||||
_GetActiveControl().Focus(FocusState::Programmatic);
|
||||
if (const auto control = _GetActiveControl())
|
||||
{
|
||||
control.Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
@@ -1665,11 +1800,11 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Gets the title of the currently focused terminal control. If there
|
||||
// isn't a control selected for any reason, returns "Windows Terminal"
|
||||
// isn't a control selected for any reason, returns "Terminal"
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title of the focused control if there is one, else "Windows Terminal"
|
||||
// - the title of the focused control if there is one, else "Terminal"
|
||||
hstring TerminalPage::Title()
|
||||
{
|
||||
if (_settings.GlobalSettings().ShowTitleInTitlebar())
|
||||
@@ -1687,7 +1822,7 @@ namespace winrt::TerminalApp::implementation
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
return { L"Windows Terminal" };
|
||||
return { L"Terminal" };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -2478,9 +2613,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
void TerminalPage::ToggleFullscreen()
|
||||
{
|
||||
_isFullscreen = !_isFullscreen;
|
||||
_UpdateTabView();
|
||||
_FullscreenChangedHandlers(*this, nullptr);
|
||||
SetFullscreen(!_isFullscreen);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -2697,6 +2830,17 @@ namespace winrt::TerminalApp::implementation
|
||||
return _isAlwaysOnTop;
|
||||
}
|
||||
|
||||
void TerminalPage::SetFullscreen(bool newFullscreen)
|
||||
{
|
||||
if (_isFullscreen == newFullscreen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_isFullscreen = newFullscreen;
|
||||
_UpdateTabView();
|
||||
_FullscreenChangedHandlers(*this, nullptr);
|
||||
}
|
||||
|
||||
HRESULT TerminalPage::_OnNewConnection(const ConptyConnection& connection)
|
||||
{
|
||||
// We need to be on the UI thread in order for _OpenNewTab to run successfully.
|
||||
|
||||
@@ -14,12 +14,17 @@
|
||||
|
||||
static constexpr uint32_t DefaultRowsToScroll{ 3 };
|
||||
static constexpr std::wstring_view TabletInputServiceKey{ L"TabletInputService" };
|
||||
// fwdecl unittest classes
|
||||
|
||||
namespace TerminalAppLocalTests
|
||||
{
|
||||
class TabTests;
|
||||
class SettingsTests;
|
||||
};
|
||||
}
|
||||
|
||||
namespace Microsoft::Terminal::Core
|
||||
{
|
||||
class ControlKeyStates;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
@@ -83,6 +88,7 @@ namespace winrt::TerminalApp::implementation
|
||||
bool FocusMode() const;
|
||||
bool Fullscreen() const;
|
||||
bool AlwaysOnTop() const;
|
||||
void SetFullscreen(bool);
|
||||
|
||||
void SetStartupActions(std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs>& actions);
|
||||
|
||||
@@ -223,6 +229,8 @@ namespace winrt::TerminalApp::implementation
|
||||
void _ThirdPartyNoticesOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
|
||||
void _KeyDownHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
|
||||
static ::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() noexcept;
|
||||
static void _ClearKeyboardState(const WORD vkey, const WORD scanCode) noexcept;
|
||||
void _HookupKeyBindings(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap) noexcept;
|
||||
void _RegisterActionCallbacks();
|
||||
|
||||
|
||||
@@ -15,15 +15,59 @@
|
||||
<Grid x:Name="Root"
|
||||
Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<local:TabRowControl x:Name="TabRow"
|
||||
Grid.Row="0" />
|
||||
Grid.Row="0"
|
||||
KeyUp="_KeyDownHandler" />
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<mux:InfoBar x:Name="KeyboardServiceWarningInfoBar"
|
||||
x:Load="False"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Message="{x:Bind KeyboardServiceDisabledText, Mode=OneWay}"
|
||||
Severity="Warning">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<Button x:Uid="InfoBarDismissButton"
|
||||
Click="_KeyboardServiceWarningInfoDismissHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
|
||||
<mux:InfoBar x:Name="CloseOnExitInfoBar"
|
||||
x:Uid="CloseOnExitInfoBar"
|
||||
x:Load="False"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Severity="Informational">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<Button x:Uid="InfoBarDismissButton"
|
||||
Click="_CloseOnExitInfoDismissHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
|
||||
<mux:InfoBar x:Name="SetAsDefaultInfoBar"
|
||||
x:Uid="SetAsDefaultInfoBar"
|
||||
x:Load="False"
|
||||
CloseButtonClick="_SetAsDefaultDismissHandler"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Severity="Informational">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<HyperlinkButton x:Uid="SetAsDefaultTip_OpenSettingsLink"
|
||||
Click="_SetAsDefaultOpenSettingsHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
</StackPanel>
|
||||
|
||||
<Grid x:Name="TabContent"
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
|
||||
@@ -110,53 +154,11 @@
|
||||
</ContentDialog>
|
||||
|
||||
<local:CommandPalette x:Name="CommandPalette"
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Stretch"
|
||||
PreviewKeyDown="_KeyDownHandler"
|
||||
Visibility="Collapsed" />
|
||||
|
||||
<StackPanel>
|
||||
<mux:InfoBar x:Name="KeyboardServiceWarningInfoBar"
|
||||
x:Load="False"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Message="{x:Bind KeyboardServiceDisabledText, Mode=OneWay}"
|
||||
Severity="Warning">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<Button x:Uid="InfoBarDismissButton"
|
||||
Click="_KeyboardServiceWarningInfoDismissHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
|
||||
<mux:InfoBar x:Name="CloseOnExitInfoBar"
|
||||
x:Uid="CloseOnExitInfoBar"
|
||||
x:Load="False"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Severity="Informational">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<Button x:Uid="InfoBarDismissButton"
|
||||
Click="_CloseOnExitInfoDismissHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
|
||||
<mux:InfoBar x:Name="SetAsDefaultInfoBar"
|
||||
x:Uid="SetAsDefaultInfoBar"
|
||||
x:Load="False"
|
||||
CloseButtonClick="_SetAsDefaultDismissHandler"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
Severity="Informational">
|
||||
<mux:InfoBar.ActionButton>
|
||||
<HyperlinkButton x:Uid="SetAsDefaultTip_OpenSettingsLink"
|
||||
Click="_SetAsDefaultOpenSettingsHandler" />
|
||||
</mux:InfoBar.ActionButton>
|
||||
</mux:InfoBar>
|
||||
</StackPanel>
|
||||
|
||||
<!--
|
||||
A TeachingTip with IsLightDismissEnabled="True" will immediately
|
||||
dismiss itself if the window is unfocused (In Xaml Islands). This is
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// TitlebarControl.xaml.cpp
|
||||
// Implementation of the TitlebarControl class
|
||||
//
|
||||
|
||||
@@ -24,6 +23,14 @@ namespace winrt::TerminalApp::implementation
|
||||
MinMaxCloseControl().CloseClick({ this, &TitlebarControl::Close_Click });
|
||||
}
|
||||
|
||||
double TitlebarControl::CaptionButtonWidth()
|
||||
{
|
||||
// Divide by three, since we know there are only three buttons. When
|
||||
// Windows 12 comes along and adds another, we can update this /s
|
||||
static double width{ MinMaxCloseControl().ActualWidth() / 3.0 };
|
||||
return width;
|
||||
}
|
||||
|
||||
IInspectable TitlebarControl::Content()
|
||||
{
|
||||
return ContentRoot().Content();
|
||||
@@ -93,4 +100,48 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
MinMaxCloseControl().SetWindowVisualState(visualState);
|
||||
}
|
||||
|
||||
// GH#9443: HoverButton, PressButton, ClickButton and ReleaseButtons are all
|
||||
// used to manually interact with the buttons, in the same way that XAML
|
||||
// would normally send events.
|
||||
|
||||
void TitlebarControl::HoverButton(CaptionButton button)
|
||||
{
|
||||
MinMaxCloseControl().HoverButton(button);
|
||||
}
|
||||
void TitlebarControl::PressButton(CaptionButton button)
|
||||
{
|
||||
MinMaxCloseControl().PressButton(button);
|
||||
}
|
||||
winrt::fire_and_forget TitlebarControl::ClickButton(CaptionButton button)
|
||||
{
|
||||
// GH#8587: Handle this on the _next_ pass of the UI thread. If we
|
||||
// handle this immediately, then we'll accidentally leave the button in
|
||||
// the "Hovered" state when we minimize. This will leave the button
|
||||
// visibly hovered in the taskbar preview for our window.
|
||||
auto weakThis{ get_weak() };
|
||||
co_await MinMaxCloseControl().Dispatcher();
|
||||
if (auto self{ weakThis.get() })
|
||||
{
|
||||
// Just handle this in the same way we would if the button were
|
||||
// clicked normally.
|
||||
switch (button)
|
||||
{
|
||||
case CaptionButton::Minimize:
|
||||
Minimize_Click(nullptr, nullptr);
|
||||
break;
|
||||
case CaptionButton::Maximize:
|
||||
Maximize_Click(nullptr, nullptr);
|
||||
break;
|
||||
case CaptionButton::Close:
|
||||
Close_Click(nullptr, nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void TitlebarControl::ReleaseButtons()
|
||||
{
|
||||
MinMaxCloseControl().ReleaseButtons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// Declaration of the MainUserControl class.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "winrt/Windows.UI.Xaml.h"
|
||||
#include "winrt/Windows.UI.Xaml.Markup.h"
|
||||
#include "winrt/Windows.UI.Xaml.Interop.h"
|
||||
#include "TitlebarControl.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
@@ -17,6 +11,12 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
TitlebarControl(uint64_t handle);
|
||||
|
||||
void HoverButton(CaptionButton button);
|
||||
void PressButton(CaptionButton button);
|
||||
winrt::fire_and_forget ClickButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
double CaptionButtonWidth();
|
||||
|
||||
IInspectable Content();
|
||||
void Content(IInspectable content);
|
||||
|
||||
|
||||
@@ -10,11 +10,25 @@ namespace TerminalApp
|
||||
WindowVisualStateIconified
|
||||
};
|
||||
|
||||
// For simplicity, make sure that these are the same values as the ones used
|
||||
// by messages like WM_NCHITTEST
|
||||
enum CaptionButton {
|
||||
Minimize = 8, // HTMINBUTTON
|
||||
Maximize = 9, // HTMAXBUTTON
|
||||
Close = 20 // HTCLOSE
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass TitlebarControl : Windows.UI.Xaml.Controls.Grid
|
||||
{
|
||||
TitlebarControl(UInt64 parentWindowHandle);
|
||||
void SetWindowVisualState(WindowVisualState visualState);
|
||||
|
||||
void HoverButton(CaptionButton button);
|
||||
void PressButton(CaptionButton button);
|
||||
void ClickButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
Double CaptionButtonWidth { get; };
|
||||
|
||||
IInspectable Content;
|
||||
Windows.UI.Xaml.Controls.Border DragBar { get; };
|
||||
}
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "ConptyConnection.h"
|
||||
|
||||
#include <UserEnv.h>
|
||||
#include <winternl.h>
|
||||
|
||||
#include "ConptyConnection.g.cpp"
|
||||
@@ -61,72 +60,6 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Function Description:
|
||||
// - Promotes a starting directory provided to a WSL invocation to a commandline argument.
|
||||
// This is necessary because WSL has some modicum of support for linux-side directories (!) which
|
||||
// CreateProcess never will.
|
||||
static std::tuple<std::wstring, std::wstring> _tryMangleStartingDirectoryForWSL(std::wstring_view commandLine, std::wstring_view startingDirectory)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (startingDirectory.size() > 0 && commandLine.size() >= 3)
|
||||
{ // "wsl" is three characters; this is a safe bet. no point in doing it if there's no starting directory though!
|
||||
// Find the first space, quote or the end of the string -- we'll look for wsl before that.
|
||||
const auto terminator{ commandLine.find_first_of(LR"(" )", 1) }; // look past the first character in case it starts with "
|
||||
const auto start{ til::at(commandLine, 0) == L'"' ? 1 : 0 };
|
||||
const std::filesystem::path executablePath{ commandLine.substr(start, terminator - start) };
|
||||
const auto executableFilename{ executablePath.filename().wstring() };
|
||||
if (executableFilename == L"wsl" || executableFilename == L"wsl.exe")
|
||||
{
|
||||
// We've got a WSL -- let's just make sure it's the right one.
|
||||
if (executablePath.has_parent_path())
|
||||
{
|
||||
std::wstring systemDirectory{};
|
||||
if (FAILED(wil::GetSystemDirectoryW(systemDirectory)))
|
||||
{
|
||||
break; // just bail out.
|
||||
}
|
||||
if (executablePath.parent_path().wstring() != systemDirectory)
|
||||
{
|
||||
break; // it wasn't in system32!
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// assume that unqualified WSL is the one in system32 (minor danger)
|
||||
}
|
||||
|
||||
const auto arguments{ terminator == std::wstring_view::npos ? std::wstring_view{} : commandLine.substr(terminator + 1) };
|
||||
if (arguments.find(L"--cd") != std::wstring_view::npos)
|
||||
{
|
||||
break; // they've already got a --cd!
|
||||
}
|
||||
|
||||
const auto tilde{ arguments.find_first_of(L'~') };
|
||||
if (tilde != std::wstring_view::npos)
|
||||
{
|
||||
if (tilde + 1 == arguments.size() || til::at(arguments, tilde + 1) == L' ')
|
||||
{
|
||||
// We want to suppress --cd if they have added a bare ~ to their commandline (they conflict).
|
||||
break;
|
||||
}
|
||||
// Tilde followed by non-space should be okay (like, wsl -d Debian ~/blah.sh)
|
||||
}
|
||||
|
||||
return {
|
||||
fmt::format(LR"("{}" --cd "{}" {})", executablePath.wstring(), startingDirectory, arguments),
|
||||
std::wstring{}
|
||||
};
|
||||
}
|
||||
}
|
||||
} while (false);
|
||||
|
||||
return {
|
||||
std::wstring{ commandLine },
|
||||
std::wstring{ startingDirectory }
|
||||
};
|
||||
}
|
||||
|
||||
// Function Description:
|
||||
// - launches the client application attached to the new pseudoconsole
|
||||
HRESULT ConptyConnection::_LaunchAttachedClient() noexcept
|
||||
@@ -165,11 +98,8 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||
environment.clear();
|
||||
});
|
||||
|
||||
{
|
||||
const auto newEnvironmentBlock{ Utils::CreateEnvironmentBlock() };
|
||||
// Populate the environment map with the current environment.
|
||||
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment, newEnvironmentBlock.get()));
|
||||
}
|
||||
// Populate the environment map with the current environment.
|
||||
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment));
|
||||
|
||||
{
|
||||
// Convert connection Guid to string and ignore the enclosing '{}'.
|
||||
@@ -233,7 +163,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||
siEx.StartupInfo.lpTitle = mutableTitle.data();
|
||||
}
|
||||
|
||||
auto [newCommandLine, newStartingDirectory] = _tryMangleStartingDirectoryForWSL(cmdline, _startingDirectory);
|
||||
auto [newCommandLine, newStartingDirectory] = Utils::MangleStartingDirectoryForWSL(cmdline, _startingDirectory);
|
||||
const wchar_t* const startingDirectory = newStartingDirectory.size() > 0 ? newStartingDirectory.c_str() : nullptr;
|
||||
|
||||
RETURN_IF_WIN32_BOOL_FALSE(CreateProcessW(
|
||||
@@ -429,8 +359,9 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||
// EXIT POINT
|
||||
const auto hr = wil::ResultFromCaughtException();
|
||||
|
||||
// GH#11556 - make sure to format the error code to this string as an UNSIGNED int
|
||||
winrt::hstring failureText{ fmt::format(std::wstring_view{ RS_(L"ProcessFailedToLaunch") },
|
||||
fmt::format(_errorFormat, hr),
|
||||
fmt::format(_errorFormat, static_cast<unsigned int>(hr)),
|
||||
_commandline) };
|
||||
_TerminalOutputHandlers(failureText);
|
||||
|
||||
@@ -457,6 +388,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||
{
|
||||
try
|
||||
{
|
||||
// GH#11556 - make sure to format the error code to this string as an UNSIGNED int
|
||||
winrt::hstring exitText{ fmt::format(std::wstring_view{ RS_(L"ProcessExited") }, fmt::format(_errorFormat, status)) };
|
||||
_TerminalOutputHandlers(L"\r\n");
|
||||
_TerminalOutputHandlers(exitText);
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="vcpkg-cpprestsdk" version="2.10.14" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -970,6 +970,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
textData += text;
|
||||
}
|
||||
|
||||
const auto bgColor = _terminal->GetAttributeColors({}).second;
|
||||
|
||||
// convert text to HTML format
|
||||
// GH#5347 - Don't provide a title for the generated HTML, as many
|
||||
// web applications will paste the title first, followed by the HTML
|
||||
@@ -978,7 +980,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
TextBuffer::GenHTML(bufferData,
|
||||
_actualFont.GetUnscaledSize().Y,
|
||||
_actualFont.GetFaceName(),
|
||||
til::color{ _settings.DefaultBackground() }) :
|
||||
bgColor) :
|
||||
"";
|
||||
|
||||
// convert to RTF format
|
||||
@@ -986,7 +988,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
TextBuffer::GenRTF(bufferData,
|
||||
_actualFont.GetUnscaledSize().Y,
|
||||
_actualFont.GetFaceName(),
|
||||
til::color{ _settings.DefaultBackground() }) :
|
||||
bgColor) :
|
||||
"";
|
||||
|
||||
if (!_settings.CopyOnSelect())
|
||||
@@ -1283,12 +1285,18 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
::Search search(*GetUiaData(), text.c_str(), direction, sensitivity);
|
||||
auto lock = _terminal->LockForWriting();
|
||||
if (search.FindNext())
|
||||
const bool foundMatch{ search.FindNext() };
|
||||
if (foundMatch)
|
||||
{
|
||||
_terminal->SetBlockSelection(false);
|
||||
search.Select();
|
||||
_renderer->TriggerSelection();
|
||||
}
|
||||
|
||||
// Raise a FoundMatch event, which the control will use to notify
|
||||
// narrator if there was any results in the buffer
|
||||
auto foundResults = winrt::make_self<implementation::FoundResultsArgs>(foundMatch);
|
||||
_FoundMatchHandlers(*this, *foundResults);
|
||||
}
|
||||
|
||||
void ControlCore::SetBackgroundOpacity(const double opacity)
|
||||
|
||||
@@ -171,6 +171,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
TYPED_EVENT(RaiseNotice, IInspectable, Control::NoticeEventArgs);
|
||||
TYPED_EVENT(TransparencyChanged, IInspectable, Control::TransparencyChangedEventArgs);
|
||||
TYPED_EVENT(ReceivedOutput, IInspectable, IInspectable);
|
||||
TYPED_EVENT(FoundMatch, IInspectable, Control::FoundResultsArgs);
|
||||
// clang-format on
|
||||
|
||||
private:
|
||||
|
||||
@@ -110,6 +110,7 @@ namespace Microsoft.Terminal.Control
|
||||
event Windows.Foundation.TypedEventHandler<Object, NoticeEventArgs> RaiseNotice;
|
||||
event Windows.Foundation.TypedEventHandler<Object, TransparencyChangedEventArgs> TransparencyChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> ReceivedOutput;
|
||||
event Windows.Foundation.TypedEventHandler<Object, FoundResultsArgs> FoundMatch;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,3 +11,4 @@
|
||||
#include "ScrollPositionChangedArgs.g.cpp"
|
||||
#include "RendererWarningArgs.g.cpp"
|
||||
#include "TransparencyChangedEventArgs.g.cpp"
|
||||
#include "FoundResultsArgs.g.cpp"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ScrollPositionChangedArgs.g.h"
|
||||
#include "RendererWarningArgs.g.h"
|
||||
#include "TransparencyChangedEventArgs.g.h"
|
||||
#include "FoundResultsArgs.g.h"
|
||||
#include "cppwinrt_utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
@@ -131,4 +132,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
WINRT_PROPERTY(double, Opacity);
|
||||
};
|
||||
|
||||
struct FoundResultsArgs : public FoundResultsArgsT<FoundResultsArgs>
|
||||
{
|
||||
public:
|
||||
FoundResultsArgs(const bool foundMatch) :
|
||||
_FoundMatch(foundMatch)
|
||||
{
|
||||
}
|
||||
|
||||
WINRT_PROPERTY(bool, FoundMatch);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,4 +67,10 @@ namespace Microsoft.Terminal.Control
|
||||
{
|
||||
Double Opacity { get; };
|
||||
}
|
||||
|
||||
|
||||
runtimeclass FoundResultsArgs
|
||||
{
|
||||
Boolean FoundMatch { get; };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,4 +200,12 @@ Please either install the missing font or choose another one.</value>
|
||||
<data name="TermControlReadOnly" xml:space="preserve">
|
||||
<value>Read-only mode is enabled.</value>
|
||||
</data>
|
||||
<data name="SearchBox_MatchesAvailable" xml:space="preserve">
|
||||
<value>Results found</value>
|
||||
<comment>Announced to a screen reader when the user searches for some text and there are matches for that text in the terminal.</comment>
|
||||
</data>
|
||||
<data name="SearchBox_NoMatches" xml:space="preserve">
|
||||
<value>No results found</value>
|
||||
<comment>Announced to a screen reader when the user searches for some text and there are no matches for that text in the terminal.</comment>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_core.TransparencyChanged({ this, &TermControl::_coreTransparencyChanged });
|
||||
_core.RaiseNotice({ this, &TermControl::_coreRaisedNotice });
|
||||
_core.HoveredHyperlinkChanged({ this, &TermControl::_hoveredHyperlinkChanged });
|
||||
_core.FoundMatch({ this, &TermControl::_coreFoundMatch });
|
||||
_interactivity.OpenHyperlink({ this, &TermControl::_HyperlinkHandler });
|
||||
_interactivity.ScrollPositionChanged({ this, &TermControl::_ScrollPositionChanged });
|
||||
|
||||
@@ -692,8 +693,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_cursorTimer.emplace(std::move(cursorTimer));
|
||||
// As of GH#6586, don't start the cursor timer immediately, and
|
||||
// don't show the cursor initially. We'll show the cursor and start
|
||||
// the timer when the control is first focused. cursorTimer.Start();
|
||||
_core.CursorOn(false);
|
||||
// the timer when the control is first focused.
|
||||
//
|
||||
// As of GH#11411, turn on the cursor if we've already been marked
|
||||
// as focused. We suspect that it's possible for the Focused event
|
||||
// to fire before the LayoutUpdated. In that case, the
|
||||
// _GotFocusHandler would mark us _focused, but find that a
|
||||
// _cursorTimer doesn't exist, and it would never turn on the
|
||||
// cursor. To mitigate, we'll initialize the cursor's 'on' state
|
||||
// with `_focused` here.
|
||||
_core.CursorOn(_focused);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -753,12 +762,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_HidePointerCursorHandlers(*this, nullptr);
|
||||
|
||||
const auto ch = e.Character();
|
||||
const auto scanCode = gsl::narrow_cast<WORD>(e.KeyStatus().ScanCode);
|
||||
const auto keyStatus = e.KeyStatus();
|
||||
const auto scanCode = gsl::narrow_cast<WORD>(keyStatus.ScanCode);
|
||||
auto modifiers = _GetPressedModifierKeys();
|
||||
if (e.KeyStatus().IsExtendedKey)
|
||||
|
||||
if (keyStatus.IsExtendedKey)
|
||||
{
|
||||
modifiers |= ControlKeyStates::EnhancedKey;
|
||||
}
|
||||
|
||||
const bool handled = _core.SendCharEvent(ch, scanCode, modifiers);
|
||||
e.Handled(handled);
|
||||
}
|
||||
@@ -853,6 +865,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
const auto scanCode = gsl::narrow_cast<WORD>(keyStatus.ScanCode);
|
||||
auto modifiers = _GetPressedModifierKeys();
|
||||
|
||||
if (keyStatus.IsExtendedKey)
|
||||
{
|
||||
modifiers |= ControlKeyStates::EnhancedKey;
|
||||
}
|
||||
|
||||
// GH#11076:
|
||||
// For some weird reason we sometimes receive a WM_KEYDOWN
|
||||
// message without vkey or scanCode if a user drags a tab.
|
||||
@@ -886,11 +903,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
if (keyStatus.IsExtendedKey)
|
||||
{
|
||||
modifiers |= ControlKeyStates::EnhancedKey;
|
||||
}
|
||||
|
||||
// Alt-Numpad# input will send us a character once the user releases
|
||||
// Alt, so we should be ignoring the individual keydowns. The character
|
||||
// will be sent through the TSFInputControl. See GH#1401 for more
|
||||
@@ -968,7 +980,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
void TermControl::_ClearKeyboardState(const WORD vkey, const WORD scanCode) const noexcept
|
||||
void TermControl::_ClearKeyboardState(const WORD vkey, const WORD scanCode) noexcept
|
||||
{
|
||||
std::array<BYTE, 256> keyState;
|
||||
if (!GetKeyboardState(keyState.data()))
|
||||
@@ -2042,7 +2054,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// don't necessarily include that state.
|
||||
// Return Value:
|
||||
// - The Microsoft::Terminal::Core::ControlKeyStates representing the modifier key states.
|
||||
ControlKeyStates TermControl::_GetPressedModifierKeys() const
|
||||
ControlKeyStates TermControl::_GetPressedModifierKeys() noexcept
|
||||
{
|
||||
const CoreWindow window = CoreWindow::GetForCurrentThread();
|
||||
// DONT USE
|
||||
@@ -2590,4 +2602,28 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
return _core.ReadEntireBuffer();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called when the core raises a FoundMatch event. That's done in response
|
||||
// to us starting a search query with ControlCore::Search.
|
||||
// - The args will tell us if there were or were not any results for that
|
||||
// particular search. We'll use that to control what to announce to
|
||||
// Narrator. When we have more elaborate search information to report, we
|
||||
// may want to report that here. (see GH #3920)
|
||||
// Arguments:
|
||||
// - args: contains information about the results that were or were not found.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TermControl::_coreFoundMatch(const IInspectable& /*sender*/, const Control::FoundResultsArgs& args)
|
||||
{
|
||||
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(*this) })
|
||||
{
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
args.FoundMatch() ? RS_(L"SearchBox_MatchesAvailable") : RS_(L"SearchBox_NoMatches"), // what to announce if results were found
|
||||
L"SearchBoxResultAnnouncement" /* unique name for this group of notifications */);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -250,9 +250,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void _UpdateAutoScroll(Windows::Foundation::IInspectable const& sender, Windows::Foundation::IInspectable const& e);
|
||||
|
||||
void _KeyHandler(Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e, const bool keyDown);
|
||||
::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() const;
|
||||
static ::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() noexcept;
|
||||
bool _TryHandleKeyBinding(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const;
|
||||
void _ClearKeyboardState(const WORD vkey, const WORD scanCode) const noexcept;
|
||||
static void _ClearKeyboardState(const WORD vkey, const WORD scanCode) noexcept;
|
||||
bool _TrySendKeyEvent(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
|
||||
|
||||
const til::point _toTerminalOrigin(winrt::Windows::Foundation::Point cursorPosition);
|
||||
@@ -274,6 +274,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
winrt::fire_and_forget _coreTransparencyChanged(IInspectable sender, Control::TransparencyChangedEventArgs args);
|
||||
void _coreRaisedNotice(const IInspectable& s, const Control::NoticeEventArgs& args);
|
||||
void _coreWarningBell(const IInspectable& sender, const IInspectable& args);
|
||||
void _coreFoundMatch(const IInspectable& sender, const Control::FoundResultsArgs& args);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
// A lot of code was taken from
|
||||
// https://github.com/Maximus5/ConEmu/blob/master/src/ConEmu/ColorFix.cpp
|
||||
// and then adjusted to fit our style guidelines
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include "ColorFix.hpp"
|
||||
|
||||
static constexpr double gMinThreshold = 12.0;
|
||||
static constexpr double gExpThreshold = 20.0;
|
||||
static constexpr double gLStep = 5.0;
|
||||
|
||||
static constexpr double rad006 = 0.104719755119659774;
|
||||
static constexpr double rad025 = 0.436332312998582394;
|
||||
static constexpr double rad030 = 0.523598775598298873;
|
||||
static constexpr double rad060 = 1.047197551196597746;
|
||||
static constexpr double rad063 = 1.099557428756427633;
|
||||
static constexpr double rad180 = 3.141592653589793238;
|
||||
static constexpr double rad275 = 4.799655442984406336;
|
||||
static constexpr double rad360 = 6.283185307179586476;
|
||||
|
||||
ColorFix::ColorFix(COLORREF color)
|
||||
{
|
||||
rgb = color;
|
||||
_ToLab();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper function to calculate HPrime
|
||||
double ColorFix::_GetHPrimeFn(double x, double y)
|
||||
{
|
||||
if (x == 0 && y == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const auto hueAngle = atan2(x, y);
|
||||
return hueAngle >= 0 ? hueAngle : hueAngle + rad360;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Given 2 colors, computes the DeltaE value between them
|
||||
// Arguments:
|
||||
// - x1: the first color
|
||||
// - x2: the second color
|
||||
// Return Value:
|
||||
// - The DeltaE value between x1 and x2
|
||||
double ColorFix::_GetDeltaE(ColorFix x1, ColorFix x2)
|
||||
{
|
||||
constexpr double kSubL = 1;
|
||||
constexpr double kSubC = 1;
|
||||
constexpr double kSubH = 1;
|
||||
|
||||
// Delta L Prime
|
||||
const double deltaLPrime = x2.L - x1.L;
|
||||
|
||||
// L Bar
|
||||
const double lBar = (x1.L + x2.L) / 2;
|
||||
|
||||
// C1 & C2
|
||||
const double c1 = sqrt(pow(x1.A, 2) + pow(x1.B, 2));
|
||||
const double c2 = sqrt(pow(x2.A, 2) + pow(x2.B, 2));
|
||||
|
||||
// C Bar
|
||||
const double cBar = (c1 + c2) / 2;
|
||||
|
||||
// A Prime 1
|
||||
const double aPrime1 = x1.A + (x1.A / 2) * (1 - sqrt(pow(cBar, 7) / (pow(cBar, 7) + pow(25.0, 7))));
|
||||
|
||||
// A Prime 2
|
||||
const double aPrime2 = x2.A + (x2.A / 2) * (1 - sqrt(pow(cBar, 7) / (pow(cBar, 7) + pow(25.0, 7))));
|
||||
|
||||
// C Prime 1
|
||||
const double cPrime1 = sqrt(pow(aPrime1, 2) + pow(x1.B, 2));
|
||||
|
||||
// C Prime 2
|
||||
const double cPrime2 = sqrt(pow(aPrime2, 2) + pow(x2.B, 2));
|
||||
|
||||
// C Bar Prime
|
||||
const double cBarPrime = (cPrime1 + cPrime2) / 2;
|
||||
|
||||
// Delta C Prime
|
||||
const double deltaCPrime = cPrime2 - cPrime1;
|
||||
|
||||
// S sub L
|
||||
const double sSubL = 1 + ((0.015 * pow(lBar - 50, 2)) / sqrt(20 + pow(lBar - 50, 2)));
|
||||
|
||||
// S sub C
|
||||
const double sSubC = 1 + 0.045 * cBarPrime;
|
||||
|
||||
// h Prime 1
|
||||
const double hPrime1 = _GetHPrimeFn(x1.B, aPrime1);
|
||||
|
||||
// h Prime 2
|
||||
const double hPrime2 = _GetHPrimeFn(x2.B, aPrime2);
|
||||
|
||||
// Delta H Prime
|
||||
const double deltaHPrime = 0 == c1 || 0 == c2 ? 0 : 2 * sqrt(cPrime1 * cPrime2) * sin(abs(hPrime1 - hPrime2) <= rad180 ? hPrime2 - hPrime1 : (hPrime2 <= hPrime1 ? hPrime2 - hPrime1 + rad360 : hPrime2 - hPrime1 - rad360) / 2);
|
||||
|
||||
// H Bar Prime
|
||||
const double hBarPrime = (abs(hPrime1 - hPrime2) > rad180) ? (hPrime1 + hPrime2 + rad360) / 2 : (hPrime1 + hPrime2) / 2;
|
||||
|
||||
// T
|
||||
const double t = 1 - 0.17 * cos(hBarPrime - rad030) + 0.24 * cos(2 * hBarPrime) + 0.32 * cos(3 * hBarPrime + rad006) - 0.20 * cos(4 * hBarPrime - rad063);
|
||||
|
||||
// S sub H
|
||||
const double sSubH = 1 + 0.015 * cBarPrime * t;
|
||||
|
||||
// R sub T
|
||||
const double rSubT = -2 * sqrt(pow(cBarPrime, 7) / (pow(cBarPrime, 7) + pow(25.0, 7))) * sin(rad060 * exp(-pow((hBarPrime - rad275) / rad025, 2)));
|
||||
|
||||
// Put it all together!
|
||||
const double lightness = deltaLPrime / (kSubL * sSubL);
|
||||
const double chroma = deltaCPrime / (kSubC * sSubC);
|
||||
const double hue = deltaHPrime / (kSubH * sSubH);
|
||||
|
||||
return sqrt(pow(lightness, 2) + pow(chroma, 2) + pow(hue, 2) + rSubT * chroma * hue);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Populates our L, A, B values, based on our r, g, b values
|
||||
// - Converts a color in rgb format to a color in lab format
|
||||
// - Reference: http://www.easyrgb.com/index.php?X=MATH&H=01#text1
|
||||
void ColorFix::_ToLab()
|
||||
{
|
||||
double var_R = r / 255.0;
|
||||
double var_G = g / 255.0;
|
||||
double var_B = b / 255.0;
|
||||
|
||||
var_R = var_R > 0.04045 ? pow(((var_R + 0.055) / 1.055), 2.4) : var_R / 12.92;
|
||||
var_G = var_G > 0.04045 ? pow(((var_G + 0.055) / 1.055), 2.4) : var_G / 12.92;
|
||||
var_B = var_B > 0.04045 ? pow(((var_B + 0.055) / 1.055), 2.4) : var_B / 12.92;
|
||||
|
||||
var_R = var_R * 100.;
|
||||
var_G = var_G * 100.;
|
||||
var_B = var_B * 100.;
|
||||
|
||||
//Observer. = 2 degrees, Illuminant = D65
|
||||
const double X = var_R * 0.4124 + var_G * 0.3576 + var_B * 0.1805;
|
||||
const double Y = var_R * 0.2126 + var_G * 0.7152 + var_B * 0.0722;
|
||||
const double Z = var_R * 0.0193 + var_G * 0.1192 + var_B * 0.9505;
|
||||
|
||||
double var_X = X / 95.047; //ref_X = 95.047 (Observer= 2 degrees, Illuminant= D65)
|
||||
double var_Y = Y / 100.000; //ref_Y = 100.000
|
||||
double var_Z = Z / 108.883; //ref_Z = 108.883
|
||||
|
||||
var_X = var_X > 0.008856 ? pow(var_X, (1. / 3.)) : (7.787 * var_X) + (16. / 116.);
|
||||
var_Y = var_Y > 0.008856 ? pow(var_Y, (1. / 3.)) : (7.787 * var_Y) + (16. / 116.);
|
||||
var_Z = var_Z > 0.008856 ? pow(var_Z, (1. / 3.)) : (7.787 * var_Z) + (16. / 116.);
|
||||
|
||||
L = (116. * var_Y) - 16.;
|
||||
A = 500. * (var_X - var_Y);
|
||||
B = 200. * (var_Y - var_Z);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Populates our r, g, b values, based on our L, A, B values
|
||||
// - Converts a color in lab format to a color in rgb format
|
||||
// - Reference: http://www.easyrgb.com/index.php?X=MATH&H=01#text1
|
||||
void ColorFix::_ToRGB()
|
||||
{
|
||||
double var_Y = (L + 16.) / 116.;
|
||||
double var_X = A / 500. + var_Y;
|
||||
double var_Z = var_Y - B / 200.;
|
||||
|
||||
var_Y = (pow(var_Y, 3) > 0.008856) ? pow(var_Y, 3) : (var_Y - 16. / 116.) / 7.787;
|
||||
var_X = (pow(var_X, 3) > 0.008856) ? pow(var_X, 3) : (var_X - 16. / 116.) / 7.787;
|
||||
var_Z = (pow(var_Z, 3) > 0.008856) ? pow(var_Z, 3) : (var_Z - 16. / 116.) / 7.787;
|
||||
|
||||
double X = 95.047 * var_X; //ref_X = 95.047 (Observer= 2 degrees, Illuminant= D65)
|
||||
double Y = 100.000 * var_Y; //ref_Y = 100.000
|
||||
double Z = 108.883 * var_Z; //ref_Z = 108.883
|
||||
|
||||
var_X = X / 100.; //X from 0 to 95.047 (Observer = 2 degrees, Illuminant = D65)
|
||||
var_Y = Y / 100.; //Y from 0 to 100.000
|
||||
var_Z = Z / 100.; //Z from 0 to 108.883
|
||||
|
||||
double var_R = var_X * 3.2406 + var_Y * -1.5372 + var_Z * -0.4986;
|
||||
double var_G = var_X * -0.9689 + var_Y * 1.8758 + var_Z * 0.0415;
|
||||
double var_B = var_X * 0.0557 + var_Y * -0.2040 + var_Z * 1.0570;
|
||||
|
||||
var_R = var_R > 0.0031308 ? 1.055 * pow(var_R, (1 / 2.4)) - 0.055 : var_R = 12.92 * var_R;
|
||||
var_G = var_G > 0.0031308 ? 1.055 * pow(var_G, (1 / 2.4)) - 0.055 : var_G = 12.92 * var_G;
|
||||
var_B = var_B > 0.0031308 ? 1.055 * pow(var_B, (1 / 2.4)) - 0.055 : var_B = 12.92 * var_B;
|
||||
|
||||
r = (BYTE)std::clamp(var_R * 255., 0., 255.);
|
||||
g = (BYTE)std::clamp(var_G * 255., 0., 255.);
|
||||
b = (BYTE)std::clamp(var_B * 255., 0., 255.);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Given foreground and background colors, change the foreground color to
|
||||
// make it more perceivable if necessary
|
||||
// - Arguments:
|
||||
// - fg: the foreground color
|
||||
// - bg: the background color
|
||||
// - Return Value:
|
||||
// - The foreground color after performing any necessary changes to make it more perceivable
|
||||
COLORREF ColorFix::GetPerceivableColor(COLORREF fg, COLORREF bg)
|
||||
{
|
||||
ColorFix backLab(bg);
|
||||
ColorFix frontLab(fg);
|
||||
const double de1 = _GetDeltaE(frontLab, backLab);
|
||||
if (de1 < gMinThreshold)
|
||||
{
|
||||
for (int i = 0; i <= 1; i++)
|
||||
{
|
||||
const double step = (i == 0) ? gLStep : -gLStep;
|
||||
frontLab.L += step;
|
||||
|
||||
while (((i == 0) && (frontLab.L <= 100)) || ((i == 1) && (frontLab.L >= 0)))
|
||||
{
|
||||
const double de2 = _GetDeltaE(frontLab, backLab);
|
||||
if (de2 >= gExpThreshold)
|
||||
{
|
||||
frontLab._ToRGB();
|
||||
return frontLab.rgb;
|
||||
}
|
||||
frontLab.L += step;
|
||||
}
|
||||
}
|
||||
}
|
||||
return frontLab.rgb;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- ColorFix
|
||||
|
||||
Abstract:
|
||||
- Implementation of perceptual color nudging, which allows the Terminal
|
||||
to slightly shift the foreground color to make it more perceivable on
|
||||
the current background (for cases where the foreground is very close
|
||||
to being imperceivable on the background).
|
||||
|
||||
Author(s):
|
||||
- Pankaj Bhojwani - Sep 2021
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct ColorFix
|
||||
{
|
||||
public:
|
||||
ColorFix(COLORREF color);
|
||||
|
||||
static COLORREF GetPerceivableColor(COLORREF fg, COLORREF bg);
|
||||
|
||||
// RGB
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
BYTE r, g, b, dummy;
|
||||
};
|
||||
COLORREF rgb;
|
||||
};
|
||||
|
||||
// Lab
|
||||
struct
|
||||
{
|
||||
double L, A, B;
|
||||
};
|
||||
|
||||
private:
|
||||
static double _GetHPrimeFn(double x, double y);
|
||||
static double _GetDeltaE(ColorFix x1, ColorFix x2);
|
||||
void _ToLab();
|
||||
void _ToRGB();
|
||||
};
|
||||
@@ -67,6 +67,5 @@ namespace Microsoft.Terminal.Core
|
||||
CursorStyle CursorShape;
|
||||
UInt32 CursorHeight;
|
||||
Boolean IntenseIsBright;
|
||||
Boolean AdjustIndistinguishableColors;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,8 +53,7 @@ Terminal::Terminal() :
|
||||
_taskbarState{ 0 },
|
||||
_taskbarProgress{ 0 },
|
||||
_trimBlockSelection{ false },
|
||||
_intenseIsBright{ true },
|
||||
_adjustIndistinguishableColors{ true }
|
||||
_intenseIsBright{ true }
|
||||
{
|
||||
auto dispatch = std::make_unique<TerminalDispatch>(*this);
|
||||
auto engine = std::make_unique<OutputStateMachineEngine>(std::move(dispatch));
|
||||
@@ -176,16 +175,11 @@ void Terminal::UpdateAppearance(const ICoreAppearance& appearance)
|
||||
_defaultBg = newBackgroundColor.with_alpha(0);
|
||||
_defaultFg = appearance.DefaultForeground();
|
||||
_intenseIsBright = appearance.IntenseIsBright();
|
||||
_adjustIndistinguishableColors = appearance.AdjustIndistinguishableColors();
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
_colorTable.at(i) = til::color{ appearance.GetColorTableEntry(i) };
|
||||
}
|
||||
if (_adjustIndistinguishableColors)
|
||||
{
|
||||
_MakeAdjustedColorArray();
|
||||
}
|
||||
|
||||
CursorType cursorShape = CursorType::VerticalBar;
|
||||
switch (appearance.CursorShape())
|
||||
@@ -431,7 +425,21 @@ void Terminal::Write(std::wstring_view stringView)
|
||||
{
|
||||
auto lock = LockForWriting();
|
||||
|
||||
auto& cursor = _buffer->GetCursor();
|
||||
const til::point cursorPosBefore{ cursor.GetPosition() };
|
||||
|
||||
_stateMachine->ProcessString(stringView);
|
||||
|
||||
const til::point cursorPosAfter{ cursor.GetPosition() };
|
||||
|
||||
// Firing the CursorPositionChanged event is very expensive so we try not to
|
||||
// do that when the cursor does not need to be redrawn. We don't do this
|
||||
// inside _AdjustCursorPosition, only once we're done writing the whole run
|
||||
// of output.
|
||||
if (cursorPosBefore != cursorPosAfter)
|
||||
{
|
||||
_NotifyTerminalCursorPositionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void Terminal::WritePastedText(std::wstring_view stringView)
|
||||
@@ -1093,13 +1101,6 @@ void Terminal::_AdjustCursorPosition(const COORD proposedPosition)
|
||||
COORD delta{ 0, -rowsPushedOffTopOfBuffer };
|
||||
_buffer->GetRenderTarget().TriggerScroll(&delta);
|
||||
}
|
||||
|
||||
// Firing the CursorPositionChanged event is very expensive so we try not to do that when
|
||||
// the cursor does not need to be redrawn.
|
||||
if (!cursor.IsDeferDrawing())
|
||||
{
|
||||
_NotifyTerminalCursorPositionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void Terminal::UserScrollViewport(const int viewTop)
|
||||
|
||||
@@ -301,7 +301,6 @@ private:
|
||||
bool _bracketedPasteMode;
|
||||
bool _trimBlockSelection;
|
||||
bool _intenseIsBright;
|
||||
bool _adjustIndistinguishableColors;
|
||||
|
||||
size_t _taskbarState;
|
||||
size_t _taskbarProgress;
|
||||
@@ -402,9 +401,6 @@ private:
|
||||
|
||||
Microsoft::Console::VirtualTerminal::SgrStack _sgrStack;
|
||||
|
||||
void _MakeAdjustedColorArray();
|
||||
std::array<std::array<COLORREF, 18>, 18> _adjustedForegroundColors;
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
friend class TerminalCoreUnitTests::TerminalBufferTests;
|
||||
friend class TerminalCoreUnitTests::TerminalApiTest;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<ClCompile Include="..\TerminalSelection.cpp" />
|
||||
<ClCompile Include="..\TerminalApi.cpp" />
|
||||
<ClCompile Include="..\Terminal.cpp" />
|
||||
<ClCompile Include="..\ColorFix.cpp" />
|
||||
<ClCompile Include="..\pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@@ -20,7 +19,6 @@
|
||||
<ClInclude Include="..\ITerminalApi.hpp" />
|
||||
<ClInclude Include="..\pch.h" />
|
||||
<ClInclude Include="..\Terminal.hpp" />
|
||||
<ClInclude Include="..\ColorFix.hpp" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,16 +3,11 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "Terminal.hpp"
|
||||
#include "ColorFix.hpp"
|
||||
#include <DefaultSettings.h>
|
||||
|
||||
using namespace Microsoft::Terminal::Core;
|
||||
using namespace Microsoft::Console::Types;
|
||||
using namespace Microsoft::Console::Render;
|
||||
|
||||
static constexpr size_t DefaultBgIndex{ 16 };
|
||||
static constexpr size_t DefaultFgIndex{ 17 };
|
||||
|
||||
Viewport Terminal::GetViewport() noexcept
|
||||
{
|
||||
return _GetVisibleViewport();
|
||||
@@ -49,47 +44,14 @@ const TextAttribute Terminal::GetDefaultBrushColors() noexcept
|
||||
|
||||
std::pair<COLORREF, COLORREF> Terminal::GetAttributeColors(const TextAttribute& attr) const noexcept
|
||||
{
|
||||
std::pair<COLORREF, COLORREF> colors;
|
||||
_blinkingState.RecordBlinkingUsage(attr);
|
||||
const auto fgTextColor = attr.GetForeground();
|
||||
const auto bgTextColor = attr.GetBackground();
|
||||
|
||||
// We want to nudge the foreground color to make it more perceivable only for the
|
||||
// default color pairs within the color table
|
||||
if (_adjustIndistinguishableColors &&
|
||||
!(attr.IsFaint() || (attr.IsBlinking() && _blinkingState.IsBlinkingFaint())) &&
|
||||
(fgTextColor.IsDefault() || fgTextColor.IsLegacy()) &&
|
||||
(bgTextColor.IsDefault() || bgTextColor.IsLegacy()))
|
||||
{
|
||||
const auto bgIndex = bgTextColor.IsDefault() ? DefaultBgIndex : bgTextColor.GetIndex();
|
||||
auto fgIndex = fgTextColor.IsDefault() ? DefaultFgIndex : fgTextColor.GetIndex();
|
||||
|
||||
if (fgTextColor.IsIndex16() && (fgIndex < 8) && attr.IsBold() && _intenseIsBright)
|
||||
{
|
||||
// There is a special case for bold here - we need to get the bright version of the foreground color
|
||||
fgIndex += 8;
|
||||
}
|
||||
|
||||
if (attr.IsReverseVideo() ^ _screenReversed)
|
||||
{
|
||||
colors.first = _adjustedForegroundColors[fgIndex][bgIndex];
|
||||
colors.second = fgTextColor.GetColor(_colorTable, _defaultFg);
|
||||
}
|
||||
else
|
||||
{
|
||||
colors.first = _adjustedForegroundColors[bgIndex][fgIndex];
|
||||
colors.second = bgTextColor.GetColor(_colorTable, _defaultBg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
colors = attr.CalculateRgbColors(_colorTable,
|
||||
_defaultFg,
|
||||
_defaultBg,
|
||||
_screenReversed,
|
||||
_blinkingState.IsBlinkingFaint(),
|
||||
_intenseIsBright);
|
||||
}
|
||||
auto colors = attr.CalculateRgbColors(
|
||||
_colorTable,
|
||||
_defaultFg,
|
||||
_defaultBg,
|
||||
_screenReversed,
|
||||
_blinkingState.IsBlinkingFaint(),
|
||||
_intenseIsBright);
|
||||
colors.first |= 0xff000000;
|
||||
// We only care about alpha for the default BG (which enables acrylic)
|
||||
// If the bg isn't the default bg color, or reverse video is enabled, make it fully opaque.
|
||||
@@ -300,34 +262,3 @@ const bool Terminal::IsUiaDataInitialized() const noexcept
|
||||
// UiaData are not yet initialized.
|
||||
return !!_buffer;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates the adjusted color array, which contains the possible foreground colors,
|
||||
// adjusted for perceivability
|
||||
// - The adjusted color array is 2-d, and effectively maps a background and foreground
|
||||
// color pair to the adjusted foreground for that color pair
|
||||
void Terminal::_MakeAdjustedColorArray()
|
||||
{
|
||||
// The color table has 16 colors, but the adjusted color table needs to be 18
|
||||
// to include the default background and default foreground colors
|
||||
std::array<COLORREF, 18> colorTableWithDefaults;
|
||||
std::copy_n(std::begin(_colorTable), 16, std::begin(colorTableWithDefaults));
|
||||
colorTableWithDefaults[DefaultBgIndex] = _defaultBg;
|
||||
colorTableWithDefaults[DefaultFgIndex] = _defaultFg;
|
||||
for (auto fgIndex = 0; fgIndex < 18; ++fgIndex)
|
||||
{
|
||||
const auto fg = til::at(colorTableWithDefaults, fgIndex);
|
||||
for (auto bgIndex = 0; bgIndex < 18; ++bgIndex)
|
||||
{
|
||||
if (fgIndex == bgIndex)
|
||||
{
|
||||
_adjustedForegroundColors[bgIndex][fgIndex] = fg;
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto bg = til::at(colorTableWithDefaults, bgIndex);
|
||||
_adjustedForegroundColors[bgIndex][fgIndex] = ColorFix::GetPerceivableColor(fg, bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
#include "AddProfilePageNavigationState.g.cpp"
|
||||
#include "EnumEntry.h"
|
||||
|
||||
#include <LibraryResources.h>
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Navigation;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
@@ -18,6 +21,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
AddProfile::AddProfile()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Automation::AutomationProperties::SetName(AddNewButton(), RS_(L"AddProfile_AddNewTextBlock/Text"));
|
||||
Automation::AutomationProperties::SetName(DuplicateButton(), RS_(L"AddProfile_DuplicateTextBlock/Text"));
|
||||
}
|
||||
|
||||
void AddProfile::OnNavigatedTo(const NavigationEventArgs& e)
|
||||
@@ -39,4 +45,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
_State.RequestDuplicate(selected.try_as<Model::Profile>().Guid());
|
||||
}
|
||||
}
|
||||
|
||||
void AddProfile::ProfilesSelectionChanged(const IInspectable& /*sender*/,
|
||||
const Windows::UI::Xaml::RoutedEventArgs& /*eventArgs*/)
|
||||
{
|
||||
if (!_IsProfileSelected)
|
||||
{
|
||||
IsProfileSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
|
||||
void AddNewClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
void DuplicateClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
void ProfilesSelectionChanged(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
|
||||
WINRT_PROPERTY(Editor::AddProfilePageNavigationState, State, nullptr);
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
WINRT_OBSERVABLE_PROPERTY(bool, IsProfileSelected, _PropertyChangedHandlers, nullptr);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,10 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
event AddNewArgs AddNew;
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page
|
||||
[default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
AddProfile();
|
||||
AddProfilePageNavigationState State { get; };
|
||||
Boolean IsProfileSelected { get; };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
<ScrollViewer ViewChanging="ViewChanging">
|
||||
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
||||
<Button x:Uid="AddProfile_AddNewButton"
|
||||
AutomationProperties.AutomationId="AddProfile_AddNewButton"
|
||||
AutomationProperties.Name="{Binding Tag, RelativeSource={RelativeSource Self}}"
|
||||
<Button x:Name="AddNewButton"
|
||||
Click="AddNewClick"
|
||||
Style="{StaticResource AccentButtonStyle}">
|
||||
<Button.Content>
|
||||
@@ -41,7 +39,8 @@
|
||||
<local:SettingContainer x:Uid="AddProfile_Duplicate">
|
||||
<muxc:RadioButtons x:Name="Profiles"
|
||||
AutomationProperties.AccessibilityView="Content"
|
||||
ItemsSource="{x:Bind State.Settings.AllProfiles, Mode=OneWay}">
|
||||
ItemsSource="{x:Bind State.Settings.AllProfiles, Mode=OneWay}"
|
||||
SelectionChanged="ProfilesSelectionChanged">
|
||||
<muxc:RadioButtons.ItemTemplate>
|
||||
<DataTemplate x:DataType="model:Profile">
|
||||
<Grid HorizontalAlignment="Stretch"
|
||||
@@ -67,11 +66,10 @@
|
||||
</muxc:RadioButtons.ItemTemplate>
|
||||
</muxc:RadioButtons>
|
||||
</local:SettingContainer>
|
||||
<Button x:Uid="AddProfile_DuplicateButton"
|
||||
<Button x:Name="DuplicateButton"
|
||||
Margin="{StaticResource StandardControlMargin}"
|
||||
AutomationProperties.AutomationId="AddProfile_DuplicateButton"
|
||||
AutomationProperties.Name="{Binding Tag, RelativeSource={RelativeSource Self}}"
|
||||
Click="DuplicateClick"
|
||||
IsEnabled="{x:Bind IsProfileSelected, Mode=OneWay}"
|
||||
Style="{StaticResource AccentButtonStyle}">
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*++
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
@@ -93,7 +93,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
OBSERVABLE_PROJECTED_SETTING(_appearance, BackgroundImageStretchMode);
|
||||
OBSERVABLE_PROJECTED_SETTING(_appearance, BackgroundImageAlignment);
|
||||
OBSERVABLE_PROJECTED_SETTING(_appearance, IntenseTextStyle);
|
||||
OBSERVABLE_PROJECTED_SETTING(_appearance, AdjustIndistinguishableColors);
|
||||
|
||||
private:
|
||||
Model::AppearanceConfig _appearance;
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode);
|
||||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.ConvergedAlignment, BackgroundImageAlignment);
|
||||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.IntenseStyle, IntenseTextStyle);
|
||||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Boolean, AdjustIndistinguishableColors);
|
||||
}
|
||||
|
||||
[default_interface] runtimeclass Appearances : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
Visibility="{x:Bind Appearance.IsDefault, Mode=OneWay}">
|
||||
<StackPanel>
|
||||
<ComboBox x:Name="FontWeightComboBox"
|
||||
x:Uid="Profile_FontWeightComboBox"
|
||||
ItemTemplate="{StaticResource EnumComboBoxItemTemplate}"
|
||||
ItemsSource="{x:Bind FontWeightList, Mode=OneWay}"
|
||||
SelectedItem="{x:Bind CurrentFontWeight, Mode=TwoWay}"
|
||||
@@ -132,6 +133,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="FontWeightSlider"
|
||||
x:Uid="Profile_FontWeightSlider"
|
||||
Grid.Column="0"
|
||||
Maximum="1000"
|
||||
Minimum="0"
|
||||
@@ -153,14 +155,6 @@
|
||||
SettingOverrideSource="{x:Bind Appearance.RetroTerminalEffectOverrideSource, Mode=OneWay}">
|
||||
<ToggleSwitch IsOn="{x:Bind Appearance.RetroTerminalEffect, Mode=TwoWay}" />
|
||||
</local:SettingContainer>
|
||||
|
||||
<!-- Adjust Indistinguishable Colors -->
|
||||
<local:SettingContainer x:Uid="Profile_AdjustIndistinguishableColors"
|
||||
ClearSettingValue="{x:Bind Appearance.ClearAdjustIndistinguishableColors}"
|
||||
HasSettingValue="{x:Bind Appearance.HasAdjustIndistinguishableColors, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Appearance.AdjustIndistinguishableColorsOverrideSource, Mode=OneWay}">
|
||||
<ToggleSwitch IsOn="{x:Bind Appearance.AdjustIndistinguishableColors, Mode=TwoWay}" />
|
||||
</local:SettingContainer>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Grouping: Cursor -->
|
||||
@@ -217,10 +211,11 @@
|
||||
SettingOverrideSource="{x:Bind Appearance.BackgroundImagePathOverrideSource, Mode=OneWay}">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox IsEnabled="{x:Bind local:Converters.StringsAreNotEqual('desktopWallpaper', Appearance.BackgroundImagePath), Mode=OneWay}"
|
||||
<TextBox x:Uid="Profile_BackgroundImageBox"
|
||||
IsEnabled="{x:Bind local:Converters.StringsAreNotEqual('desktopWallpaper', Appearance.BackgroundImagePath), Mode=OneWay}"
|
||||
IsSpellCheckEnabled="False"
|
||||
Style="{StaticResource TextBoxSettingStyle}"
|
||||
Text="{x:Bind local:Converters.StringFallBackToEmptyString('desktopWallpaper', Appearance.BackgroundImagePath), Mode=TwoWay, BindBack=Appearance.SetBackgroundImagePath}" />
|
||||
Text="{x:Bind local:Converters.StringOrEmptyIfPlaceholder('desktopWallpaper', Appearance.BackgroundImagePath), Mode=TwoWay, BindBack=Appearance.SetBackgroundImagePath}" />
|
||||
<Button x:Uid="Profile_BackgroundImageBrowse"
|
||||
Click="BackgroundImage_Click"
|
||||
IsEnabled="{x:Bind local:Converters.StringsAreNotEqual('desktopWallpaper', Appearance.BackgroundImagePath), Mode=OneWay}"
|
||||
@@ -434,6 +429,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="BIOpacitySlider"
|
||||
x:Uid="Profile_BackgroundImageOpacitySlider"
|
||||
Grid.Column="0"
|
||||
Value="{x:Bind local:Converters.PercentageToPercentageValue(Appearance.BackgroundImageOpacity), BindBack=Appearance.SetBackgroundImageOpacityFromPercentageValue, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Column="1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Converters.h"
|
||||
#if __has_include("Converters.g.cpp")
|
||||
#include "Converters.g.cpp"
|
||||
@@ -99,8 +99,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
return value.empty() ? winrt::Windows::UI::Xaml::Visibility::Collapsed : winrt::Windows::UI::Xaml::Visibility::Visible;
|
||||
}
|
||||
winrt::hstring Converters::StringFallBackToEmptyString(winrt::hstring expected, winrt::hstring actual)
|
||||
|
||||
// Method Description:
|
||||
// - Returns the value string, unless it matches the placeholder in which case the empty string.
|
||||
// Arguments:
|
||||
// - placeholder - the placeholder string.
|
||||
// - value - the value string.
|
||||
// Return Value:
|
||||
// - The value string, unless it matches the placeholder in which case the empty string.
|
||||
winrt::hstring Converters::StringOrEmptyIfPlaceholder(winrt::hstring placeholder, winrt::hstring value)
|
||||
{
|
||||
return expected == actual ? expected : L"";
|
||||
return placeholder == value ? L"" : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
static double PercentageValueToPercentage(double value);
|
||||
static bool StringsAreNotEqual(winrt::hstring expected, winrt::hstring actual);
|
||||
static winrt::Windows::UI::Xaml::Visibility StringNotEmptyToVisibility(winrt::hstring value);
|
||||
static winrt::hstring StringFallBackToEmptyString(winrt::hstring expected, winrt::hstring actual);
|
||||
static winrt::hstring StringOrEmptyIfPlaceholder(winrt::hstring placeholder, winrt::hstring value);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,6 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
static Double PercentageValueToPercentage(Double value);
|
||||
static Boolean StringsAreNotEqual(String expected, String actual);
|
||||
static Windows.UI.Xaml.Visibility StringNotEmptyToVisibility(String value);
|
||||
static String StringFallBackToEmptyString(String expected, String actual);
|
||||
static String StringOrEmptyIfPlaceholder(String placeholder, String value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,23 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// --> "und" is synonymous for "Use system language".
|
||||
constexpr std::wstring_view systemLanguageTag{ L"und" };
|
||||
|
||||
static constexpr std::array appLanguageTags{
|
||||
L"en-US",
|
||||
L"de-DE",
|
||||
L"es-ES",
|
||||
L"fr-FR",
|
||||
L"it-IT",
|
||||
L"ja",
|
||||
L"ko",
|
||||
L"pt-BR",
|
||||
L"qps-PLOC",
|
||||
L"qps-PLOCA",
|
||||
L"qps-PLOCM",
|
||||
L"ru",
|
||||
L"zh-Hans-CN",
|
||||
L"zh-Hant-TW",
|
||||
};
|
||||
|
||||
GlobalAppearance::GlobalAppearance()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -88,43 +105,22 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// [1]:
|
||||
{
|
||||
// ManifestLanguages contains languages the app ships with.
|
||||
//
|
||||
// Languages is a computed list that merges the ManifestLanguages with the
|
||||
// user's ranked list of preferred languages taken from the system settings.
|
||||
// As is tradition the API documentation is incomplete though, as it can also
|
||||
// contain regional language variants. If our app supports en-US, but the user
|
||||
// has en-GB or en-DE in their system's preferred language list, Languages will
|
||||
// contain those as well, as they're variants from a supported language. We should
|
||||
// allow a user to select those, as regional formattings can vary significantly.
|
||||
const std::array tagSources{
|
||||
winrt::Windows::Globalization::ApplicationLanguages::ManifestLanguages(),
|
||||
winrt::Windows::Globalization::ApplicationLanguages::Languages()
|
||||
};
|
||||
|
||||
// tags will hold all the flattened results from tagSources.
|
||||
// We resize() the vector to the proper size in order to efficiently GetMany() all items.
|
||||
tags.resize(std::accumulate(
|
||||
tagSources.begin(),
|
||||
tagSources.end(),
|
||||
// tags[0] will be "und" - the "Use system language" item
|
||||
// tags[1..n] will contain tags from tagSources.
|
||||
// --> totalTags is offset by 1
|
||||
1,
|
||||
[](uint32_t sum, const auto& v) -> uint32_t {
|
||||
return sum + v.Size();
|
||||
}));
|
||||
// Unfortunately, we cannot use this source. Our manifest must contain the
|
||||
// ~100 languages that are localized for the shell extension and start menu
|
||||
// presentation so we align with Windows display languages for those surfaces.
|
||||
// However, the actual content of our application is limited to a much smaller
|
||||
// subset of approximately 14 languages. As such, we will code the limited
|
||||
// subset of languages that we support for selection within the Settings
|
||||
// dropdown to steer users towards the ones that we can display in the app.
|
||||
|
||||
// As per the function definition, the first item
|
||||
// is always "Use system language" ("und").
|
||||
auto data = tags.data();
|
||||
*data++ = systemLanguageTag;
|
||||
tags.emplace_back(systemLanguageTag);
|
||||
|
||||
// Finally GetMany() all the tags from tagSources.
|
||||
for (const auto& v : tagSources)
|
||||
// Add our hardcoded languages after the system definition.
|
||||
for (const auto& v : appLanguageTags)
|
||||
{
|
||||
const auto size = v.Size();
|
||||
v.GetMany(0, winrt::array_view(data, size));
|
||||
data += size;
|
||||
tags.push_back(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,15 +110,18 @@
|
||||
<TextBlock Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{x:Bind Name}" />
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Style="{ThemeResource SecondaryTextBlockStyle}"
|
||||
Text="{x:Bind Author}" />
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Style="{ThemeResource SecondaryTextBlockStyle}"
|
||||
Text="{x:Bind Version}" />
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
</muxc:NavigationView.MenuItems>
|
||||
|
||||
<muxc:NavigationView.PaneFooter>
|
||||
<muxc:NavigationView.FooterMenuItems>
|
||||
<!-- The OpenJson item needs both Tapped and KeyDown handler -->
|
||||
<muxc:NavigationViewItem x:Name="OpenJsonNavItem"
|
||||
x:Uid="Nav_OpenJSON"
|
||||
@@ -110,7 +110,7 @@
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
</muxc:NavigationView.PaneFooter>
|
||||
</muxc:NavigationView.FooterMenuItems>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "Profiles.h"
|
||||
|
||||
#include "PreviewConnection.h"
|
||||
#include "Profiles.g.cpp"
|
||||
#include "EnumEntry.h"
|
||||
@@ -10,6 +11,54 @@
|
||||
#include <LibraryResources.h>
|
||||
#include "..\WinRTUtils\inc\Utils.h"
|
||||
|
||||
// This function is a copy of DxFontInfo::_NearbyCollection() with
|
||||
// * the call to DxFontInfo::s_GetNearbyFonts() inlined
|
||||
// * checkForUpdates for GetSystemFontCollection() set to true
|
||||
static wil::com_ptr<IDWriteFontCollection1> NearbyCollection(IDWriteFactory* dwriteFactory)
|
||||
{
|
||||
// The convenience interfaces for loading fonts from files
|
||||
// are only available on Windows 10+.
|
||||
wil::com_ptr<IDWriteFactory6> factory6;
|
||||
// wil's query() facilities don't work inside WinRT land at the moment.
|
||||
// They produce a compilation error due to IUnknown and winrt::Windows::Foundation::IUnknown being ambiguous.
|
||||
if (!SUCCEEDED(dwriteFactory->QueryInterface(__uuidof(IDWriteFactory6), factory6.put_void())))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
wil::com_ptr<IDWriteFontCollection1> systemFontCollection;
|
||||
THROW_IF_FAILED(factory6->GetSystemFontCollection(false, systemFontCollection.addressof(), true));
|
||||
|
||||
wil::com_ptr<IDWriteFontSet> systemFontSet;
|
||||
THROW_IF_FAILED(systemFontCollection->GetFontSet(systemFontSet.addressof()));
|
||||
|
||||
wil::com_ptr<IDWriteFontSetBuilder2> fontSetBuilder2;
|
||||
THROW_IF_FAILED(factory6->CreateFontSetBuilder(fontSetBuilder2.addressof()));
|
||||
|
||||
THROW_IF_FAILED(fontSetBuilder2->AddFontSet(systemFontSet.get()));
|
||||
|
||||
{
|
||||
const std::filesystem::path module{ wil::GetModuleFileNameW<std::wstring>(nullptr) };
|
||||
const auto folder{ module.parent_path() };
|
||||
|
||||
for (const auto& p : std::filesystem::directory_iterator(folder))
|
||||
{
|
||||
if (til::ends_with(p.path().native(), L".ttf"))
|
||||
{
|
||||
fontSetBuilder2->AddFontFile(p.path().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wil::com_ptr<IDWriteFontSet> fontSet;
|
||||
THROW_IF_FAILED(fontSetBuilder2->CreateFontSet(fontSet.addressof()));
|
||||
|
||||
wil::com_ptr<IDWriteFontCollection1> fontCollection;
|
||||
THROW_IF_FAILED(factory6->CreateFontCollectionFromFontSet(fontSet.get(), &fontCollection));
|
||||
|
||||
return fontCollection;
|
||||
}
|
||||
|
||||
using namespace winrt::Windows::UI::Text;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
@@ -107,8 +156,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
reinterpret_cast<::IUnknown**>(factory.put())));
|
||||
|
||||
// get the font collection; subscribe to updates
|
||||
com_ptr<IDWriteFontCollection> fontCollection;
|
||||
THROW_IF_FAILED(factory->GetSystemFontCollection(fontCollection.put(), TRUE));
|
||||
const auto fontCollection = NearbyCollection(factory.get());
|
||||
|
||||
for (UINT32 i = 0; i < fontCollection->GetFontFamilyCount(); ++i)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// only works on Win11. So we'll use that.
|
||||
//
|
||||
// Remove when we can remove the rest of GH#11285
|
||||
if (value < 100.0 && winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings::IsDefaultTerminalAvailable())
|
||||
if (value < 100.0 &&
|
||||
!winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings::IsDefaultTerminalAvailable())
|
||||
{
|
||||
UseAcrylic(true);
|
||||
}
|
||||
|
||||
@@ -260,6 +260,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="OpacitySlider"
|
||||
x:Uid="Profile_OpacitySlider"
|
||||
Grid.Column="0"
|
||||
Value="{x:Bind local:Converters.PercentageToPercentageValue(State.Profile.Opacity), BindBack=State.Profile.SetAcrylicOpacityPercentageValue, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Column="1"
|
||||
@@ -298,6 +299,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider x:Name="PaddingSlider"
|
||||
x:Uid="Profile_PaddingSlider"
|
||||
Grid.Column="0"
|
||||
Value="{x:Bind local:Converters.MaxValueFromPaddingString(State.Profile.Padding), BindBack=State.Profile.SetPadding, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Column="1"
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
<comment>Header for a control to toggle whether the terminal's title is shown as the application title, or not.</comment>
|
||||
</data>
|
||||
<data name="Globals_ShowTitleInTitlebar.HelpText" xml:space="preserve">
|
||||
<value>When disabled, the title bar will be 'Windows Terminal'.</value>
|
||||
<value>When disabled, the title bar will be 'Terminal'.</value>
|
||||
<comment>A description for what the "show title in titlebar" setting does. Presented near "Globals_ShowTitleInTitlebar.Header".{Locked="Windows"}</comment>
|
||||
</data>
|
||||
<data name="Globals_SnapToGridOnResize.Header" xml:space="preserve">
|
||||
@@ -404,7 +404,7 @@
|
||||
<comment>Header for a control to toggle whether the app should launch when the user's machine starts up, or not.</comment>
|
||||
</data>
|
||||
<data name="Globals_StartOnUserLogin.HelpText" xml:space="preserve">
|
||||
<value>When enabled, this enables the launch of Windows Terminal at machine startup.</value>
|
||||
<value>When enabled, this enables the launch of Terminal at machine startup.</value>
|
||||
<comment>A description for what the "start on user login" setting does. Presented near "Globals_StartOnUserLogin.Header".</comment>
|
||||
</data>
|
||||
<data name="Globals_AlwaysOnTop.Header" xml:space="preserve">
|
||||
@@ -412,7 +412,7 @@
|
||||
<comment>Header for a control to toggle if the app will always be presented on top of other windows, or is treated normally (when disabled).</comment>
|
||||
</data>
|
||||
<data name="Globals_AlwaysOnTop.HelpText" xml:space="preserve">
|
||||
<value>Windows Terminal will always be the topmost window on the desktop.</value>
|
||||
<value>Terminal will always be the topmost window on the desktop.</value>
|
||||
<comment>A description for what the "always on top" setting does. Presented near "Globals_AlwaysOnTop.Header".</comment>
|
||||
</data>
|
||||
<data name="Globals_TabWidthMode.Header" xml:space="preserve">
|
||||
@@ -503,6 +503,10 @@
|
||||
<value>Sets the transparency of the window.</value>
|
||||
<comment>A description for what the "acrylic opacity" setting does. Presented near "Profile_AcrylicOpacity.Header".</comment>
|
||||
</data>
|
||||
<data name="Profile_OpacitySlider.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background opacity</value>
|
||||
<comment>Name for a control to determine the level of opacity for the background of the control. The user can choose to make the background of the app more or less opaque.</comment>
|
||||
</data>
|
||||
<data name="Profile_Opacity.Header" xml:space="preserve">
|
||||
<value>Background opacity</value>
|
||||
<comment>Header for a control to determine the level of opacity for the background of the control. The user can choose to make the background of the app more or less opaque.</comment>
|
||||
@@ -523,6 +527,10 @@
|
||||
<value>By default Windows treats Ctrl+Alt as an alias for AltGr. When disabled, this behavior will be disabled.</value>
|
||||
<comment>A description for what the "AltGr aliasing" setting does. Presented near "Profile_AltGrAliasing.Header".</comment>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingMode.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Text antialiasing</value>
|
||||
<comment>Name for a control to select the graphical anti-aliasing format of text.</comment>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingMode.Header" xml:space="preserve">
|
||||
<value>Text antialiasing</value>
|
||||
<comment>Header for a control to select the graphical anti-aliasing format of text.</comment>
|
||||
@@ -547,6 +555,14 @@
|
||||
<value>Appearance</value>
|
||||
<comment>Header for a sub-page of profile settings focused on customizing the appearance of the profile.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageBox.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background image path</value>
|
||||
<comment>Name for a control to determine the image presented on the background of the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImage.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background image path</value>
|
||||
<comment>Name for a control to determine the image presented on the background of the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImage.Header" xml:space="preserve">
|
||||
<value>Background image path</value>
|
||||
<comment>Header for a control to determine the image presented on the background of the app.</comment>
|
||||
@@ -555,6 +571,10 @@
|
||||
<value>File location of the image used in the background of the window.</value>
|
||||
<comment>A description for what the "background image path" setting does. Presented near "Profile_BackgroundImage".</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignment.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background image alignment</value>
|
||||
<comment>Name for a control to choose the visual alignment of the image presented on the background of the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignment.Header" xml:space="preserve">
|
||||
<value>Background image alignment</value>
|
||||
<comment>Header for a control to choose the visual alignment of the image presented on the background of the app.</comment>
|
||||
@@ -603,6 +623,10 @@
|
||||
<value>Browse...</value>
|
||||
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageOpacitySlider.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background image opacity</value>
|
||||
<comment>Name for a control to choose the opacity of the image presented on the background of the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageOpacity.Header" xml:space="preserve">
|
||||
<value>Background image opacity</value>
|
||||
<comment>Header for a control to choose the opacity of the image presented on the background of the app.</comment>
|
||||
@@ -611,6 +635,10 @@
|
||||
<value>Sets the transparency of the background image.</value>
|
||||
<comment>A description for what the "background image opacity" setting does. Presented near "Profile_BackgroundImageOpacity".</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchMode.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Background image stretch mode</value>
|
||||
<comment>Name for a control to choose the stretch mode of the image presented on the background of the app. Stretch mode is how the image is resized to fill its allocated space.</comment>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchMode.Header" xml:space="preserve">
|
||||
<value>Background image stretch mode</value>
|
||||
<comment>Header for a control to choose the stretch mode of the image presented on the background of the app. Stretch mode is how the image is resized to fill its allocated space.</comment>
|
||||
@@ -635,6 +663,10 @@
|
||||
<value>Uniform to fill</value>
|
||||
<comment>An option to choose from for the "background image stretch mode" setting. When selected, the content is resized to fill the destination dimensions while it preserves its native aspect ratio. But if the aspect ratio of the destination differs, the image is clipped to fit in the space (to fill the space)</comment>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExit.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Profile termination behavior</value>
|
||||
<comment>Name for a control to select the behavior of a terminal session (a profile) when it closes.</comment>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExit.Header" xml:space="preserve">
|
||||
<value>Profile termination behavior</value>
|
||||
<comment>Header for a control to select the behavior of a terminal session (a profile) when it closes.</comment>
|
||||
@@ -659,6 +691,10 @@
|
||||
<value>Name of the color scheme to use.</value>
|
||||
<comment>A description for what the "color scheme" setting does. Presented near "Profile_ColorScheme".</comment>
|
||||
</data>
|
||||
<data name="Profile_Commandline.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Command line</value>
|
||||
<comment>Name for a control to determine commandline executable (i.e. a .exe file) to run when a terminal session of this profile is launched.</comment>
|
||||
</data>
|
||||
<data name="Profile_Commandline.Header" xml:space="preserve">
|
||||
<value>Command line</value>
|
||||
<comment>Header for a control to determine commandline executable (i.e. a .exe file) to run when a terminal session of this profile is launched.</comment>
|
||||
@@ -683,6 +719,10 @@
|
||||
<value>Sets the percentage height of the cursor starting from the bottom. Only works with the vintage cursor shape.</value>
|
||||
<comment>A description for what the "cursor height" setting does. Presented near "Profile_CursorHeight".</comment>
|
||||
</data>
|
||||
<data name="Profile_CursorShape.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Cursor shape</value>
|
||||
<comment>Name for a control to select the shape of the text cursor.</comment>
|
||||
</data>
|
||||
<data name="Profile_CursorShape.Header" xml:space="preserve">
|
||||
<value>Cursor shape</value>
|
||||
<comment>Header for a control to select the shape of the text cursor.</comment>
|
||||
@@ -735,6 +775,14 @@
|
||||
<value>Size of the font in points.</value>
|
||||
<comment>A description for what the "font size" setting does. Presented near "Profile_FontSize".</comment>
|
||||
</data>
|
||||
<data name="Profile_FontWeightComboBox.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Font weight</value>
|
||||
<comment>Name for a control to select the weight (i.e. bold, thin, etc.) of the text in the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_FontWeightSlider.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Font weight</value>
|
||||
<comment>Name for a control to select the weight (i.e. bold, thin, etc.) of the text in the app.</comment>
|
||||
</data>
|
||||
<data name="Profile_FontWeight.Header" xml:space="preserve">
|
||||
<value>Font weight</value>
|
||||
<comment>Header for a control to select the weight (i.e. bold, thin, etc.) of the text in the app.</comment>
|
||||
@@ -767,6 +815,10 @@
|
||||
<value>The number of lines above the ones displayed in the window you can scroll back to.</value>
|
||||
<comment>A description for what the "history size" setting does. Presented near "Profile_HistorySize".</comment>
|
||||
</data>
|
||||
<data name="Profile_Icon.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Icon</value>
|
||||
<comment>Name for a control to determine what icon can be used to represent this profile. This is not necessarily a file path, but can be one.</comment>
|
||||
</data>
|
||||
<data name="Profile_Icon.Header" xml:space="preserve">
|
||||
<value>Icon</value>
|
||||
<comment>Header for a control to determine what icon can be used to represent this profile. This is not necessarily a file path, but can be one.</comment>
|
||||
@@ -783,6 +835,10 @@
|
||||
<value>Browse...</value>
|
||||
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
|
||||
</data>
|
||||
<data name="Profile_PaddingSlider.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Padding</value>
|
||||
<comment>Name for a control to determine the amount of space between text in a terminal and the edge of the window.</comment>
|
||||
</data>
|
||||
<data name="Profile_Padding.Header" xml:space="preserve">
|
||||
<value>Padding</value>
|
||||
<comment>Header for a control to determine the amount of space between text in a terminal and the edge of the window. The space can be any combination of the top, bottom, left, and right side of the window.</comment>
|
||||
@@ -799,13 +855,9 @@
|
||||
<value>When enabled, enables retro terminal effects such as glowing text and scan lines.</value>
|
||||
<comment>A description for what the "retro terminal effects" setting does. Presented near "Profile_RetroTerminalEffect".</comment>
|
||||
</data>
|
||||
<data name="Profile_AdjustIndistinguishableColors.Header" xml:space="preserve">
|
||||
<value>Automatically adjust lightness of indistinguishable text</value>
|
||||
<comment>Header for a control to toggle if we should adjust the foreground color's lightness to make it more visible when necessary, based on the background color.</comment>
|
||||
</data>
|
||||
<data name="Profile_AdjustIndistinguishableColors.HelpText" xml:space="preserve">
|
||||
<value>When enabled, enables automatic adjustment of indistinguishable colors, which will, only when necessary, adjust the foreground color's lightness to make it more visible (based on the background color).</value>
|
||||
<comment>A description for what the "adjust indistinguishable colors" setting does. Presented near "Profile_AdjustIndistinguishableColors".</comment>
|
||||
<data name="Profile_ScrollbarVisibility.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Scrollbar visibility</value>
|
||||
<comment>Name for a control to select the visibility of the scrollbar in a session.</comment>
|
||||
</data>
|
||||
<data name="Profile_ScrollbarVisibility.Header" xml:space="preserve">
|
||||
<value>Scrollbar visibility</value>
|
||||
@@ -823,6 +875,10 @@
|
||||
<value>Scroll to input when typing</value>
|
||||
<comment>Header for a control to toggle if keyboard input should automatically scroll to where the input was placed.</comment>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectory.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Starting directory</value>
|
||||
<comment>Name for a control to determine the directory the session opens it at launch. This is on a text box that accepts folder paths.</comment>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectory.Header" xml:space="preserve">
|
||||
<value>Starting directory</value>
|
||||
<comment>Header for a control to determine the directory the session opens it at launch. This is on a text box that accepts folder paths.</comment>
|
||||
@@ -844,7 +900,7 @@
|
||||
<comment>A supplementary setting to the "starting directory" setting. "Parent" refers to the parent process of the current process.</comment>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectoryUseParentCheckbox.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>If enabled, this profile will spawn in the directory from which Windows Terminal was launched.</value>
|
||||
<value>If enabled, this profile will spawn in the directory from which Terminal was launched.</value>
|
||||
<comment>A description for what the supplementary "use parent process directory" setting does. Presented near "Profile_StartingDirectoryUseParentCheckbox".</comment>
|
||||
</data>
|
||||
<data name="Profile_SuppressApplicationTitle.Header" xml:space="preserve">
|
||||
@@ -855,6 +911,10 @@
|
||||
<value>Use the tab title to override the default title of the tab and suppress any title change messages from the application.</value>
|
||||
<comment>A description for what the "suppress application title" setting does. Presented near "Profile_SuppressApplicationTitle".</comment>
|
||||
</data>
|
||||
<data name="Profile_TabTitle.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Tab title</value>
|
||||
<comment>Name for a control to determine the title of the tab. This is represented using a text box.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabTitle.Header" xml:space="preserve">
|
||||
<value>Tab title</value>
|
||||
<comment>Header for a control to determine the title of the tab. This is represented using a text box.</comment>
|
||||
@@ -915,6 +975,10 @@
|
||||
<value>Maximized focus</value>
|
||||
<comment>An option to choose from for the "launch mode" setting. Opens the app maximized and in focus mode.</comment>
|
||||
</data>
|
||||
<data name="Profile_BellStyle.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Bell notification style</value>
|
||||
<comment>Name for a control to select the how the app notifies the user. "Bell" is the common term in terminals for the BEL character (like the metal device used to chime).</comment>
|
||||
</data>
|
||||
<data name="Profile_BellStyle.Header" xml:space="preserve">
|
||||
<value>Bell notification style</value>
|
||||
<comment>Header for a control to select the how the app notifies the user. "Bell" is the common term in terminals for the BEL character (like the metal device used to chime).</comment>
|
||||
@@ -1026,6 +1090,10 @@
|
||||
<value>The name of the profile that appears in the dropdown.</value>
|
||||
<comment>A description for what the "name" setting does. Presented near "Profile_Name".</comment>
|
||||
</data>
|
||||
<data name="Profile_Name.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
<comment>Name for a control to determine the name of the profile. This is a text box.</comment>
|
||||
</data>
|
||||
<data name="Profile_Name.Header" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
<comment>Header for a control to determine the name of the profile. This is a text box.</comment>
|
||||
@@ -1190,10 +1258,18 @@
|
||||
<value>If enabled, show all installed fonts in the list above. Otherwise, only show the list of monospace fonts.</value>
|
||||
<comment>A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts".</comment>
|
||||
</data>
|
||||
<data name="Profile_CreateUnfocusedAppearanceButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Create Appearance</value>
|
||||
<comment>Name for a control which creates an the unfocused appearance settings for this profile.</comment>
|
||||
</data>
|
||||
<data name="Profile_CreateUnfocusedAppearanceButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Create an unfocused appearance for this profile. This will be the appearance of the profile when it is inactive.</value>
|
||||
<comment>A description for what the create unfocused appearance button does.</comment>
|
||||
</data>
|
||||
<data name="Profile_DeleteUnfocusedAppearanceButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Delete Appearance</value>
|
||||
<comment>Name for a control which deletes an the unfocused appearance settings for this profile.</comment>
|
||||
</data>
|
||||
<data name="Profile_DeleteUnfocusedAppearanceButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Delete the unfocused appearance for this profile.</value>
|
||||
<comment>A description for what the delete unfocused appearance button does.</comment>
|
||||
@@ -1266,6 +1342,10 @@
|
||||
<value>Text Formatting</value>
|
||||
<comment>Header for a control to how text is formatted</comment>
|
||||
</data>
|
||||
<data name="Appearance_IntenseTextStyle.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Intense text style</value>
|
||||
<comment>Name for a control to select how "intense" text is formatted (bold, bright, both or none)</comment>
|
||||
</data>
|
||||
<data name="Appearance_IntenseTextStyle.Header" xml:space="preserve">
|
||||
<value>Intense text style</value>
|
||||
<comment>Header for a control to select how "intense" text is formatted (bold, bright, both or none)</comment>
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
<packages>
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user