mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-08 23:31:03 +00:00
Compare commits
32 Commits
dev/miniks
...
cinnamon/o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ac3de1782 | ||
|
|
2d0f652aa7 | ||
|
|
d3550073fc | ||
|
|
d3d128d42e | ||
|
|
8a10d29d5f | ||
|
|
44d16b8d56 | ||
|
|
3b04ba9cdf | ||
|
|
ae550e0969 | ||
|
|
ccf9f03ed3 | ||
|
|
f5e9d959d6 | ||
|
|
b0b5fc1cdd | ||
|
|
895ac06dbd | ||
|
|
00f5fbaf3d | ||
|
|
4099aacacb | ||
|
|
788e6854c4 | ||
|
|
8213cf11a9 | ||
|
|
1ad7a25cb2 | ||
|
|
c1d27774b4 | ||
|
|
8eaaa8a2b7 | ||
|
|
c14824ee94 | ||
|
|
90452664ff | ||
|
|
df7c3ccc3b | ||
|
|
0ce05b5405 | ||
|
|
e00275232c | ||
|
|
29578d3a7e | ||
|
|
09677fd57e | ||
|
|
bde5d5eb18 | ||
|
|
b87f6d6818 | ||
|
|
91d2148ae6 | ||
|
|
a305c0d968 | ||
|
|
51ba0543c8 | ||
|
|
9493ca0ea3 |
25
.github/actions/spell-check/advice.txt
vendored
25
.github/actions/spell-check/advice.txt
vendored
@@ -1,25 +0,0 @@
|
||||
<details>
|
||||
<summary>
|
||||
:pencil2: Contributor please read this
|
||||
</summary>
|
||||
|
||||
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
|
||||
|
||||
:warning: The command is written for posix shells. You can copy the contents of each `perl` command excluding the outer `'` marks and dropping any `'"`/`"'` quotation mark pairs into a file and then run `perl file.pl` from the root of the repository to run the code. Alternatively, you can manually insert the items...
|
||||
|
||||
If the listed items are:
|
||||
* ... **misspelled**, then please *correct* them instead of using the command.
|
||||
* ... *names*, please add them to `.github/actions/spell-check/dictionary/names.txt`.
|
||||
* ... APIs, you can add them to a file in `.github/actions/spell-check/dictionary/`.
|
||||
* ... just things you're using, please add them to an appropriate file in `.github/actions/spell-check/expect/`.
|
||||
* ... tokens you only need in one place and shouldn't *generally be used*, you can add an item in an appropriate file in `.github/actions/spell-check/patterns/`.
|
||||
|
||||
See the `README.md` in each directory for more information.
|
||||
|
||||
:microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [:check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:
|
||||
|
||||
</details>
|
||||
|
||||
#### :warning: Reviewers
|
||||
At present, the action that triggered this message will not show its :x: in this PR unless the branch is within this repository.
|
||||
Thus, you **should** make sure that this comment has been addressed before encouraging the merge bot to merge this PR.
|
||||
60
.github/actions/spell-check/dictionary/apis.txt
vendored
60
.github/actions/spell-check/dictionary/apis.txt
vendored
@@ -1,60 +0,0 @@
|
||||
ACCEPTFILES
|
||||
ACCESSDENIED
|
||||
alignof
|
||||
bitfield
|
||||
bitfields
|
||||
COLORPROPERTY
|
||||
CLASSNOTAVAILABLE
|
||||
environstrings
|
||||
EXPCMDFLAGS
|
||||
EXPCMDSTATE
|
||||
fullkbd
|
||||
futex
|
||||
Hashtable
|
||||
href
|
||||
IAsync
|
||||
IBind
|
||||
IBox
|
||||
IClass
|
||||
IComparable
|
||||
ICustom
|
||||
IDialog
|
||||
IDirect
|
||||
IExplorer
|
||||
IMap
|
||||
IObject
|
||||
IStorage
|
||||
llabs
|
||||
LCID
|
||||
lround
|
||||
LSHIFT
|
||||
NCHITTEST
|
||||
NCLBUTTONDBLCLK
|
||||
NCRBUTTONDBLCLK
|
||||
NOAGGREGATION
|
||||
NOREDIRECTIONBITMAP
|
||||
oaidl
|
||||
ocidl
|
||||
otms
|
||||
OUTLINETEXTMETRICW
|
||||
PAGESCROLL
|
||||
RETURNCMD
|
||||
rfind
|
||||
roundf
|
||||
RSHIFT
|
||||
rx
|
||||
serializer
|
||||
SIZENS
|
||||
GETDESKWALLPAPER
|
||||
UPDATEINIFILE
|
||||
spsc
|
||||
STDCPP
|
||||
strchr
|
||||
syscall
|
||||
tmp
|
||||
tx
|
||||
userenv
|
||||
wcstoui
|
||||
XDocument
|
||||
XElement
|
||||
XParse
|
||||
782
.github/actions/spell-check/dictionary/colors.txt
vendored
782
.github/actions/spell-check/dictionary/colors.txt
vendored
@@ -1,782 +0,0 @@
|
||||
snow
|
||||
ghost-white
|
||||
ghostwhite
|
||||
white-smoke
|
||||
whitesmoke
|
||||
gainsboro
|
||||
floral-white
|
||||
floralwhite
|
||||
old-lace
|
||||
oldlace
|
||||
linen
|
||||
antique-white
|
||||
antiquewhite
|
||||
papaya-whip
|
||||
papayawhip
|
||||
blanched-almond
|
||||
blanchedalmond
|
||||
bisque
|
||||
peach-puff
|
||||
peachpuff
|
||||
navajo-white
|
||||
navajowhite
|
||||
moccasin
|
||||
cornsilk
|
||||
ivory
|
||||
lemon-chiffon
|
||||
lemonchiffon
|
||||
seashell
|
||||
honeydew
|
||||
mint-cream
|
||||
mintcream
|
||||
azure
|
||||
alice-blue
|
||||
aliceblue
|
||||
lavender
|
||||
lavender-blush
|
||||
lavenderblush
|
||||
misty-rose
|
||||
mistyrose
|
||||
white
|
||||
black
|
||||
dark-slate-gray
|
||||
darkslategray
|
||||
dark-slate-grey
|
||||
darkslategrey
|
||||
dim-gray
|
||||
dimgray
|
||||
dim-grey
|
||||
dimgrey
|
||||
slate-gray
|
||||
slategray
|
||||
slate-grey
|
||||
slategrey
|
||||
light-slate-gray
|
||||
lightslategray
|
||||
light-slate-grey
|
||||
lightslategrey
|
||||
gray
|
||||
grey
|
||||
xray
|
||||
x11gray
|
||||
xrey
|
||||
x11grey
|
||||
web-gray
|
||||
webgray
|
||||
web-grey
|
||||
webgrey
|
||||
light-grey
|
||||
lightgrey
|
||||
light-gray
|
||||
lightgray
|
||||
midnight-blue
|
||||
midnightblue
|
||||
navy
|
||||
navy-blue
|
||||
navyblue
|
||||
cornflower-blue
|
||||
cornflowerblue
|
||||
dark-slate-blue
|
||||
darkslateblue
|
||||
slate-blue
|
||||
slateblue
|
||||
medium-slate-blue
|
||||
mediumslateblue
|
||||
light-slate-blue
|
||||
lightslateblue
|
||||
medium-blue
|
||||
mediumblue
|
||||
royal-blue
|
||||
royalblue
|
||||
blue
|
||||
dodger-blue
|
||||
dodgerblue
|
||||
deep-sky-blue
|
||||
deepskyblue
|
||||
sky-blue
|
||||
skyblue
|
||||
light-sky-blue
|
||||
lightskyblue
|
||||
steel-blue
|
||||
steelblue
|
||||
light-steel-blue
|
||||
lightsteelblue
|
||||
light-blue
|
||||
lightblue
|
||||
powder-blue
|
||||
powderblue
|
||||
pale-turquoise
|
||||
paleturquoise
|
||||
dark-turquoise
|
||||
darkturquoise
|
||||
medium-turquoise
|
||||
mediumturquoise
|
||||
turquoise
|
||||
cyan
|
||||
aqua
|
||||
light-cyan
|
||||
lightcyan
|
||||
cadet-blue
|
||||
cadetblue
|
||||
medium-aquamarine
|
||||
mediumaquamarine
|
||||
aquamarine
|
||||
dark-green
|
||||
darkgreen
|
||||
dark-olive-green
|
||||
darkolivegreen
|
||||
dark-sea-green
|
||||
darkseagreen
|
||||
sea-green
|
||||
seagreen
|
||||
medium-sea-green
|
||||
mediumseagreen
|
||||
light-sea-green
|
||||
lightseagreen
|
||||
pale-green
|
||||
palegreen
|
||||
spring-green
|
||||
springgreen
|
||||
lawn-green
|
||||
lawngreen
|
||||
green
|
||||
lime
|
||||
xreen
|
||||
x11green
|
||||
web-green
|
||||
webgreen
|
||||
chartreuse
|
||||
medium-spring-green
|
||||
mediumspringgreen
|
||||
green-yellow
|
||||
greenyellow
|
||||
lime-green
|
||||
limegreen
|
||||
yellow-green
|
||||
yellowgreen
|
||||
forest-green
|
||||
forestgreen
|
||||
olive-drab
|
||||
olivedrab
|
||||
dark-khaki
|
||||
darkkhaki
|
||||
khaki
|
||||
pale-goldenrod
|
||||
palegoldenrod
|
||||
light-goldenrod-yellow
|
||||
lightgoldenrodyellow
|
||||
light-yellow
|
||||
lightyellow
|
||||
yellow
|
||||
gold
|
||||
light-goldenrod
|
||||
lightgoldenrod
|
||||
goldenrod
|
||||
dark-goldenrod
|
||||
darkgoldenrod
|
||||
rosy-brown
|
||||
rosybrown
|
||||
indian-red
|
||||
indianred
|
||||
saddle-brown
|
||||
saddlebrown
|
||||
sienna
|
||||
peru
|
||||
burlywood
|
||||
beige
|
||||
wheat
|
||||
sandy-brown
|
||||
sandybrown
|
||||
tan
|
||||
chocolate
|
||||
firebrick
|
||||
brown
|
||||
dark-salmon
|
||||
darksalmon
|
||||
salmon
|
||||
light-salmon
|
||||
lightsalmon
|
||||
orange
|
||||
dark-orange
|
||||
darkorange
|
||||
coral
|
||||
light-coral
|
||||
lightcoral
|
||||
tomato
|
||||
orange-red
|
||||
orangered
|
||||
red
|
||||
hot-pink
|
||||
hotpink
|
||||
deep-pink
|
||||
deeppink
|
||||
pink
|
||||
light-pink
|
||||
lightpink
|
||||
pale-violet-red
|
||||
palevioletred
|
||||
maroon
|
||||
xaroon
|
||||
x11maroon
|
||||
web-maroon
|
||||
webmaroon
|
||||
medium-violet-red
|
||||
mediumvioletred
|
||||
violet-red
|
||||
violetred
|
||||
magenta
|
||||
fuchsia
|
||||
violet
|
||||
plum
|
||||
orchid
|
||||
medium-orchid
|
||||
mediumorchid
|
||||
dark-orchid
|
||||
darkorchid
|
||||
dark-violet
|
||||
darkviolet
|
||||
blue-violet
|
||||
blueviolet
|
||||
purple
|
||||
xurple
|
||||
x11purple
|
||||
web-purple
|
||||
webpurple
|
||||
medium-purple
|
||||
mediumpurple
|
||||
thistle
|
||||
snow1
|
||||
snow2
|
||||
snow3
|
||||
snow4
|
||||
seashell1
|
||||
seashell2
|
||||
seashell3
|
||||
seashell4
|
||||
antiquewhite1
|
||||
antiquewhite2
|
||||
antiquewhite3
|
||||
antiquewhite4
|
||||
bisque1
|
||||
bisque2
|
||||
bisque3
|
||||
bisque4
|
||||
peachpuff1
|
||||
peachpuff2
|
||||
peachpuff3
|
||||
peachpuff4
|
||||
navajowhite1
|
||||
navajowhite2
|
||||
navajowhite3
|
||||
navajowhite4
|
||||
lemonchiffon1
|
||||
lemonchiffon2
|
||||
lemonchiffon3
|
||||
lemonchiffon4
|
||||
cornsilk1
|
||||
cornsilk2
|
||||
cornsilk3
|
||||
cornsilk4
|
||||
ivory1
|
||||
ivory2
|
||||
ivory3
|
||||
ivory4
|
||||
honeydew1
|
||||
honeydew2
|
||||
honeydew3
|
||||
honeydew4
|
||||
lavenderblush1
|
||||
lavenderblush2
|
||||
lavenderblush3
|
||||
lavenderblush4
|
||||
mistyrose1
|
||||
mistyrose2
|
||||
mistyrose3
|
||||
mistyrose4
|
||||
azure1
|
||||
azure2
|
||||
azure3
|
||||
azure4
|
||||
slateblue1
|
||||
slateblue2
|
||||
slateblue3
|
||||
slateblue4
|
||||
royalblue1
|
||||
royalblue2
|
||||
royalblue3
|
||||
royalblue4
|
||||
blue1
|
||||
blue2
|
||||
blue3
|
||||
blue4
|
||||
dodgerblue1
|
||||
dodgerblue2
|
||||
dodgerblue3
|
||||
dodgerblue4
|
||||
steelblue1
|
||||
steelblue2
|
||||
steelblue3
|
||||
steelblue4
|
||||
deepskyblue1
|
||||
deepskyblue2
|
||||
deepskyblue3
|
||||
deepskyblue4
|
||||
skyblue1
|
||||
skyblue2
|
||||
skyblue3
|
||||
skyblue4
|
||||
lightskyblue1
|
||||
lightskyblue2
|
||||
lightskyblue3
|
||||
lightskyblue4
|
||||
slategray1
|
||||
slategray2
|
||||
slategray3
|
||||
slategray4
|
||||
lightsteelblue1
|
||||
lightsteelblue2
|
||||
lightsteelblue3
|
||||
lightsteelblue4
|
||||
lightblue1
|
||||
lightblue2
|
||||
lightblue3
|
||||
lightblue4
|
||||
lightcyan1
|
||||
lightcyan2
|
||||
lightcyan3
|
||||
lightcyan4
|
||||
paleturquoise1
|
||||
paleturquoise2
|
||||
paleturquoise3
|
||||
paleturquoise4
|
||||
cadetblue1
|
||||
cadetblue2
|
||||
cadetblue3
|
||||
cadetblue4
|
||||
turquoise1
|
||||
turquoise2
|
||||
turquoise3
|
||||
turquoise4
|
||||
cyan1
|
||||
cyan2
|
||||
cyan3
|
||||
cyan4
|
||||
darkslategray1
|
||||
darkslategray2
|
||||
darkslategray3
|
||||
darkslategray4
|
||||
aquamarine1
|
||||
aquamarine2
|
||||
aquamarine3
|
||||
aquamarine4
|
||||
darkseagreen1
|
||||
darkseagreen2
|
||||
darkseagreen3
|
||||
darkseagreen4
|
||||
seagreen1
|
||||
seagreen2
|
||||
seagreen3
|
||||
seagreen4
|
||||
palegreen1
|
||||
palegreen2
|
||||
palegreen3
|
||||
palegreen4
|
||||
springgreen1
|
||||
springgreen2
|
||||
springgreen3
|
||||
springgreen4
|
||||
green1
|
||||
green2
|
||||
green3
|
||||
green4
|
||||
chartreuse1
|
||||
chartreuse2
|
||||
chartreuse3
|
||||
chartreuse4
|
||||
olivedrab1
|
||||
olivedrab2
|
||||
olivedrab3
|
||||
olivedrab4
|
||||
darkolivegreen1
|
||||
darkolivegreen2
|
||||
darkolivegreen3
|
||||
darkolivegreen4
|
||||
khaki1
|
||||
khaki2
|
||||
khaki3
|
||||
khaki4
|
||||
lightgoldenrod1
|
||||
lightgoldenrod2
|
||||
lightgoldenrod3
|
||||
lightgoldenrod4
|
||||
lightyellow1
|
||||
lightyellow2
|
||||
lightyellow3
|
||||
lightyellow4
|
||||
yellow1
|
||||
yellow2
|
||||
yellow3
|
||||
yellow4
|
||||
gold1
|
||||
gold2
|
||||
gold3
|
||||
gold4
|
||||
goldenrod1
|
||||
goldenrod2
|
||||
goldenrod3
|
||||
goldenrod4
|
||||
darkgoldenrod1
|
||||
darkgoldenrod2
|
||||
darkgoldenrod3
|
||||
darkgoldenrod4
|
||||
rosybrown1
|
||||
rosybrown2
|
||||
rosybrown3
|
||||
rosybrown4
|
||||
indianred1
|
||||
indianred2
|
||||
indianred3
|
||||
indianred4
|
||||
sienna1
|
||||
sienna2
|
||||
sienna3
|
||||
sienna4
|
||||
burlywood1
|
||||
burlywood2
|
||||
burlywood3
|
||||
burlywood4
|
||||
wheat1
|
||||
wheat2
|
||||
wheat3
|
||||
wheat4
|
||||
tan1
|
||||
tan2
|
||||
tan3
|
||||
tan4
|
||||
chocolate1
|
||||
chocolate2
|
||||
chocolate3
|
||||
chocolate4
|
||||
firebrick1
|
||||
firebrick2
|
||||
firebrick3
|
||||
firebrick4
|
||||
brown1
|
||||
brown2
|
||||
brown3
|
||||
brown4
|
||||
salmon1
|
||||
salmon2
|
||||
salmon3
|
||||
salmon4
|
||||
lightsalmon1
|
||||
lightsalmon2
|
||||
lightsalmon3
|
||||
lightsalmon4
|
||||
orange1
|
||||
orange2
|
||||
orange3
|
||||
orange4
|
||||
darkorange1
|
||||
darkorange2
|
||||
darkorange3
|
||||
darkorange4
|
||||
coral1
|
||||
coral2
|
||||
coral3
|
||||
coral4
|
||||
tomato1
|
||||
tomato2
|
||||
tomato3
|
||||
tomato4
|
||||
orangered1
|
||||
orangered2
|
||||
orangered3
|
||||
orangered4
|
||||
red1
|
||||
red2
|
||||
red3
|
||||
red4
|
||||
deeppink1
|
||||
deeppink2
|
||||
deeppink3
|
||||
deeppink4
|
||||
hotpink1
|
||||
hotpink2
|
||||
hotpink3
|
||||
hotpink4
|
||||
pink1
|
||||
pink2
|
||||
pink3
|
||||
pink4
|
||||
lightpink1
|
||||
lightpink2
|
||||
lightpink3
|
||||
lightpink4
|
||||
palevioletred1
|
||||
palevioletred2
|
||||
palevioletred3
|
||||
palevioletred4
|
||||
maroon1
|
||||
maroon2
|
||||
maroon3
|
||||
maroon4
|
||||
violetred1
|
||||
violetred2
|
||||
violetred3
|
||||
violetred4
|
||||
magenta1
|
||||
magenta2
|
||||
magenta3
|
||||
magenta4
|
||||
orchid1
|
||||
orchid2
|
||||
orchid3
|
||||
orchid4
|
||||
plum1
|
||||
plum2
|
||||
plum3
|
||||
plum4
|
||||
mediumorchid1
|
||||
mediumorchid2
|
||||
mediumorchid3
|
||||
mediumorchid4
|
||||
darkorchid1
|
||||
darkorchid2
|
||||
darkorchid3
|
||||
darkorchid4
|
||||
purple1
|
||||
purple2
|
||||
purple3
|
||||
purple4
|
||||
mediumpurple1
|
||||
mediumpurple2
|
||||
mediumpurple3
|
||||
mediumpurple4
|
||||
thistle1
|
||||
thistle2
|
||||
thistle3
|
||||
thistle4
|
||||
gray0
|
||||
grey0
|
||||
gray1
|
||||
grey1
|
||||
gray2
|
||||
grey2
|
||||
gray3
|
||||
grey3
|
||||
gray4
|
||||
grey4
|
||||
gray5
|
||||
grey5
|
||||
gray6
|
||||
grey6
|
||||
gray7
|
||||
grey7
|
||||
gray8
|
||||
grey8
|
||||
gray9
|
||||
grey9
|
||||
gray10
|
||||
grey10
|
||||
gray11
|
||||
grey11
|
||||
gray12
|
||||
grey12
|
||||
gray13
|
||||
grey13
|
||||
gray14
|
||||
grey14
|
||||
gray15
|
||||
grey15
|
||||
gray16
|
||||
grey16
|
||||
gray17
|
||||
grey17
|
||||
gray18
|
||||
grey18
|
||||
gray19
|
||||
grey19
|
||||
gray20
|
||||
grey20
|
||||
gray21
|
||||
grey21
|
||||
gray22
|
||||
grey22
|
||||
gray23
|
||||
grey23
|
||||
gray24
|
||||
grey24
|
||||
gray25
|
||||
grey25
|
||||
gray26
|
||||
grey26
|
||||
gray27
|
||||
grey27
|
||||
gray28
|
||||
grey28
|
||||
gray29
|
||||
grey29
|
||||
gray30
|
||||
grey30
|
||||
gray31
|
||||
grey31
|
||||
gray32
|
||||
grey32
|
||||
gray33
|
||||
grey33
|
||||
gray34
|
||||
grey34
|
||||
gray35
|
||||
grey35
|
||||
gray36
|
||||
grey36
|
||||
gray37
|
||||
grey37
|
||||
gray38
|
||||
grey38
|
||||
gray39
|
||||
grey39
|
||||
gray40
|
||||
grey40
|
||||
gray41
|
||||
grey41
|
||||
gray42
|
||||
grey42
|
||||
gray43
|
||||
grey43
|
||||
gray44
|
||||
grey44
|
||||
gray45
|
||||
grey45
|
||||
gray46
|
||||
grey46
|
||||
gray47
|
||||
grey47
|
||||
gray48
|
||||
grey48
|
||||
gray49
|
||||
grey49
|
||||
gray50
|
||||
grey50
|
||||
gray51
|
||||
grey51
|
||||
gray52
|
||||
grey52
|
||||
gray53
|
||||
grey53
|
||||
gray54
|
||||
grey54
|
||||
gray55
|
||||
grey55
|
||||
gray56
|
||||
grey56
|
||||
gray57
|
||||
grey57
|
||||
gray58
|
||||
grey58
|
||||
gray59
|
||||
grey59
|
||||
gray60
|
||||
grey60
|
||||
gray61
|
||||
grey61
|
||||
gray62
|
||||
grey62
|
||||
gray63
|
||||
grey63
|
||||
gray64
|
||||
grey64
|
||||
gray65
|
||||
grey65
|
||||
gray66
|
||||
grey66
|
||||
gray67
|
||||
grey67
|
||||
gray68
|
||||
grey68
|
||||
gray69
|
||||
grey69
|
||||
gray70
|
||||
grey70
|
||||
gray71
|
||||
grey71
|
||||
gray72
|
||||
grey72
|
||||
gray73
|
||||
grey73
|
||||
gray74
|
||||
grey74
|
||||
gray75
|
||||
grey75
|
||||
gray76
|
||||
grey76
|
||||
gray77
|
||||
grey77
|
||||
gray78
|
||||
grey78
|
||||
gray79
|
||||
grey79
|
||||
gray80
|
||||
grey80
|
||||
gray81
|
||||
grey81
|
||||
gray82
|
||||
grey82
|
||||
gray83
|
||||
grey83
|
||||
gray84
|
||||
grey84
|
||||
gray85
|
||||
grey85
|
||||
gray86
|
||||
grey86
|
||||
gray87
|
||||
grey87
|
||||
gray88
|
||||
grey88
|
||||
gray89
|
||||
grey89
|
||||
gray90
|
||||
grey90
|
||||
gray91
|
||||
grey91
|
||||
gray92
|
||||
grey92
|
||||
gray93
|
||||
grey93
|
||||
gray94
|
||||
grey94
|
||||
gray95
|
||||
grey95
|
||||
gray96
|
||||
grey96
|
||||
gray97
|
||||
grey97
|
||||
gray98
|
||||
grey98
|
||||
gray99
|
||||
grey99
|
||||
gray100
|
||||
grey100
|
||||
dark-grey
|
||||
darkgrey
|
||||
dark-gray
|
||||
darkgray
|
||||
dark-blue
|
||||
darkblue
|
||||
dark-cyan
|
||||
darkcyan
|
||||
dark-magenta
|
||||
darkmagenta
|
||||
dark-red
|
||||
darkred
|
||||
light-green
|
||||
lightgreen
|
||||
crimson
|
||||
indigo
|
||||
olive
|
||||
rebecca-purple
|
||||
rebeccapurple
|
||||
silver
|
||||
teal
|
||||
479836
.github/actions/spell-check/dictionary/dictionary.txt
vendored
479836
.github/actions/spell-check/dictionary/dictionary.txt
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
powf
|
||||
sqrtf
|
||||
isnan
|
||||
@@ -1,40 +0,0 @@
|
||||
ACLs
|
||||
altform
|
||||
appendwttlogging
|
||||
backplating
|
||||
CPRs
|
||||
DACL
|
||||
DACLs
|
||||
dotnetfeed
|
||||
DWINRT
|
||||
enablewttlogging
|
||||
LKG
|
||||
mfcribbon
|
||||
microsoft
|
||||
microsoftonline
|
||||
netcore
|
||||
osgvsowi
|
||||
pgc
|
||||
pgo
|
||||
pgosweep
|
||||
powerrename
|
||||
powershell
|
||||
propkey
|
||||
pscustomobject
|
||||
robocopy
|
||||
SACLs
|
||||
Shobjidl
|
||||
Skype
|
||||
sysnative
|
||||
systemroot
|
||||
taskkill
|
||||
tasklist
|
||||
tdbuildteamid
|
||||
vcruntime
|
||||
visualstudio
|
||||
VSTHRD
|
||||
wlk
|
||||
wslpath
|
||||
wtl
|
||||
wtt
|
||||
wttlog
|
||||
63
.github/actions/spell-check/excludes.txt
vendored
63
.github/actions/spell-check/excludes.txt
vendored
@@ -1,63 +0,0 @@
|
||||
(?:^|/)dirs$
|
||||
(?:^|/)go\.mod$
|
||||
(?:^|/)go\.sum$
|
||||
(?:^|/)package-lock\.json$
|
||||
(?:^|/)sources(?:|\.dep)$
|
||||
SUMS$
|
||||
\.ai$
|
||||
\.bmp$
|
||||
\.cer$
|
||||
\.class$
|
||||
\.crl$
|
||||
\.crt$
|
||||
\.csr$
|
||||
\.dll$
|
||||
\.DS_Store$
|
||||
\.eot$
|
||||
\.eps$
|
||||
\.exe$
|
||||
\.gif$
|
||||
\.graffle$
|
||||
\.gz$
|
||||
\.icns$
|
||||
\.ico$
|
||||
\.jar$
|
||||
\.jpeg$
|
||||
\.jpg$
|
||||
\.key$
|
||||
\.lib$
|
||||
\.lock$
|
||||
\.map$
|
||||
\.min\..
|
||||
\.mp3$
|
||||
\.mp4$
|
||||
\.otf$
|
||||
\.pbxproj$
|
||||
\.pdf$
|
||||
\.pem$
|
||||
\.png$
|
||||
\.psd$
|
||||
\.runsettings$
|
||||
\.sig$
|
||||
\.so$
|
||||
\.svg$
|
||||
\.svgz$
|
||||
\.tar$
|
||||
\.tgz$
|
||||
\.ttf$
|
||||
\.woff
|
||||
\.xcf$
|
||||
\.xls
|
||||
\.xpm$
|
||||
\.yml$
|
||||
\.zip$
|
||||
^consolegit2gitfilters\.json$
|
||||
^dep/
|
||||
^oss/
|
||||
^doc/reference/UTF8-torture-test\.txt$
|
||||
^src/interactivity/onecore/BgfxEngine\.
|
||||
^src/renderer/wddmcon/WddmConRenderer\.
|
||||
^src/terminal/parser/ft_fuzzer/VTCommandFuzzer\.cpp$
|
||||
^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$
|
||||
^\.github/actions/spell-check/
|
||||
^\.gitignore$
|
||||
15
.github/actions/spell-check/expect/web.txt
vendored
15
.github/actions/spell-check/expect/web.txt
vendored
@@ -1,15 +0,0 @@
|
||||
http
|
||||
td
|
||||
www
|
||||
ecma
|
||||
rapidtables
|
||||
WCAG
|
||||
freedesktop
|
||||
ycombinator
|
||||
robertelder
|
||||
kovidgoyal
|
||||
leonerd
|
||||
fixterms
|
||||
uk
|
||||
winui
|
||||
appshellintegration
|
||||
@@ -1,23 +0,0 @@
|
||||
https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]*
|
||||
https://aka\.ms/[-a-zA-Z0-9?&=\/_]*
|
||||
https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf
|
||||
https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]*
|
||||
https://www.w3.org/[-a-zA-Z0-9?&=\/_#]*
|
||||
https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
||||
https://[a-z-]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
||||
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
||||
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
||||
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
||||
microsoft/cascadia-code\@[0-9a-fA-F]{40}
|
||||
\d+x\d+Logo
|
||||
Scro\&ll
|
||||
# selectionInput.cpp
|
||||
:\\windows\\syste\b
|
||||
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
|
||||
(?:hostSm|mach)\.ProcessString\(L"[^"]+"
|
||||
\b([A-Za-z])\1{3,}\b
|
||||
0x[0-9A-Za-z]+
|
||||
Base64::s_(?:En|De)code\(L"[^"]+"
|
||||
VERIFY_ARE_EQUAL\(L"[^"]+"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
|
||||
std::memory_order_[\w]+
|
||||
15
.github/actions/spelling/README.md
vendored
Normal file
15
.github/actions/spelling/README.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# check-spelling/check-spelling configuration
|
||||
|
||||
File | Purpose | Format | Info
|
||||
-|-|-|-
|
||||
[allow/*.txt](allow/) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow)
|
||||
[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject)
|
||||
[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
|
||||
[patterns/*.txt](patterns/) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
|
||||
[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns)
|
||||
[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
|
||||
[expect/*.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect)
|
||||
[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)
|
||||
|
||||
Note: you can replace any of these files with a directory by the same name (minus the suffix)
|
||||
and then include multiple files inside that directory (with that suffix) to merge multiple files together.
|
||||
48
.github/actions/spelling/advice.md
vendored
Normal file
48
.github/actions/spelling/advice.md
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
|
||||
<details>
|
||||
<summary>
|
||||
:pencil2: Contributor please read this
|
||||
</summary>
|
||||
|
||||
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
|
||||
|
||||
:warning: The command is written for posix shells. If it doesn't work for you, you can manually _add_ (one word per line) / _remove_ items to `expect.txt` and the `excludes.txt` files.
|
||||
|
||||
If the listed items are:
|
||||
|
||||
* ... **misspelled**, then please *correct* them instead of using the command.
|
||||
* ... *names*, please add them to `.github/actions/spelling/allow/names.txt`.
|
||||
* ... APIs, you can add them to a file in `.github/actions/spelling/allow/`.
|
||||
* ... just things you're using, please add them to an appropriate file in `.github/actions/spelling/expect/`.
|
||||
* ... tokens you only need in one place and shouldn't *generally be used*, you can add an item in an appropriate file in `.github/actions/spelling/patterns/`.
|
||||
|
||||
See the `README.md` in each directory for more information.
|
||||
|
||||
:microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:
|
||||
|
||||
|
||||
<details><summary>If the flagged items are :exploding_head: false positives</summary>
|
||||
|
||||
If items relate to a ...
|
||||
* binary file (or some other file you wouldn't want to check at all).
|
||||
|
||||
Please add a file path to the `excludes.txt` file matching the containing file.
|
||||
|
||||
File paths are Perl 5 Regular Expressions - you can [test](
|
||||
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
|
||||
|
||||
`^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
|
||||
../tree/HEAD/README.md) (on whichever branch you're using).
|
||||
|
||||
* well-formed pattern.
|
||||
|
||||
If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
|
||||
try adding it to the `patterns.txt` file.
|
||||
|
||||
Patterns are Perl 5 Regular Expressions - you can [test](
|
||||
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines.
|
||||
|
||||
Note that patterns can't match multiline strings.
|
||||
</details>
|
||||
|
||||
</details>
|
||||
@@ -1,6 +1,6 @@
|
||||
# Dictionaries are lists of words to accept unconditionally
|
||||
# Allow files are lists of words to accept unconditionally
|
||||
|
||||
While check spelling will complain about a whitelisted word
|
||||
While check spelling will complain about an expected word
|
||||
which is no longer present, you can include things here even if
|
||||
they are not otherwise present in the repository.
|
||||
|
||||
@@ -8,11 +8,11 @@ E.g., you could include a list of system APIs here, or potential
|
||||
contributors (so that if a future commit includes their name,
|
||||
it'll be accepted).
|
||||
|
||||
### Files
|
||||
## Files
|
||||
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| [Dictionary](dictionary.txt) | Primary US English dictionary |
|
||||
| [Allow](allow.txt) | Supplements to the dictionary |
|
||||
| [Chinese](chinese.txt) | Chinese words |
|
||||
| [Japanese](japanese.txt) | Japanese words |
|
||||
| [Microsoft](microsoft.txt) | Microsoft brand items |
|
||||
108
.github/actions/spelling/allow/allow.txt
vendored
Normal file
108
.github/actions/spelling/allow/allow.txt
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
admins
|
||||
allcolors
|
||||
Apc
|
||||
apc
|
||||
breadcrumb
|
||||
breadcrumbs
|
||||
bsd
|
||||
calt
|
||||
ccmp
|
||||
changelog
|
||||
clickable
|
||||
clig
|
||||
CMMI
|
||||
copyable
|
||||
cybersecurity
|
||||
dalet
|
||||
Dcs
|
||||
dcs
|
||||
dialytika
|
||||
dje
|
||||
downside
|
||||
downsides
|
||||
dze
|
||||
dzhe
|
||||
EDDB
|
||||
EDDC
|
||||
Enum'd
|
||||
Fitt
|
||||
formattings
|
||||
FTCS
|
||||
ftp
|
||||
fvar
|
||||
gantt
|
||||
gcc
|
||||
geeksforgeeks
|
||||
ghe
|
||||
github
|
||||
gje
|
||||
godbolt
|
||||
hostname
|
||||
hostnames
|
||||
https
|
||||
hyperlink
|
||||
hyperlinking
|
||||
hyperlinks
|
||||
iconify
|
||||
img
|
||||
inlined
|
||||
It'd
|
||||
kje
|
||||
libfuzzer
|
||||
libuv
|
||||
liga
|
||||
lje
|
||||
Llast
|
||||
llvm
|
||||
Lmid
|
||||
locl
|
||||
lol
|
||||
lorem
|
||||
Lorigin
|
||||
maxed
|
||||
minimalistic
|
||||
mkmk
|
||||
mnt
|
||||
mru
|
||||
nje
|
||||
noreply
|
||||
ogonek
|
||||
ok'd
|
||||
overlined
|
||||
pipeline
|
||||
postmodern
|
||||
ptys
|
||||
qof
|
||||
qps
|
||||
rclt
|
||||
reimplementation
|
||||
reserialization
|
||||
reserialize
|
||||
reserializes
|
||||
rlig
|
||||
runtimes
|
||||
shcha
|
||||
slnt
|
||||
Sos
|
||||
ssh
|
||||
timeline
|
||||
timelines
|
||||
timestamped
|
||||
TLDR
|
||||
tokenizes
|
||||
tonos
|
||||
toolset
|
||||
tshe
|
||||
ubuntu
|
||||
uiatextrange
|
||||
UIs
|
||||
und
|
||||
unregister
|
||||
versioned
|
||||
vsdevcmd
|
||||
We'd
|
||||
wildcards
|
||||
XBox
|
||||
YBox
|
||||
yeru
|
||||
zhe
|
||||
248
.github/actions/spelling/allow/apis.txt
vendored
Normal file
248
.github/actions/spelling/allow/apis.txt
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
ACCEPTFILES
|
||||
ACCESSDENIED
|
||||
acl
|
||||
aclapi
|
||||
alignas
|
||||
alignof
|
||||
APPLYTOSUBMENUS
|
||||
appxrecipe
|
||||
bitfield
|
||||
bitfields
|
||||
BUILDBRANCH
|
||||
BUILDMSG
|
||||
BUILDNUMBER
|
||||
BYCOMMAND
|
||||
BYPOSITION
|
||||
charconv
|
||||
CLASSNOTAVAILABLE
|
||||
CLOSEAPP
|
||||
cmdletbinding
|
||||
COLORPROPERTY
|
||||
colspan
|
||||
COMDLG
|
||||
commandlinetoargv
|
||||
comparand
|
||||
cstdint
|
||||
CXICON
|
||||
CYICON
|
||||
Dacl
|
||||
dataobject
|
||||
dcomp
|
||||
DERR
|
||||
dlldata
|
||||
DNE
|
||||
DONTADDTORECENT
|
||||
DWMSBT
|
||||
DWMWA
|
||||
DWMWA
|
||||
DWORDLONG
|
||||
endfor
|
||||
ENDSESSION
|
||||
enumset
|
||||
environstrings
|
||||
EXPCMDFLAGS
|
||||
EXPCMDSTATE
|
||||
filetime
|
||||
FILTERSPEC
|
||||
FORCEFILESYSTEM
|
||||
FORCEMINIMIZE
|
||||
frac
|
||||
fullkbd
|
||||
futex
|
||||
GETDESKWALLPAPER
|
||||
GETHIGHCONTRAST
|
||||
GETMOUSEHOVERTIME
|
||||
Hashtable
|
||||
HIGHCONTRASTON
|
||||
HIGHCONTRASTW
|
||||
hotkeys
|
||||
href
|
||||
hrgn
|
||||
HTCLOSE
|
||||
hwinsta
|
||||
HWINSTA
|
||||
IActivation
|
||||
IApp
|
||||
IAppearance
|
||||
IAsync
|
||||
IBind
|
||||
IBox
|
||||
IClass
|
||||
IComparable
|
||||
IComparer
|
||||
IConnection
|
||||
ICustom
|
||||
IDialog
|
||||
IDirect
|
||||
IExplorer
|
||||
IFACEMETHOD
|
||||
IFile
|
||||
IGraphics
|
||||
IInheritable
|
||||
IMap
|
||||
IMonarch
|
||||
IObject
|
||||
iosfwd
|
||||
IPackage
|
||||
IPeasant
|
||||
ISetup
|
||||
isspace
|
||||
IStorage
|
||||
istream
|
||||
IStringable
|
||||
ITab
|
||||
ITaskbar
|
||||
itow
|
||||
IUri
|
||||
IVirtual
|
||||
KEYSELECT
|
||||
LCID
|
||||
llabs
|
||||
llu
|
||||
localtime
|
||||
lround
|
||||
Lsa
|
||||
lsass
|
||||
LSHIFT
|
||||
LTGRAY
|
||||
MAINWINDOW
|
||||
memchr
|
||||
memicmp
|
||||
MENUCOMMAND
|
||||
MENUDATA
|
||||
MENUINFO
|
||||
MENUITEMINFOW
|
||||
mmeapi
|
||||
MOUSELEAVE
|
||||
mov
|
||||
mptt
|
||||
msappx
|
||||
MULTIPLEUSE
|
||||
NCHITTEST
|
||||
NCLBUTTONDBLCLK
|
||||
NCMOUSELEAVE
|
||||
NCMOUSEMOVE
|
||||
NCRBUTTONDBLCLK
|
||||
NIF
|
||||
NIN
|
||||
NOAGGREGATION
|
||||
NOASYNC
|
||||
NOCHANGEDIR
|
||||
NOPROGRESS
|
||||
NOREDIRECTIONBITMAP
|
||||
NOREPEAT
|
||||
NOTIFYBYPOS
|
||||
NOTIFYICON
|
||||
NOTIFYICONDATA
|
||||
ntprivapi
|
||||
oaidl
|
||||
ocidl
|
||||
ODR
|
||||
offsetof
|
||||
ofstream
|
||||
onefuzz
|
||||
osver
|
||||
OSVERSIONINFOEXW
|
||||
otms
|
||||
OUTLINETEXTMETRICW
|
||||
overridable
|
||||
PACL
|
||||
PAGESCROLL
|
||||
PATINVERT
|
||||
PEXPLICIT
|
||||
PICKFOLDERS
|
||||
pmr
|
||||
ptstr
|
||||
QUERYENDSESSION
|
||||
rcx
|
||||
REGCLS
|
||||
RETURNCMD
|
||||
rfind
|
||||
ROOTOWNER
|
||||
roundf
|
||||
RSHIFT
|
||||
SACL
|
||||
schandle
|
||||
semver
|
||||
serializer
|
||||
SETVERSION
|
||||
SHELLEXECUTEINFOW
|
||||
shobjidl
|
||||
SHOWHIDE
|
||||
SHOWMINIMIZED
|
||||
SHOWTIP
|
||||
SINGLEUSE
|
||||
SIZENS
|
||||
smoothstep
|
||||
snprintf
|
||||
spsc
|
||||
sregex
|
||||
SRWLOC
|
||||
SRWLOCK
|
||||
STDCPP
|
||||
STDMETHOD
|
||||
strchr
|
||||
strcpy
|
||||
streambuf
|
||||
strtoul
|
||||
Stubless
|
||||
Subheader
|
||||
Subpage
|
||||
syscall
|
||||
SYSTEMBACKDROP
|
||||
TABROW
|
||||
TASKBARCREATED
|
||||
TBPF
|
||||
THEMECHANGED
|
||||
tlg
|
||||
TME
|
||||
tmp
|
||||
tmpdir
|
||||
tolower
|
||||
toupper
|
||||
TRACKMOUSEEVENT
|
||||
TTask
|
||||
TVal
|
||||
UChar
|
||||
UFIELD
|
||||
ULARGE
|
||||
UOI
|
||||
UPDATEINIFILE
|
||||
userenv
|
||||
USEROBJECTFLAGS
|
||||
Viewbox
|
||||
virtualalloc
|
||||
wcsstr
|
||||
wcstoui
|
||||
winmain
|
||||
winsta
|
||||
winstamin
|
||||
wmemcmp
|
||||
wpc
|
||||
WSF
|
||||
wsregex
|
||||
wwinmain
|
||||
xchg
|
||||
XDocument
|
||||
XElement
|
||||
xfacet
|
||||
xhash
|
||||
XIcon
|
||||
xiosbase
|
||||
xlocale
|
||||
xlocbuf
|
||||
xlocinfo
|
||||
xlocmes
|
||||
xlocmon
|
||||
xlocnum
|
||||
xloctime
|
||||
XMax
|
||||
xmemory
|
||||
XParse
|
||||
xpath
|
||||
xstddef
|
||||
xstring
|
||||
xtree
|
||||
xutility
|
||||
YIcon
|
||||
YMax
|
||||
117
.github/actions/spelling/allow/colors.txt
vendored
Normal file
117
.github/actions/spelling/allow/colors.txt
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
alice
|
||||
aliceblue
|
||||
antiquewhite
|
||||
blanchedalmond
|
||||
blueviolet
|
||||
burlywood
|
||||
cadetblue
|
||||
cornflowerblue
|
||||
cornsilk
|
||||
cyan
|
||||
darkblue
|
||||
darkcyan
|
||||
darkgoldenrod
|
||||
darkgray
|
||||
darkgreen
|
||||
darkgrey
|
||||
darkkhaki
|
||||
darkmagenta
|
||||
darkolivegreen
|
||||
darkorange
|
||||
darkorchid
|
||||
darkred
|
||||
darksalmon
|
||||
darkseagreen
|
||||
darkslateblue
|
||||
darkslategray
|
||||
darkslategrey
|
||||
darkturquoise
|
||||
darkviolet
|
||||
deeppink
|
||||
deepskyblue
|
||||
dimgray
|
||||
dimgrey
|
||||
dodgerblue
|
||||
firebrick
|
||||
floralwhite
|
||||
forestgreen
|
||||
gainsboro
|
||||
ghostwhite
|
||||
greenyellow
|
||||
hotpink
|
||||
indian
|
||||
indianred
|
||||
lavenderblush
|
||||
lawngreen
|
||||
lemonchiffon
|
||||
lightblue
|
||||
lightcoral
|
||||
lightcyan
|
||||
lightgoldenrod
|
||||
lightgoldenrodyellow
|
||||
lightgray
|
||||
lightgreen
|
||||
lightgrey
|
||||
lightpink
|
||||
lightsalmon
|
||||
lightseagreen
|
||||
lightskyblue
|
||||
lightslateblue
|
||||
lightslategray
|
||||
lightslategrey
|
||||
lightsteelblue
|
||||
lightyellow
|
||||
limegreen
|
||||
mediumaquamarine
|
||||
mediumblue
|
||||
mediumorchid
|
||||
mediumpurple
|
||||
mediumseagreen
|
||||
mediumslateblue
|
||||
mediumspringgreen
|
||||
mediumturquoise
|
||||
mediumvioletred
|
||||
midnightblue
|
||||
mintcream
|
||||
mistyrose
|
||||
navajo
|
||||
navajowhite
|
||||
navyblue
|
||||
oldlace
|
||||
olivedrab
|
||||
orangered
|
||||
palegoldenrod
|
||||
palegreen
|
||||
paleturquoise
|
||||
palevioletred
|
||||
papayawhip
|
||||
peachpuff
|
||||
peru
|
||||
powderblue
|
||||
rebecca
|
||||
rebeccapurple
|
||||
rosybrown
|
||||
royalblue
|
||||
saddlebrown
|
||||
sandybrown
|
||||
seagreen
|
||||
sienna
|
||||
skyblue
|
||||
slateblue
|
||||
slategray
|
||||
slategrey
|
||||
springgreen
|
||||
steelblue
|
||||
violetred
|
||||
webgray
|
||||
webgreen
|
||||
webgrey
|
||||
webmaroon
|
||||
webpurple
|
||||
whitesmoke
|
||||
xaroon
|
||||
xray
|
||||
xreen
|
||||
xrey
|
||||
xurple
|
||||
yellowgreen
|
||||
@@ -1,8 +1,10 @@
|
||||
Consolas
|
||||
emoji
|
||||
emojis
|
||||
Extralight
|
||||
Gabriola
|
||||
Iosevka
|
||||
MDL
|
||||
Monofur
|
||||
Segoe
|
||||
wght
|
||||
11
.github/actions/spelling/allow/math.txt
vendored
Normal file
11
.github/actions/spelling/allow/math.txt
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
atan
|
||||
CPrime
|
||||
HBar
|
||||
HPrime
|
||||
isnan
|
||||
LPrime
|
||||
LStep
|
||||
powf
|
||||
RSub
|
||||
sqrtf
|
||||
ULP
|
||||
85
.github/actions/spelling/allow/microsoft.txt
vendored
Normal file
85
.github/actions/spelling/allow/microsoft.txt
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
ACLs
|
||||
ADMINS
|
||||
advapi
|
||||
altform
|
||||
altforms
|
||||
appendwttlogging
|
||||
appx
|
||||
appxbundle
|
||||
appxerror
|
||||
appxmanifest
|
||||
ATL
|
||||
backplating
|
||||
bitmaps
|
||||
BOMs
|
||||
CPLs
|
||||
cpptools
|
||||
cppvsdbg
|
||||
CPRs
|
||||
cryptbase
|
||||
DACL
|
||||
DACLs
|
||||
defaultlib
|
||||
diffs
|
||||
disposables
|
||||
dotnetfeed
|
||||
DTDs
|
||||
DWINRT
|
||||
enablewttlogging
|
||||
Intelli
|
||||
IVisual
|
||||
libucrt
|
||||
libucrtd
|
||||
LKG
|
||||
LOCKFILE
|
||||
Lxss
|
||||
mfcribbon
|
||||
microsoft
|
||||
microsoftonline
|
||||
MSAA
|
||||
msixbundle
|
||||
MSVC
|
||||
MSVCP
|
||||
muxc
|
||||
netcore
|
||||
Onefuzz
|
||||
osgvsowi
|
||||
PFILETIME
|
||||
pgc
|
||||
pgo
|
||||
pgosweep
|
||||
powerrename
|
||||
powershell
|
||||
propkey
|
||||
pscustomobject
|
||||
QWORD
|
||||
regedit
|
||||
robocopy
|
||||
SACLs
|
||||
sdkddkver
|
||||
Shobjidl
|
||||
Skype
|
||||
SRW
|
||||
sxs
|
||||
Sysinternals
|
||||
sysnative
|
||||
systemroot
|
||||
taskkill
|
||||
tasklist
|
||||
tdbuildteamid
|
||||
ucrt
|
||||
ucrtd
|
||||
unvirtualized
|
||||
VCRT
|
||||
vcruntime
|
||||
Virtualization
|
||||
visualstudio
|
||||
vscode
|
||||
VSTHRD
|
||||
winsdkver
|
||||
wlk
|
||||
wslpath
|
||||
wtl
|
||||
wtt
|
||||
wttlog
|
||||
Xamarin
|
||||
@@ -1,44 +1,66 @@
|
||||
Anup
|
||||
austdi
|
||||
arkthur
|
||||
Ballmer
|
||||
bhoj
|
||||
Bhojwani
|
||||
Bluloco
|
||||
carlos
|
||||
dhowett
|
||||
Diviness
|
||||
dsafa
|
||||
duhowett
|
||||
DXP
|
||||
ekg
|
||||
eryksun
|
||||
ethanschoonover
|
||||
Firefox
|
||||
Gatta
|
||||
glsl
|
||||
Gravell
|
||||
Grie
|
||||
Griese
|
||||
Hernan
|
||||
Howett
|
||||
Illhardt
|
||||
iquilezles
|
||||
italo
|
||||
jantari
|
||||
jerrysh
|
||||
Kaiyu
|
||||
kimwalisch
|
||||
KMehrain
|
||||
KODELIFE
|
||||
Kodelife
|
||||
Kourosh
|
||||
kowalczyk
|
||||
leonmsft
|
||||
Lepilleur
|
||||
lhecker
|
||||
lukesampson
|
||||
Macbook
|
||||
Manandhar
|
||||
masserano
|
||||
mbadolato
|
||||
Mehrain
|
||||
menger
|
||||
mgravell
|
||||
michaelniksa
|
||||
michkap
|
||||
migrie
|
||||
mikegr
|
||||
mikemaccana
|
||||
miloush
|
||||
miniksa
|
||||
niksa
|
||||
nvaccess
|
||||
nvda
|
||||
oising
|
||||
oldnewthing
|
||||
opengl
|
||||
osgwiki
|
||||
pabhojwa
|
||||
panos
|
||||
paulcam
|
||||
pauldotknopf
|
||||
PGP
|
||||
@@ -46,11 +68,18 @@ Pham
|
||||
Rincewind
|
||||
rprichard
|
||||
Schoonover
|
||||
shadertoy
|
||||
Shomnipotence
|
||||
simioni
|
||||
Somuah
|
||||
sonph
|
||||
sonpham
|
||||
stakx
|
||||
talo
|
||||
thereses
|
||||
Walisch
|
||||
WDX
|
||||
Wellons
|
||||
Wirt
|
||||
Wojciech
|
||||
zadjii
|
||||
523
.github/actions/spelling/candidate.patterns
vendored
Normal file
523
.github/actions/spelling/candidate.patterns
vendored
Normal file
@@ -0,0 +1,523 @@
|
||||
# marker to ignore all code on line
|
||||
^.*/\* #no-spell-check-line \*/.*$
|
||||
# marker for ignoring a comment to the end of the line
|
||||
// #no-spell-check.*$
|
||||
|
||||
# patch hunk comments
|
||||
^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .*
|
||||
# git index header
|
||||
index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
|
||||
|
||||
# cid urls
|
||||
(['"])cid:.*?\g{-1}
|
||||
|
||||
# data url in parens
|
||||
\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\)
|
||||
# data url in quotes
|
||||
([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1}
|
||||
# data url
|
||||
data:[-a-zA-Z=;:/0-9+]*,\S*
|
||||
|
||||
# mailto urls
|
||||
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
|
||||
|
||||
# magnet urls
|
||||
magnet:[?=:\w]+
|
||||
|
||||
# magnet urls
|
||||
"magnet:[^"]+"
|
||||
|
||||
# obs:
|
||||
"obs:[^"]*"
|
||||
|
||||
# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read
|
||||
# In this examples content, I'm using a number of different ways to match things to show various approaches
|
||||
# asciinema
|
||||
\basciinema\.org/a/[0-9a-zA-Z]+
|
||||
|
||||
# apple
|
||||
\bdeveloper\.apple\.com/[-\w?=/]+
|
||||
# Apple music
|
||||
\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+
|
||||
|
||||
# appveyor api
|
||||
\bci\.appveyor\.com/api/projects/status/[0-9a-z]+
|
||||
# appveyor project
|
||||
\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+
|
||||
|
||||
# Amazon
|
||||
|
||||
# Amazon
|
||||
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
|
||||
# AWS S3
|
||||
\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]*
|
||||
# AWS execute-api
|
||||
\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b
|
||||
# AWS ELB
|
||||
\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b
|
||||
# AWS SNS
|
||||
\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]*
|
||||
# AWS VPC
|
||||
vpc-\w+
|
||||
|
||||
# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there
|
||||
# YouTube url
|
||||
\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]*
|
||||
# YouTube music
|
||||
\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*)
|
||||
# YouTube tag
|
||||
<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"]
|
||||
# YouTube image
|
||||
\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]*
|
||||
# Google Accounts
|
||||
\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]*
|
||||
# Google Analytics
|
||||
\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]*
|
||||
# Google APIs
|
||||
\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+
|
||||
# Google Storage
|
||||
\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|)
|
||||
# Google Calendar
|
||||
\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+
|
||||
\w+\@group\.calendar\.google\.com\b
|
||||
# Google DataStudio
|
||||
\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|)
|
||||
# The leading `/` here is as opposed to the `\b` above
|
||||
# ... a short way to match `https://` or `http://` since most urls have one of those prefixes
|
||||
# Google Docs
|
||||
/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|))
|
||||
# Google Drive
|
||||
\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]*
|
||||
# Google Groups
|
||||
\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)*
|
||||
# Google Maps
|
||||
\bmaps\.google\.com/maps\?[\w&;=]*
|
||||
# Google themes
|
||||
themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+.
|
||||
# Google CDN
|
||||
\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]*
|
||||
# Goo.gl
|
||||
/goo\.gl/[a-zA-Z0-9]+
|
||||
# Google Chrome Store
|
||||
\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|)
|
||||
# Google Books
|
||||
\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]*
|
||||
# Google Fonts
|
||||
\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]*
|
||||
# Google Forms
|
||||
\bforms\.gle/\w+
|
||||
# Google Scholar
|
||||
\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+
|
||||
# Google Colab Research Drive
|
||||
\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]*
|
||||
|
||||
# GitHub SHAs (api)
|
||||
\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b
|
||||
# GitHub SHAs (markdown)
|
||||
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)
|
||||
# GitHub SHAs
|
||||
\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b
|
||||
# GitHub wiki
|
||||
\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b
|
||||
# githubusercontent
|
||||
/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
||||
# githubassets
|
||||
\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+)
|
||||
# gist github
|
||||
\bgist\.github\.com/[^/\s"]+/[0-9a-f]+
|
||||
# git.io
|
||||
\bgit\.io/[0-9a-zA-Z]+
|
||||
# GitHub JSON
|
||||
"node_id": "[-a-zA-Z=;:/0-9+]*"
|
||||
# Contributor
|
||||
\[[^\]]+\]\(https://github\.com/[^/\s"]+\)
|
||||
# GHSA
|
||||
GHSA(?:-[0-9a-z]{4}){3}
|
||||
|
||||
# GitLab commit
|
||||
\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b
|
||||
# GitLab merge requests
|
||||
\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b
|
||||
# GitLab uploads
|
||||
\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]*
|
||||
# GitLab commits
|
||||
\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b
|
||||
|
||||
# binanace
|
||||
accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
|
||||
|
||||
# bitbucket diff
|
||||
\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+
|
||||
# bitbucket repositories commits
|
||||
\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+
|
||||
# bitbucket commits
|
||||
\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+
|
||||
|
||||
# bit.ly
|
||||
\bbit\.ly/\w+
|
||||
|
||||
# bitrise
|
||||
\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]*
|
||||
|
||||
# bootstrapcdn.com
|
||||
\bbootstrapcdn\.com/[-./\w]+
|
||||
|
||||
# cdn.cloudflare.com
|
||||
\bcdnjs\.cloudflare\.com/[./\w]+
|
||||
|
||||
# circleci
|
||||
\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+
|
||||
|
||||
# gitter
|
||||
\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+
|
||||
|
||||
# gravatar
|
||||
\bgravatar\.com/avatar/[0-9a-f]+
|
||||
|
||||
# ibm
|
||||
[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]*
|
||||
|
||||
# imgur
|
||||
\bimgur\.com/[^.]+
|
||||
|
||||
# Internet Archive
|
||||
\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*)
|
||||
|
||||
# discord
|
||||
/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,}
|
||||
|
||||
# Disqus
|
||||
\bdisqus\.com/[-\w/%.()!?&=_]*
|
||||
|
||||
# medium link
|
||||
\blink\.medium\.com/[a-zA-Z0-9]+
|
||||
# medium
|
||||
\bmedium\.com/\@?[^/\s"]+/[-\w]+
|
||||
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]*
|
||||
# powerbi
|
||||
\bapp\.powerbi\.com/reportEmbed/[^"' ]*
|
||||
# vs devops
|
||||
\bvisualstudio.com(?::443|)/[-\w/?=%&.]*
|
||||
# microsoft store
|
||||
\bmicrosoft\.com/store/apps/\w+
|
||||
|
||||
# mvnrepository.com
|
||||
\bmvnrepository\.com/[-0-9a-z./]+
|
||||
|
||||
# now.sh
|
||||
/[0-9a-z-.]+\.now\.sh\b
|
||||
|
||||
# oracle
|
||||
\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]*
|
||||
|
||||
# chromatic.com
|
||||
/\S+.chromatic.com\S*[")]
|
||||
|
||||
# codacy
|
||||
\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+
|
||||
|
||||
# compai
|
||||
\bcompai\.pub/v1/png/[0-9a-f]+
|
||||
|
||||
# mailgun api
|
||||
\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]*
|
||||
# mailgun
|
||||
\b[0-9a-z]+.mailgun.org
|
||||
|
||||
# /message-id/
|
||||
/message-id/[-\w@./%]+
|
||||
|
||||
# Reddit
|
||||
\breddit\.com/r/[/\w_]*
|
||||
|
||||
# requestb.in
|
||||
\brequestb\.in/[0-9a-z]+
|
||||
|
||||
# sched
|
||||
\b[a-z0-9]+\.sched\.com\b
|
||||
|
||||
# Slack url
|
||||
slack://[a-zA-Z0-9?&=]+
|
||||
# Slack
|
||||
\bslack\.com/[-0-9a-zA-Z/_~?&=.]*
|
||||
# Slack edge
|
||||
\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+
|
||||
# Slack images
|
||||
\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+
|
||||
|
||||
# shields.io
|
||||
\bshields\.io/[-\w/%?=&.:+;,]*
|
||||
|
||||
# stackexchange -- https://stackexchange.com/feeds/sites
|
||||
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/)
|
||||
|
||||
# Sentry
|
||||
[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b
|
||||
|
||||
# Twitter markdown
|
||||
\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\)
|
||||
# Twitter hashtag
|
||||
\btwitter\.com/hashtag/[\w?_=&]*
|
||||
# Twitter status
|
||||
\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)
|
||||
# Twitter profile images
|
||||
\btwimg\.com/profile_images/[_\w./]*
|
||||
# Twitter media
|
||||
\btwimg\.com/media/[-_\w./?=]*
|
||||
# Twitter link shortened
|
||||
\bt\.co/\w+
|
||||
|
||||
# facebook
|
||||
\bfburl\.com/[0-9a-z_]+
|
||||
# facebook CDN
|
||||
\bfbcdn\.net/[\w/.,]*
|
||||
# facebook watch
|
||||
\bfb\.watch/[0-9A-Za-z]+
|
||||
|
||||
# dropbox
|
||||
\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+
|
||||
|
||||
# ipfs protocol
|
||||
ipfs://[0-9a-z]*
|
||||
# ipfs url
|
||||
/ipfs/[0-9a-z]*
|
||||
|
||||
# w3
|
||||
\bw3\.org/[-0-9a-zA-Z/#.]+
|
||||
|
||||
# loom
|
||||
\bloom\.com/embed/[0-9a-f]+
|
||||
|
||||
# regex101
|
||||
\bregex101\.com/r/[^/\s"]+/\d+
|
||||
|
||||
# figma
|
||||
\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+
|
||||
|
||||
# freecodecamp.org
|
||||
\bfreecodecamp\.org/[-\w/.]+
|
||||
|
||||
# image.tmdb.org
|
||||
\bimage\.tmdb\.org/[/\w.]+
|
||||
|
||||
# mermaid
|
||||
\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+
|
||||
|
||||
# Wikipedia
|
||||
\ben\.wikipedia\.org/wiki/[-\w%.#]+
|
||||
|
||||
# gitweb
|
||||
[^"\s]+/gitweb/\S+;h=[0-9a-f]+
|
||||
|
||||
# HyperKitty lists
|
||||
/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/
|
||||
|
||||
# lists
|
||||
/thread\.html/[^"\s]+
|
||||
|
||||
# list-management
|
||||
\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+
|
||||
|
||||
# kubectl.kubernetes.io/last-applied-configuration
|
||||
"kubectl.kubernetes.io/last-applied-configuration": ".*"
|
||||
|
||||
# pgp
|
||||
\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]*
|
||||
|
||||
# Spotify
|
||||
\bopen\.spotify\.com/embed/playlist/\w+
|
||||
|
||||
# Mastodon
|
||||
\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]*
|
||||
|
||||
# scastie
|
||||
\bscastie\.scala-lang\.org/[^/]+/\w+
|
||||
|
||||
# images.unsplash.com
|
||||
\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+
|
||||
|
||||
# pastebin
|
||||
\bpastebin\.com/[\w/]+
|
||||
|
||||
# heroku
|
||||
\b\w+\.heroku\.com/source/archive/\w+
|
||||
|
||||
# quip
|
||||
\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)?
|
||||
|
||||
# badgen.net
|
||||
\bbadgen\.net/badge/[^")\]'\s]+
|
||||
|
||||
# statuspage.io
|
||||
\w+\.statuspage\.io\b
|
||||
|
||||
# media.giphy.com
|
||||
\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+
|
||||
|
||||
# tinyurl
|
||||
\btinyurl\.com/\w+
|
||||
|
||||
# getopts
|
||||
\bgetopts\s+(?:"[^"]+"|'[^']+')
|
||||
|
||||
# ANSI color codes
|
||||
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
|
||||
|
||||
# URL escaped characters
|
||||
\%[0-9A-F][A-F]
|
||||
# IPv6
|
||||
\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b
|
||||
# c99 hex digits (not the full format, just one I've seen)
|
||||
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
|
||||
# Punycode
|
||||
\bxn--[-0-9a-z]+
|
||||
# sha
|
||||
sha\d+:[0-9]*[a-f]{3,}[0-9a-f]*
|
||||
# sha-... -- uses a fancy capture
|
||||
(['"]|")[0-9a-f]{40,}\g{-1}
|
||||
# hex runs
|
||||
\b[0-9a-fA-F]{16,}\b
|
||||
# hex in url queries
|
||||
=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?&
|
||||
# ssh
|
||||
(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,}
|
||||
|
||||
# PGP
|
||||
\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b
|
||||
# GPG keys
|
||||
\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b
|
||||
# Well known gpg keys
|
||||
.well-known/openpgpkey/[\w./]+
|
||||
|
||||
# uuid:
|
||||
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
|
||||
# integrity
|
||||
integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}"
|
||||
|
||||
# https://www.gnu.org/software/groff/manual/groff.html
|
||||
# man troff content
|
||||
\\f[BCIPR]
|
||||
# '
|
||||
\\\(aq
|
||||
|
||||
# .desktop mime types
|
||||
^MimeTypes?=.*$
|
||||
# .desktop localized entries
|
||||
^[A-Z][a-z]+\[[a-z]+\]=.*$
|
||||
# Localized .desktop content
|
||||
Name\[[^\]]+\]=.*
|
||||
|
||||
# IServiceProvider
|
||||
\bI(?=(?:[A-Z][a-z]{2,})+\b)
|
||||
|
||||
# crypt
|
||||
"\$2[ayb]\$.{56}"
|
||||
|
||||
# scrypt / argon
|
||||
\$(?:scrypt|argon\d+[di]*)\$\S+
|
||||
|
||||
# Input to GitHub JSON
|
||||
content: "[-a-zA-Z=;:/0-9+]*="
|
||||
|
||||
# Python stringprefix / binaryprefix
|
||||
# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings
|
||||
(?<!')\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})
|
||||
|
||||
# Regular expressions for (P|p)assword
|
||||
\([A-Z]\|[a-z]\)[a-z]+
|
||||
|
||||
# JavaScript regular expressions
|
||||
# javascript test regex
|
||||
/.*/[gim]*\.test\(
|
||||
# javascript match regex
|
||||
\.match\(/[^/\s"]*/[gim]*\s*
|
||||
# javascript match regex
|
||||
\.match\(/\\[b].*?/[gim]*\s*\)(?:;|$)
|
||||
# javascript regex
|
||||
^\s*/\\[b].*/[gim]*\s*(?:\)(?:;|$)|,$)
|
||||
# javascript replace regex
|
||||
\.replace\(/[^/\s"]*/[gim]*\s*,
|
||||
|
||||
# Go regular expressions
|
||||
regexp?\.MustCompile\(`[^`]*`\)
|
||||
|
||||
# sed regular expressions
|
||||
sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2}
|
||||
|
||||
# go install
|
||||
go install(?:\s+[a-z]+\.[-@\w/.]+)+
|
||||
|
||||
# kubernetes pod status lists
|
||||
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
|
||||
\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+
|
||||
|
||||
# kubectl - pods in CrashLoopBackOff
|
||||
\w+-[0-9a-f]+-\w+\s+\d+/\d+\s+CrashLoopBackOff\s+
|
||||
|
||||
# kubernetes object suffix
|
||||
-[0-9a-f]{10}-\w{5}\s
|
||||
|
||||
# posthog secrets
|
||||
posthog\.init\((['"])phc_[^"',]+\g{-1},
|
||||
|
||||
# xcode
|
||||
|
||||
# xcodeproject scenes
|
||||
(?:Controller|ID|id)="\w{3}-\w{2}-\w{3}"
|
||||
|
||||
# xcode api botches
|
||||
customObjectInstantitationMethod
|
||||
|
||||
# font awesome classes
|
||||
\.fa-[-a-z0-9]+
|
||||
|
||||
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
|
||||
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
|
||||
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
|
||||
## Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary).
|
||||
## You could manually change `(?i)X...` to use `[Xx]...`
|
||||
## or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path)
|
||||
# Lorem
|
||||
(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*
|
||||
|
||||
# Non-English
|
||||
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
|
||||
|
||||
# French
|
||||
# This corpus only had capital letters, but you probably want lowercase ones as well.
|
||||
\b[LN]'+[a-z]{2,}\b
|
||||
|
||||
# latex
|
||||
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
|
||||
|
||||
# the negative lookahead here is to allow catching 'templatesz' as a misspelling
|
||||
# but to otherwise recognize a Windows path with \templates\foo.template or similar:
|
||||
\\(?:necessary|r(?:eport|esolve[dr]?|esult)|t(?:arget|emplates?))(?![a-z])
|
||||
# ignore long runs of a single character:
|
||||
\b([A-Za-z])\g{-1}{3,}\b
|
||||
# Note that the next example is no longer necessary if you are using
|
||||
# to match a string starting with a `#`, use a character-class:
|
||||
[#]backwards
|
||||
# version suffix <word>v#
|
||||
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
||||
# Compiler flags (Scala)
|
||||
(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||
# Compiler flags
|
||||
#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||
|
||||
# Compiler flags (linker)
|
||||
,-B
|
||||
# curl arguments
|
||||
\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
|
||||
# set arguments
|
||||
\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)*
|
||||
# tar arguments
|
||||
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
|
||||
# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long...
|
||||
\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b
|
||||
# macOS temp folders
|
||||
/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/
|
||||
117
.github/actions/spelling/excludes.txt
vendored
Normal file
117
.github/actions/spelling/excludes.txt
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
|
||||
(?:(?i)\.png$)
|
||||
(?:^|/)(?i)COPYRIGHT
|
||||
(?:^|/)(?i)LICEN[CS]E
|
||||
(?:^|/)3rdparty/
|
||||
(?:^|/)dirs$
|
||||
(?:^|/)go\.mod$
|
||||
(?:^|/)go\.sum$
|
||||
(?:^|/)package(?:-lock|)\.json$
|
||||
(?:^|/)sources(?:|\.dep)$
|
||||
(?:^|/)vendor/
|
||||
\.a$
|
||||
\.ai$
|
||||
\.avi$
|
||||
\.bmp$
|
||||
\.bz2$
|
||||
\.cer$
|
||||
\.class$
|
||||
\.crl$
|
||||
\.crt$
|
||||
\.csr$
|
||||
\.dll$
|
||||
\.docx?$
|
||||
\.drawio$
|
||||
\.DS_Store$
|
||||
\.eot$
|
||||
\.eps$
|
||||
\.exe$
|
||||
\.gif$
|
||||
\.gitattributes$
|
||||
\.graffle$
|
||||
\.gz$
|
||||
\.icns$
|
||||
\.ico$
|
||||
\.jar$
|
||||
\.jks$
|
||||
\.jpeg$
|
||||
\.jpg$
|
||||
\.key$
|
||||
\.lib$
|
||||
\.lock$
|
||||
\.map$
|
||||
\.min\..
|
||||
\.mod$
|
||||
\.mp3$
|
||||
\.mp4$
|
||||
\.o$
|
||||
\.ocf$
|
||||
\.otf$
|
||||
\.pbxproj$
|
||||
\.pdf$
|
||||
\.pem$
|
||||
\.png$
|
||||
\.psd$
|
||||
\.pyc$
|
||||
\.runsettings$
|
||||
\.s$
|
||||
\.sig$
|
||||
\.so$
|
||||
\.svg$
|
||||
\.svgz$
|
||||
\.svgz?$
|
||||
\.tar$
|
||||
\.tgz$
|
||||
\.tiff?$
|
||||
\.ttf$
|
||||
\.vsdx$
|
||||
\.wav$
|
||||
\.webm$
|
||||
\.webp$
|
||||
\.woff
|
||||
\.woff2?$
|
||||
\.xcf$
|
||||
\.xls
|
||||
\.xlsx?$
|
||||
\.xpm$
|
||||
\.yml$
|
||||
\.zip$
|
||||
^\.github/actions/spelling/
|
||||
^\.github/fabricbot.json$
|
||||
^\.gitignore$
|
||||
^\Q.git-blame-ignore-revs\E$
|
||||
^\Q.github/workflows/spelling.yml\E$
|
||||
^\Qdoc/reference/windows-terminal-logo.ans\E$
|
||||
^\Qsamples/ConPTY/EchoCon/EchoCon/EchoCon.vcxproj.filters\E$
|
||||
^\Qsrc/host/exe/Host.EXE.vcxproj.filters\E$
|
||||
^\Qsrc/host/ft_host/chafa.txt\E$
|
||||
^\Qsrc/tools/closetest/CloseTest.vcxproj.filters\E$
|
||||
^\XamlStyler.json$
|
||||
^build/config/
|
||||
^consolegit2gitfilters\.json$
|
||||
^dep/
|
||||
^doc/reference/master-sequence-list.csv$
|
||||
^doc/reference/UTF8-torture-test\.txt$
|
||||
^oss/
|
||||
^src/host/ft_uia/run\.bat$
|
||||
^src/host/runft\.bat$
|
||||
^src/host/runut\.bat$
|
||||
^src/interactivity/onecore/BgfxEngine\.
|
||||
^src/renderer/atlas/
|
||||
^src/renderer/wddmcon/WddmConRenderer\.
|
||||
^src/terminal/adapter/ut_adapter/run\.bat$
|
||||
^src/terminal/parser/delfuzzpayload\.bat$
|
||||
^src/terminal/parser/ft_fuzzer/run\.bat$
|
||||
^src/terminal/parser/ft_fuzzer/VTCommandFuzzer\.cpp$
|
||||
^src/terminal/parser/ft_fuzzwrapper/run\.bat$
|
||||
^src/terminal/parser/ut_parser/Base64Test.cpp$
|
||||
^src/terminal/parser/ut_parser/run\.bat$
|
||||
^src/tools/integrity/packageuwp/ConsoleUWP\.appxSources$
|
||||
^src/tools/lnkd/lnkd\.bat$
|
||||
^src/tools/pixels/pixels\.bat$
|
||||
^src/tools/texttests/fira\.txt$
|
||||
^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$
|
||||
^src/types/ut_types/UtilsTests.cpp$
|
||||
^tools/ReleaseEngineering/ServicingPipeline.ps1$
|
||||
ignore$
|
||||
SUMS$
|
||||
@@ -1,16 +1,23 @@
|
||||
AAAa
|
||||
AAAAA
|
||||
AAAAAAAAAAAAA
|
||||
AAAAAABBBBBBCCC
|
||||
AAAAABBBBBBCCC
|
||||
abcd
|
||||
abcd
|
||||
abcde
|
||||
abcdef
|
||||
ABCDEFG
|
||||
ABCDEFGH
|
||||
ABCDEFGHIJ
|
||||
abcdefghijk
|
||||
ABCDEFGHIJKLMNO
|
||||
abcdefghijklmnop
|
||||
ABCDEFGHIJKLMNOPQRST
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
ABCG
|
||||
ABE
|
||||
abf
|
||||
BBBBB
|
||||
BBBBBBBB
|
||||
BBBBBCCC
|
||||
BBBBCCCCC
|
||||
BBGGRR
|
||||
BBBBBBBBBBBBBBDDDD
|
||||
EFG
|
||||
EFGh
|
||||
QQQQQQQQQQABCDEFGHIJ
|
||||
@@ -19,7 +26,6 @@ QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ
|
||||
QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ
|
||||
qrstuvwxyz
|
||||
qwerty
|
||||
QWERTYUIOP
|
||||
qwertyuiopasdfg
|
||||
YYYYYYYDDDDDDDDDDD
|
||||
ZAAZZ
|
||||
@@ -31,3 +37,4 @@ ZYXWVUT
|
||||
ZZBBZ
|
||||
ZZZBB
|
||||
ZZZBZ
|
||||
ZZZZZ
|
||||
File diff suppressed because it is too large
Load Diff
6
.github/actions/spelling/expect/web.txt
vendored
Normal file
6
.github/actions/spelling/expect/web.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
WCAG
|
||||
winui
|
||||
appshellintegration
|
||||
mdtauk
|
||||
gfycat
|
||||
Guake
|
||||
62
.github/actions/spelling/line_forbidden.patterns
vendored
Normal file
62
.github/actions/spelling/line_forbidden.patterns
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
|
||||
# \bm_data\b
|
||||
|
||||
# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test,
|
||||
# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want
|
||||
# to use this:
|
||||
#\bfit\(
|
||||
|
||||
# s.b. GitHub
|
||||
\bGithub\b
|
||||
|
||||
# s.b. GitLab
|
||||
\bGitlab\b
|
||||
|
||||
# s.b. JavaScript
|
||||
\bJavascript\b
|
||||
|
||||
# s.b. Microsoft
|
||||
\bMicroSoft\b
|
||||
|
||||
# s.b. another
|
||||
\ban[- ]other\b
|
||||
|
||||
# s.b. greater than
|
||||
\bgreater then\b
|
||||
|
||||
# s.b. into
|
||||
#\sin to\s
|
||||
|
||||
# s.b. opt-in
|
||||
\sopt in\s
|
||||
|
||||
# s.b. less than
|
||||
\bless then\b
|
||||
|
||||
# s.b. otherwise
|
||||
\bother[- ]wise\b
|
||||
|
||||
# s.b. nonexistent
|
||||
\bnon existing\b
|
||||
\b[Nn]o[nt][- ]existent\b
|
||||
|
||||
# s.b. preexisting
|
||||
[Pp]re[- ]existing
|
||||
|
||||
# s.b. preempt
|
||||
[Pp]re[- ]empt\b
|
||||
|
||||
# s.b. preemptively
|
||||
[Pp]re[- ]emptively
|
||||
|
||||
# s.b. reentrancy
|
||||
[Rr]e[- ]entrancy
|
||||
|
||||
# s.b. reentrant
|
||||
[Rr]e[- ]entrant
|
||||
|
||||
# s.b. workaround(s)
|
||||
#\bwork[- ]arounds?\b
|
||||
|
||||
# Reject duplicate words
|
||||
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
|
||||
96
.github/actions/spelling/patterns/patterns.txt
vendored
Normal file
96
.github/actions/spelling/patterns/patterns.txt
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
|
||||
|
||||
https?://\S+
|
||||
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
||||
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
||||
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
||||
microsoft/cascadia-code\@[0-9a-fA-F]{40}
|
||||
\d+x\d+Logo
|
||||
Scro\&ll
|
||||
# selectionInput.cpp
|
||||
:\\windows\\syste\b
|
||||
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
|
||||
(?:hostSm|mach)\.ProcessString\(L"[^"]+"
|
||||
\b([A-Za-z])\g{-1}{3,}\b
|
||||
0x[0-9A-Za-z]+
|
||||
Base64::s_(?:En|De)code\(L"[^"]+"
|
||||
VERIFY_ARE_EQUAL\(L"[^"]+"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
|
||||
std::memory_order_[\w]+
|
||||
D2DERR_SHADER_COMPILE_FAILED
|
||||
TIL_FEATURE_[0-9A-Z_]+
|
||||
vcvars\w*
|
||||
ROY\sG\.\sBIV
|
||||
!(?:(?i)ESC)!\[
|
||||
!(?:(?i)CSI)!(?:\d+(?:;\d+|)m|[ABCDF])
|
||||
|
||||
# Python stringprefix / binaryprefix
|
||||
\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'
|
||||
|
||||
# Automatically suggested patterns
|
||||
# hit-count: 3831 file-count: 582
|
||||
# IServiceProvider
|
||||
\bI(?=(?:[A-Z][a-z]{2,})+\b)
|
||||
|
||||
# hit-count: 71 file-count: 35
|
||||
# Compiler flags
|
||||
(?:^|[\t ,"'`=(])-[D](?=[A-Z]{2,}|[A-Z][a-z])
|
||||
(?:^|[\t ,"'`=(])-[X](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||
|
||||
# hit-count: 41 file-count: 28
|
||||
# version suffix <word>v#
|
||||
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
||||
|
||||
# hit-count: 20 file-count: 9
|
||||
# hex runs
|
||||
\b[0-9a-fA-F]{16,}\b
|
||||
|
||||
# hit-count: 10 file-count: 7
|
||||
# uuid:
|
||||
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
|
||||
|
||||
# hit-count: 4 file-count: 4
|
||||
# mailto urls
|
||||
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
|
||||
|
||||
# hit-count: 4 file-count: 1
|
||||
# ANSI color codes
|
||||
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
|
||||
|
||||
# hit-count: 2 file-count: 1
|
||||
# latex
|
||||
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# Non-English
|
||||
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# French
|
||||
# This corpus only had capital letters, but you probably want lowercase ones as well.
|
||||
\b[LN]'+[a-z]{2,}\b
|
||||
|
||||
# acceptable duplicates
|
||||
# ls directory listings
|
||||
[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
|
||||
# C/idl types + English ...
|
||||
\s(Guid|long|LONG|that) \g{-1}\s
|
||||
|
||||
# javadoc / .net
|
||||
(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
|
||||
|
||||
# Commit message -- Signed-off-by and friends
|
||||
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$
|
||||
|
||||
# Autogenerated revert commit message
|
||||
^This reverts commit [0-9a-f]{40}\.$
|
||||
|
||||
# vtmode
|
||||
--vtmode\s+(\w+)\s+\g{-1}\s
|
||||
|
||||
# ignore long runs of a single character:
|
||||
\b([A-Za-z])\g{-1}{3,}\b
|
||||
12
.github/actions/spelling/reject.txt
vendored
Normal file
12
.github/actions/spelling/reject.txt
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
^attache$
|
||||
^attacher$
|
||||
^attachers$
|
||||
benefitting
|
||||
occurences?
|
||||
^dependan.*
|
||||
^oer$
|
||||
Sorce
|
||||
^[Ss]pae.*
|
||||
^untill$
|
||||
^untilling$
|
||||
^wether.*
|
||||
7
.github/workflows/linter.yml
vendored
7
.github/workflows/linter.yml
vendored
@@ -37,12 +37,15 @@ jobs:
|
||||
##########################
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
with:
|
||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
|
||||
################################
|
||||
# Run Linter against code base #
|
||||
################################
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter@v3.10.0
|
||||
uses: github/super-linter@v3
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
DEFAULT_BRANCH: master
|
||||
|
||||
20
.github/workflows/spelling.yml
vendored
20
.github/workflows/spelling.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Spell checking
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
# * is a special character in YAML so you have to quote this string
|
||||
- cron: '15 * * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Spell checking
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.0.0
|
||||
with:
|
||||
fetch-depth: 5
|
||||
- uses: check-spelling/check-spelling@0.0.16-alpha
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
bucket: .github/actions
|
||||
project: spell-check
|
||||
134
.github/workflows/spelling2.yml
vendored
Normal file
134
.github/workflows/spelling2.yml
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
|
||||
name: Spell checking
|
||||
|
||||
# Comment management is handled through a secondary job, for details see:
|
||||
# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
|
||||
#
|
||||
# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
|
||||
# (in odd cases, it might actually run just to collapse a commment, but that's fairly rare)
|
||||
# it needs `contents: write` in order to add a comment.
|
||||
#
|
||||
# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
|
||||
# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment)
|
||||
# it needs `pull-requests: write` in order to manipulate those comments.
|
||||
|
||||
# Updating pull request branches is managed via comment handling.
|
||||
# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list
|
||||
#
|
||||
# These elements work together to make it happen:
|
||||
#
|
||||
# `on.issue_comment`
|
||||
# This event listens to comments by users asking to update the metadata.
|
||||
#
|
||||
# `jobs.update`
|
||||
# This job runs in response to an issue_comment and will push a new commit
|
||||
# to update the spelling metadata.
|
||||
#
|
||||
# `with.experimental_apply_changes_via_bot`
|
||||
# Tells the action to support and generate messages that enable it
|
||||
# to make a commit to update the spelling metadata.
|
||||
#
|
||||
# `with.ssh_key`
|
||||
# In order to trigger workflows when the commit is made, you can provide a
|
||||
# secret (typically, a write-enabled github deploy key).
|
||||
#
|
||||
# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
tags-ignore:
|
||||
- "**"
|
||||
pull_request_target:
|
||||
branches:
|
||||
- "**"
|
||||
tags-ignore:
|
||||
- "**"
|
||||
types:
|
||||
- 'opened'
|
||||
- 'reopened'
|
||||
- 'synchronize'
|
||||
issue_comment:
|
||||
types:
|
||||
- 'created'
|
||||
|
||||
jobs:
|
||||
spelling:
|
||||
name: Spell checking
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
actions: read
|
||||
outputs:
|
||||
followup: ${{ steps.spelling.outputs.followup }}
|
||||
runs-on: ubuntu-latest
|
||||
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
|
||||
concurrency:
|
||||
group: spelling-${{ github.event.pull_request.number || github.ref }}
|
||||
# note: If you use only_check_changed_files, you do not want cancel-in-progress
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: check-spelling
|
||||
id: spelling
|
||||
uses: check-spelling/check-spelling@v0.0.21
|
||||
with:
|
||||
suppress_push_for_open_pull_request: 1
|
||||
checkout: true
|
||||
check_file_names: 1
|
||||
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||
post_comment: 0
|
||||
use_magic_file: 1
|
||||
extra_dictionary_limit: 10
|
||||
extra_dictionaries:
|
||||
cspell:software-terms/src/software-terms.txt
|
||||
cspell:python/src/python/python-lib.txt
|
||||
cspell:node/node.txt
|
||||
cspell:cpp/src/stdlib-c.txt
|
||||
cspell:cpp/src/stdlib-cpp.txt
|
||||
cspell:fullstack/fullstack.txt
|
||||
cspell:filetypes/filetypes.txt
|
||||
cspell:html/html.txt
|
||||
cspell:cpp/src/compiler-msvc.txt
|
||||
cspell:python/src/common/extra.txt
|
||||
cspell:powershell/powershell.txt
|
||||
cspell:aws/aws.txt
|
||||
cspell:cpp/src/lang-keywords.txt
|
||||
cspell:npm/npm.txt
|
||||
cspell:dotnet/dotnet.txt
|
||||
cspell:python/src/python/python.txt
|
||||
cspell:css/css.txt
|
||||
cspell:cpp/src/stdlib-cmath.txt
|
||||
check_extra_dictionaries: ''
|
||||
|
||||
comment-push:
|
||||
name: Report (Push)
|
||||
# If your workflow isn't running on push, you can remove this job
|
||||
runs-on: ubuntu-latest
|
||||
needs: spelling
|
||||
permissions:
|
||||
contents: write
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@v0.0.21
|
||||
with:
|
||||
checkout: true
|
||||
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||
task: ${{ needs.spelling.outputs.followup }}
|
||||
|
||||
comment-pr:
|
||||
name: Report (PR)
|
||||
# If you workflow isn't running on pull_request*, you can remove this job
|
||||
runs-on: ubuntu-latest
|
||||
needs: spelling
|
||||
permissions:
|
||||
pull-requests: write
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@v0.0.21
|
||||
with:
|
||||
checkout: true
|
||||
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||
task: ${{ needs.spelling.outputs.followup }}
|
||||
@@ -172,6 +172,7 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsTerminal", "src\cascadia\WindowsTerminal\WindowsTerminal.vcxproj", "{CA5CAD1A-1754-4A9D-93D7-857A9D17CB1B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12} = {CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12}
|
||||
{CA5CAD1A-ABCD-429C-B551-8562EC954746} = {CA5CAD1A-ABCD-429C-B551-8562EC954746}
|
||||
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B} = {9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}
|
||||
@@ -180,6 +181,7 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalApp", "src\cascadia\TerminalApp\dll\TerminalApp.vcxproj", "{CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-9A12-429C-B551-8562EC954746} = {CA5CAD1A-9A12-429C-B551-8562EC954746}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B} = {CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
@@ -233,6 +235,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAppLib", "src\casca
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LocalTests_TerminalApp", "src\cascadia\LocalTests_TerminalApp\TerminalApp.LocalTests.vcxproj", "{CA5CAD1A-B11C-4DDB-A4FE-C3AFAE9B5506}"
|
||||
@@ -315,6 +318,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfTerminalTestNetCore", "s
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wt", "src\cascadia\wt\wt.vcxproj", "{506FD703-BAA7-4F6E-9361-64F550EC8FCA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Settings.Editor", "src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj", "{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Settings.Model.Lib", "src\cascadia\TerminalSettingsModel\Microsoft.Terminal.Settings.ModelLib.vcxproj", "{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
@@ -2012,6 +2020,45 @@ Global
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x64.Build.0 = Release|x64
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.ActiveCfg = Release|Win32
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.Deploy.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|DotNet_x64Test.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.Build.0 = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.Build.0 = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|DotNet_x64Test.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.Deploy.0 = Release|Win32
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
|
||||
@@ -2170,6 +2217,7 @@ Global
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
|
||||
{1588FD7C-241E-4E7D-9113-43735F3E6BAD} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-9B68-456A-B13E-C8218070DC42} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
|
||||
|
||||
@@ -79,6 +79,7 @@ page](https://chocolatey.org/packages/microsoft-windows-terminal) and follow the
|
||||
release by installing the `windows-terminal` package:
|
||||
|
||||
```powershell
|
||||
scoop bucket add extras
|
||||
scoop install windows-terminal
|
||||
```
|
||||
|
||||
|
||||
18
build/rules/Branding.targets
Normal file
18
build/rules/Branding.targets
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Preview'">WT_BRANDING_PREVIEW</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Release'">WT_BRANDING_RELEASE</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(_WTBrandingPreprocessorToken)'==''">WT_BRANDING_DEV</_WTBrandingPreprocessorToken>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>$(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
@@ -2281,32 +2281,35 @@ std::wstring TextBuffer::GetHyperlinkUriFromId(uint16_t id) const
|
||||
// - The user-defined id
|
||||
// Return value:
|
||||
// - The internal hyperlink ID
|
||||
uint16_t TextBuffer::GetHyperlinkId(std::wstring_view params)
|
||||
uint16_t TextBuffer::GetHyperlinkId(std::wstring_view uri, std::wstring_view id)
|
||||
{
|
||||
uint16_t id = 0;
|
||||
if (params.empty())
|
||||
uint16_t numericId = 0;
|
||||
if (id.empty())
|
||||
{
|
||||
// no custom id specified, return our internal count
|
||||
id = _currentHyperlinkId;
|
||||
numericId = _currentHyperlinkId;
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// assign _currentHyperlinkId if the custom id does not already exist
|
||||
const auto result = _hyperlinkCustomIdMap.emplace(params, _currentHyperlinkId);
|
||||
std::wstring newId{ id };
|
||||
// hash the URL and add it to the custom ID - GH#7698
|
||||
newId += L"%" + std::to_wstring(std::hash<std::wstring_view>{}(uri));
|
||||
const auto result = _hyperlinkCustomIdMap.emplace(newId, _currentHyperlinkId);
|
||||
if (result.second)
|
||||
{
|
||||
// the custom id did not already exist
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
id = (*(result.first)).second;
|
||||
numericId = (*(result.first)).second;
|
||||
}
|
||||
// _currentHyperlinkId could overflow, make sure its not 0
|
||||
if (_currentHyperlinkId == 0)
|
||||
{
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
return id;
|
||||
return numericId;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
void AddHyperlinkToMap(std::wstring_view uri, uint16_t id);
|
||||
std::wstring GetHyperlinkUriFromId(uint16_t id) const;
|
||||
uint16_t GetHyperlinkId(std::wstring_view params);
|
||||
uint16_t GetHyperlinkId(std::wstring_view uri, std::wstring_view id);
|
||||
void RemoveHyperlinkFromMap(uint16_t id);
|
||||
std::wstring GetCustomIdFromId(uint16_t id) const;
|
||||
void CopyHyperlinkMaps(const TextBuffer& OtherBuffer);
|
||||
|
||||
@@ -80,6 +80,8 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(TestUnbindNestedCommand);
|
||||
TEST_METHOD(TestRebindNestedCommand);
|
||||
|
||||
TEST_METHOD(TestCopy);
|
||||
|
||||
TEST_CLASS_SETUP(ClassSetup)
|
||||
{
|
||||
InitializeJsonReader();
|
||||
@@ -2370,4 +2372,92 @@ namespace SettingsModelLocalTests
|
||||
}
|
||||
}
|
||||
|
||||
void DeserializationTests::TestCopy()
|
||||
{
|
||||
const std::string settingsJson{ R"(
|
||||
{
|
||||
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"initialCols": 50,
|
||||
"profiles":
|
||||
[
|
||||
{
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"name": "Custom Profile",
|
||||
"fontFace": "Cascadia Code"
|
||||
}
|
||||
],
|
||||
"schemes":
|
||||
[
|
||||
{
|
||||
"name": "Campbell, but for a test",
|
||||
"foreground": "#CCCCCC",
|
||||
"background": "#0C0C0C",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"black": "#0C0C0C",
|
||||
"red": "#C50F1F",
|
||||
"green": "#13A10E",
|
||||
"yellow": "#C19C00",
|
||||
"blue": "#0037DA",
|
||||
"purple": "#881798",
|
||||
"cyan": "#3A96DD",
|
||||
"white": "#CCCCCC",
|
||||
"brightBlack": "#767676",
|
||||
"brightRed": "#E74856",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightWhite": "#F2F2F2"
|
||||
}
|
||||
],
|
||||
"actions":
|
||||
[
|
||||
{ "command": "openSettings", "keys": "ctrl+," },
|
||||
{ "command": { "action": "openSettings", "target": "defaultsFile" }, "keys": "ctrl+alt+," },
|
||||
|
||||
{
|
||||
"name": { "key": "SetColorSchemeParentCommandName" },
|
||||
"commands": [
|
||||
{
|
||||
"iterateOn": "schemes",
|
||||
"name": "${scheme.name}",
|
||||
"command": { "action": "setColorScheme", "colorScheme": "${scheme.name}" }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
VerifyParseSucceeded(settingsJson);
|
||||
|
||||
auto settings{ winrt::make_self<implementation::CascadiaSettings>() };
|
||||
settings->_ParseJsonString(settingsJson, false);
|
||||
settings->LayerJson(settings->_userSettings);
|
||||
settings->_ValidateSettings();
|
||||
|
||||
const auto copy{ settings->Copy() };
|
||||
const auto copyImpl{ winrt::get_self<implementation::CascadiaSettings>(copy) };
|
||||
|
||||
// test globals
|
||||
VERIFY_ARE_EQUAL(settings->_globals->DefaultProfile(), copyImpl->_globals->DefaultProfile());
|
||||
|
||||
// test profiles
|
||||
VERIFY_ARE_EQUAL(settings->_profiles.Size(), copyImpl->_profiles.Size());
|
||||
VERIFY_ARE_EQUAL(settings->_profiles.GetAt(0).Name(), copyImpl->_profiles.GetAt(0).Name());
|
||||
|
||||
// test schemes
|
||||
const auto schemeName{ L"Campbell, but for a test" };
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_colorSchemes.Size(), copyImpl->_globals->_colorSchemes.Size());
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_colorSchemes.HasKey(schemeName), copyImpl->_globals->_colorSchemes.HasKey(schemeName));
|
||||
|
||||
// test actions
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_keymap->_keyShortcuts.size(), copyImpl->_globals->_keymap->_keyShortcuts.size());
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_commands.Size(), copyImpl->_globals->_commands.Size());
|
||||
|
||||
// Test that changing the copy should not change the original
|
||||
VERIFY_ARE_EQUAL(settings->_globals->WordDelimiters(), copyImpl->_globals->WordDelimiters());
|
||||
copyImpl->_globals->WordDelimiters(L"changed value");
|
||||
VERIFY_ARE_NOT_EQUAL(settings->_globals->WordDelimiters(), copyImpl->_globals->WordDelimiters());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "../TerminalApp/MinMaxCloseControl.h"
|
||||
#include "../TerminalApp/TabRowControl.h"
|
||||
#include "../TerminalApp/ShortcutActionDispatch.h"
|
||||
#include "../TerminalApp/Tab.h"
|
||||
#include "../TerminalApp/TerminalTab.h"
|
||||
#include "../CppWinrtTailored.h"
|
||||
|
||||
using namespace Microsoft::Console;
|
||||
@@ -62,6 +62,10 @@ namespace TerminalAppLocalTests
|
||||
TEST_METHOD(TryDuplicateBadTab);
|
||||
TEST_METHOD(TryDuplicateBadPane);
|
||||
|
||||
TEST_METHOD(TryZoomPane);
|
||||
TEST_METHOD(MoveFocusFromZoomedPane);
|
||||
TEST_METHOD(CloseZoomedPane);
|
||||
|
||||
TEST_CLASS_SETUP(ClassSetup)
|
||||
{
|
||||
return true;
|
||||
@@ -75,6 +79,7 @@ namespace TerminalAppLocalTests
|
||||
private:
|
||||
void _initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
|
||||
CascadiaSettings initialSettings);
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> _commonSetup();
|
||||
};
|
||||
|
||||
void TabTests::EnsureTestsActivate()
|
||||
@@ -245,8 +250,8 @@ namespace TerminalAppLocalTests
|
||||
// In the real app, this isn't a problem, but doesn't happen
|
||||
// reliably in the unit tests.
|
||||
Log::Comment(L"Ensure we set the first tab as the selected one.");
|
||||
auto tab{ page->_GetStrongTabImpl(0) };
|
||||
page->_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
page->_tabView.SelectedItem(tab->TabViewItem());
|
||||
page->_UpdatedSelectedTab(0);
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -448,7 +453,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
result = RunOnUIThread([&page]() {
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
VERIFY_ARE_EQUAL(1, tab->GetLeafPaneCount());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -458,7 +463,7 @@ namespace TerminalAppLocalTests
|
||||
page->_SplitPane(SplitState::Automatic, SplitType::Duplicate, nullptr);
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
VERIFY_ARE_EQUAL(2, tab->GetLeafPaneCount());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -476,7 +481,7 @@ namespace TerminalAppLocalTests
|
||||
page->_SplitPane(SplitState::Automatic, SplitType::Duplicate, nullptr);
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
VERIFY_ARE_EQUAL(2,
|
||||
tab->GetLeafPaneCount(),
|
||||
L"We should gracefully do nothing here - the profile no longer exists.");
|
||||
@@ -496,4 +501,192 @@ namespace TerminalAppLocalTests
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - This is a helper method for setting up a TerminalPage with some common
|
||||
// settings, and creating the first tab.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The initialized TerminalPage, ready to use.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> TabTests::_commonSetup()
|
||||
{
|
||||
const std::string settingsJson0{ R"(
|
||||
{
|
||||
"defaultProfile": "{6239a42c-1111-49a3-80bd-e8fdd045185c}",
|
||||
"profiles": [
|
||||
{
|
||||
"name" : "profile0",
|
||||
"guid": "{6239a42c-1111-49a3-80bd-e8fdd045185c}",
|
||||
"historySize": 1
|
||||
},
|
||||
{
|
||||
"name" : "profile1",
|
||||
"guid": "{6239a42c-2222-49a3-80bd-e8fdd045185c}",
|
||||
"historySize": 2
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
CascadiaSettings settings0{ til::u8u16(settingsJson0) };
|
||||
VERIFY_IS_NOT_NULL(settings0);
|
||||
|
||||
const auto guid1 = Microsoft::Console::Utils::GuidFromString(L"{6239a42c-1111-49a3-80bd-e8fdd045185c}");
|
||||
const auto guid2 = Microsoft::Console::Utils::GuidFromString(L"{6239a42c-2222-49a3-80bd-e8fdd045185c}");
|
||||
|
||||
// This is super wacky, but we can't just initialize the
|
||||
// com_ptr<impl::TerminalPage> in the lambda and assign it back out of
|
||||
// the lambda. We'll crash trying to get a weak_ref to the TerminalPage
|
||||
// during TerminalPage::Create() below.
|
||||
//
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
void TabTests::TryZoomPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
// eventArgs.Args(args);
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
ActionEventArgs eventArgs{};
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom out of the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
ActionEventArgs eventArgs{};
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
|
||||
void TabTests::MoveFocusFromZoomedPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Move focus. This will cause us to un-zoom.");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
MoveFocusArgs args{ Direction::Left };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
|
||||
page->_HandleMoveFocus(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
|
||||
void TabTests::CloseZoomedPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Close Pane. This should cause us to un-zoom, and remove the second pane from the tree");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleClosePane(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
// Introduce a slight delay to let the events finish propagating
|
||||
Sleep(250);
|
||||
|
||||
Log::Comment(L"Check to ensure there's only one pane left.");
|
||||
|
||||
result = RunOnUIThread([&page]() {
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(1, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
|
||||
<!-- If you don't reference these projects here, the
|
||||
_ConsoleGenerateAdditionalWinmdManifests step won't gather the winmd's -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\dll\TerminalApp.vcxproj" />
|
||||
|
||||
@@ -94,6 +94,8 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
|
||||
<Project>{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}</Project>
|
||||
</ProjectReference>
|
||||
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalApp\dll\TerminalApp.vcxproj">
|
||||
|
||||
@@ -122,22 +122,26 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleTogglePaneZoom(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
auto activeTab = _GetFocusedTab();
|
||||
|
||||
// Don't do anything if there's only one pane. It's already zoomed.
|
||||
if (activeTab && activeTab->GetLeafPaneCount() > 1)
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
// First thing's first, remove the current content from the UI
|
||||
// tree. This is important, because we might be leaving zoom, and if
|
||||
// a pane is zoomed, then it's currently in the UI tree, and should
|
||||
// be removed before it's re-added in Pane::Restore
|
||||
_tabContent.Children().Clear();
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
// Don't do anything if there's only one pane. It's already zoomed.
|
||||
if (activeTab && activeTab->GetLeafPaneCount() > 1)
|
||||
{
|
||||
// First thing's first, remove the current content from the UI
|
||||
// tree. This is important, because we might be leaving zoom, and if
|
||||
// a pane is zoomed, then it's currently in the UI tree, and should
|
||||
// be removed before it's re-added in Pane::Restore
|
||||
_tabContent.Children().Clear();
|
||||
|
||||
activeTab->ToggleZoom();
|
||||
|
||||
// Update the selected tab, to trigger us to re-add the tab's GetRootElement to the UI tree
|
||||
_UpdatedSelectedTab(_tabView.SelectedIndex());
|
||||
// Togging the zoom on the tab will cause the tab to inform us of
|
||||
// the new root Content for this tab.
|
||||
activeTab->ToggleZoom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
args.Handled(true);
|
||||
}
|
||||
|
||||
@@ -316,16 +320,19 @@ namespace winrt::TerminalApp::implementation
|
||||
args.Handled(false);
|
||||
if (const auto& realArgs = args.ActionArgs().try_as<SetColorSchemeArgs>())
|
||||
{
|
||||
if (auto activeTab = _GetFocusedTab())
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
if (auto activeControl = activeTab->GetActiveTerminalControl())
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
|
||||
if (auto activeControl = activeTab->GetActiveTerminalControl())
|
||||
{
|
||||
auto controlSettings = activeControl.Settings().as<TerminalSettings>();
|
||||
controlSettings->ApplyColorScheme(scheme);
|
||||
activeControl.UpdateSettings(*controlSettings);
|
||||
args.Handled(true);
|
||||
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
|
||||
{
|
||||
auto controlSettings = activeControl.Settings().as<TerminalSettings>();
|
||||
controlSettings->ApplyColorScheme(scheme);
|
||||
activeControl.UpdateSettings(*controlSettings);
|
||||
args.Handled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,16 +352,18 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
if (tabColor.has_value())
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
activeTab->SetRuntimeTabColor(tabColor.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetRuntimeTabColor();
|
||||
if (tabColor.has_value())
|
||||
{
|
||||
activeTab->SetRuntimeTabColor(tabColor.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetRuntimeTabColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
args.Handled(true);
|
||||
@@ -363,10 +372,12 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleOpenTabColorPicker(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
activeTab->ActivateColorPicker();
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
activeTab->ActivateColorPicker();
|
||||
}
|
||||
}
|
||||
args.Handled(true);
|
||||
}
|
||||
@@ -381,16 +392,18 @@ namespace winrt::TerminalApp::implementation
|
||||
title = realArgs.Title();
|
||||
}
|
||||
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
if (title.has_value())
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
activeTab->SetTabText(title.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetTabText();
|
||||
if (title.has_value())
|
||||
{
|
||||
activeTab->SetTabText(title.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetTabText();
|
||||
}
|
||||
}
|
||||
}
|
||||
args.Handled(true);
|
||||
@@ -489,6 +502,14 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleOpenTabSearch(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
// Tab search is always in-order.
|
||||
auto tabCommands = winrt::single_threaded_vector<Command>();
|
||||
for (const auto& tab : _tabs)
|
||||
{
|
||||
tabCommands.Append(tab.SwitchToTabCommand());
|
||||
}
|
||||
CommandPalette().SetTabActions(tabCommands);
|
||||
|
||||
auto opt = _GetFocusedTabIndex();
|
||||
uint32_t startIdx = opt.value_or(0);
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "AppLogic.g.h"
|
||||
|
||||
#include "Tab.h"
|
||||
#include "TerminalPage.h"
|
||||
#include "Jumplist.h"
|
||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||
|
||||
@@ -615,6 +615,12 @@ namespace winrt::TerminalApp::implementation
|
||||
_updateFilteredActions();
|
||||
}
|
||||
|
||||
void CommandPalette::SetTabActions(Collections::IVector<Command> const& tabs)
|
||||
{
|
||||
_allTabActions = tabs;
|
||||
_updateFilteredActions();
|
||||
}
|
||||
|
||||
void CommandPalette::EnableCommandPaletteMode()
|
||||
{
|
||||
_switchToMode(CommandPaletteMode::ActionMode);
|
||||
@@ -976,45 +982,6 @@ namespace winrt::TerminalApp::implementation
|
||||
_currentNestedCommands.Clear();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Listens for changes to TerminalPage's _tabs vector. Updates our vector of
|
||||
// tab switching commands accordingly.
|
||||
// Arguments:
|
||||
// - s: The vector being listened to.
|
||||
// - e: The vector changed args that tells us whether a change, insert, or removal was performed
|
||||
// on the listened-to vector.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::OnTabsChanged(const IInspectable& s, const IVectorChangedEventArgs& e)
|
||||
{
|
||||
if (auto tabList = s.try_as<IObservableVector<TerminalApp::Tab>>())
|
||||
{
|
||||
auto idx = e.Index();
|
||||
auto changedEvent = e.CollectionChange();
|
||||
|
||||
switch (changedEvent)
|
||||
{
|
||||
case CollectionChange::ItemChanged:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case CollectionChange::ItemInserted:
|
||||
{
|
||||
auto tab = tabList.GetAt(idx);
|
||||
_allTabActions.InsertAt(idx, tab.SwitchToTabCommand());
|
||||
break;
|
||||
}
|
||||
case CollectionChange::ItemRemoved:
|
||||
{
|
||||
_allTabActions.RemoveAt(idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_updateFilteredActions();
|
||||
}
|
||||
}
|
||||
|
||||
void CommandPalette::EnableTabSwitcherMode(const bool searchMode, const uint32_t startIdx)
|
||||
{
|
||||
_switcherStartIdx = startIdx;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace winrt::TerminalApp::implementation
|
||||
Windows::Foundation::Collections::IObservableVector<Microsoft::Terminal::Settings::Model::Command> FilteredActions();
|
||||
|
||||
void SetCommands(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command> const& actions);
|
||||
void SetTabActions(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command> const& tabs);
|
||||
void SetKeyBindings(Microsoft::Terminal::TerminalControl::IKeyBindings bindings);
|
||||
|
||||
void EnableCommandPaletteMode();
|
||||
@@ -35,7 +36,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Tab Switcher
|
||||
void EnableTabSwitcherMode(const bool searchMode, const uint32_t startIdx);
|
||||
void OnTabsChanged(const Windows::Foundation::IInspectable& s, const Windows::Foundation::Collections::IVectorChangedEventArgs& e);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, NoMatchesText, _PropertyChangedHandlers);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace TerminalApp
|
||||
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Model.Command> FilteredActions { get; };
|
||||
|
||||
void SetCommands(Windows.Foundation.Collections.IVector<Microsoft.Terminal.Settings.Model.Command> actions);
|
||||
void SetTabActions(Windows.Foundation.Collections.IVector<Microsoft.Terminal.Settings.Model.Command> tabs);
|
||||
void SetKeyBindings(Microsoft.Terminal.TerminalControl.IKeyBindings bindings);
|
||||
void EnableCommandPaletteMode();
|
||||
|
||||
@@ -27,6 +28,5 @@ namespace TerminalApp
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
|
||||
void EnableTabSwitcherMode(Boolean searchMode, UInt32 startIdx);
|
||||
void OnTabsChanged(IInspectable s, Windows.Foundation.Collections.IVectorChangedEventArgs e);
|
||||
}
|
||||
}
|
||||
|
||||
21
src/cascadia/TerminalApp/ITab.idl
Normal file
21
src/cascadia/TerminalApp/ITab.idl
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import "ShortcutActionDispatch.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
interface ITab
|
||||
{
|
||||
String Title { get; };
|
||||
String Icon { get; };
|
||||
Microsoft.Terminal.Settings.Model.Command SwitchToTabCommand;
|
||||
Microsoft.UI.Xaml.Controls.TabViewItem TabViewItem { get; };
|
||||
Windows.UI.Xaml.FrameworkElement Content { get; };
|
||||
Windows.UI.Xaml.FocusState FocusState { get; };
|
||||
|
||||
void Focus(Windows.UI.Xaml.FocusState focusState);
|
||||
void Shutdown();
|
||||
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
}
|
||||
}
|
||||
@@ -702,6 +702,16 @@ void Pane::_CloseChild(const bool closeFirst)
|
||||
if (_lastActive)
|
||||
{
|
||||
_control.Focus(FocusState::Programmatic);
|
||||
|
||||
// See GH#7252
|
||||
// Manually fire off the GotFocus event. Typically, this is done
|
||||
// automatically when the control gets focused. However, if we're
|
||||
// `exit`ing a zoomed pane, then the other sibling isn't in the UI
|
||||
// tree currently. So the above call to Focus won't actually focus
|
||||
// the control. Because Tab is relying on GotFocus to know who the
|
||||
// active pane in the tree is, without this call, _no one_ will be
|
||||
// the active pane any longer.
|
||||
_GotFocusHandlers(shared_from_this());
|
||||
}
|
||||
|
||||
_UpdateBorders();
|
||||
@@ -813,11 +823,13 @@ winrt::fire_and_forget Pane::_CloseChildRoutine(const bool closeFirst)
|
||||
const auto animationsEnabledInOS = uiSettings.AnimationsEnabled();
|
||||
const auto animationsEnabledInApp = Media::Animation::Timeline::AllowDependentAnimations();
|
||||
|
||||
// GH#7252: If either child is zoomed, just skip the animation. It won't work.
|
||||
const bool eitherChildZoomed = pane->_firstChild->_zoomed || pane->_secondChild->_zoomed;
|
||||
// If animations are disabled, just skip this and go straight to
|
||||
// _CloseChild. Curiously, the pane opening animation doesn't need this,
|
||||
// and will skip straight to Completed when animations are disabled, but
|
||||
// this one doesn't seem to.
|
||||
if (!animationsEnabledInOS || !animationsEnabledInApp)
|
||||
if (!animationsEnabledInOS || !animationsEnabledInApp || eitherChildZoomed)
|
||||
{
|
||||
pane->_CloseChild(closeFirst);
|
||||
co_return;
|
||||
|
||||
@@ -469,4 +469,7 @@
|
||||
<data name="CouldNotOpenUriDialog.PrimaryButtonText" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="SettingsTab" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
206
src/cascadia/TerminalApp/SettingsTab.cpp
Normal file
206
src/cascadia/TerminalApp/SettingsTab.cpp
Normal file
@@ -0,0 +1,206 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
#include "SettingsTab.h"
|
||||
#include "SettingsTab.g.cpp"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalControl;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Windows::System;
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
namespace MUX = Microsoft::UI::Xaml;
|
||||
namespace WUX = Windows::UI::Xaml;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
SettingsTab::SettingsTab(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings)
|
||||
{
|
||||
Content(winrt::Microsoft::Terminal::Settings::Editor::MainPage(settings));
|
||||
|
||||
_MakeTabViewItem();
|
||||
_CreateContextMenu();
|
||||
_CreateIcon();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Initializes a TabViewItem for this Tab instance.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_MakeTabViewItem()
|
||||
{
|
||||
TabViewItem(::winrt::MUX::Controls::TabViewItem{});
|
||||
Title(RS_(L"SettingsTab"));
|
||||
TabViewItem().Header(winrt::box_value(Title()));
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Focus the settings UI
|
||||
// Arguments:
|
||||
// - focusState: The FocusState mode by which focus is to be obtained.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::Focus(WUX::FocusState focusState)
|
||||
{
|
||||
_focusState = focusState;
|
||||
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
{
|
||||
Content().Focus(focusState);
|
||||
}
|
||||
}
|
||||
|
||||
WUX::FocusState SettingsTab::FocusState() const noexcept
|
||||
{
|
||||
return _focusState;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Set the icon on the TabViewItem for this tab.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget SettingsTab::_CreateIcon()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
auto fontFamily = winrt::WUX::Media::FontFamily(L"Segoe MDL2 Assets");
|
||||
auto glyph = L"\xE713"; // This is the Setting icon (looks like a gear)
|
||||
|
||||
// The TabViewItem Icon needs MUX while the IconSourceElement in the CommandPalette needs WUX...
|
||||
Icon(glyph);
|
||||
TabViewItem().IconSource(IconPathConverter::IconSourceMUX(glyph));
|
||||
|
||||
// Update SwitchToTab command's icon
|
||||
SwitchToTabCommand().Icon(glyph);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Prepares this tab for being removed from the UI hierarchy
|
||||
void SettingsTab::Shutdown()
|
||||
{
|
||||
// TODO: Does/Will the settings UI need some shutdown procedures?
|
||||
Content(nullptr);
|
||||
_ClosedHandlers(nullptr, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a context menu attached to the tab.
|
||||
// Currently contains elements allowing the user to close the selected tab
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_CreateContextMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
// Close
|
||||
Controls::MenuFlyoutItem closeTabMenuItem;
|
||||
Controls::FontIcon closeSymbol;
|
||||
closeSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
closeSymbol.Glyph(L"\xE8BB");
|
||||
|
||||
closeTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_ClosedHandlers(nullptr, nullptr);
|
||||
}
|
||||
});
|
||||
closeTabMenuItem.Text(RS_(L"TabClose"));
|
||||
closeTabMenuItem.Icon(closeSymbol);
|
||||
|
||||
// Build the menu
|
||||
Controls::MenuFlyout newTabFlyout;
|
||||
newTabFlyout.Items().Append(_CreateCloseSubMenu());
|
||||
newTabFlyout.Items().Append(closeTabMenuItem);
|
||||
TabViewItem().ContextFlyout(newTabFlyout);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a sub-menu containing menu items to close multiple tabs
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the created MenuFlyoutSubItem
|
||||
Controls::MenuFlyoutSubItem SettingsTab::_CreateCloseSubMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
// Close tabs after
|
||||
_closeTabsAfterMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_CloseTabsAfter();
|
||||
}
|
||||
});
|
||||
_closeTabsAfterMenuItem.Text(RS_(L"TabCloseAfter"));
|
||||
|
||||
// Close other tabs
|
||||
_closeOtherTabsMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_CloseOtherTabs();
|
||||
}
|
||||
});
|
||||
_closeOtherTabsMenuItem.Text(RS_(L"TabCloseOther"));
|
||||
|
||||
Controls::MenuFlyoutSubItem closeSubMenu;
|
||||
closeSubMenu.Text(RS_(L"TabCloseSubMenu"));
|
||||
closeSubMenu.Items().Append(_closeTabsAfterMenuItem);
|
||||
closeSubMenu.Items().Append(_closeOtherTabsMenuItem);
|
||||
|
||||
return closeSubMenu;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Enable the Close menu items based on tab index and total number of tabs
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_EnableCloseMenuItems()
|
||||
{
|
||||
// close other tabs is enabled only if there are other tabs
|
||||
_closeOtherTabsMenuItem.IsEnabled(TabViewNumTabs() > 1);
|
||||
// close tabs after is enabled only if there are other tabs on the right
|
||||
_closeTabsAfterMenuItem.IsEnabled(TabViewIndex() < TabViewNumTabs() - 1);
|
||||
}
|
||||
|
||||
void SettingsTab::_CloseTabsAfter()
|
||||
{
|
||||
CloseTabsAfterArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeTabsAfter{ ShortcutAction::CloseTabsAfter, args };
|
||||
|
||||
_dispatch.DoAction(closeTabsAfter);
|
||||
}
|
||||
|
||||
void SettingsTab::_CloseOtherTabs()
|
||||
{
|
||||
CloseOtherTabsArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeOtherTabs{ ShortcutAction::CloseOtherTabs, args };
|
||||
|
||||
_dispatch.DoAction(closeOtherTabs);
|
||||
}
|
||||
|
||||
void SettingsTab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
}
|
||||
65
src/cascadia/TerminalApp/SettingsTab.h
Normal file
65
src/cascadia/TerminalApp/SettingsTab.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- SettingsTab.h
|
||||
|
||||
Abstract:
|
||||
- The SettingsTab is a tab whose content is a Settings UI control. They can
|
||||
coexist in a TabView with all other types of tabs, like the TerminalTab.
|
||||
There should only be at most one SettingsTab open at any given time.
|
||||
|
||||
Author(s):
|
||||
- Leon Liang - October 2020
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include "SettingsTab.g.h"
|
||||
#include <winrt/TerminalApp.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Editor.h>
|
||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct SettingsTab : SettingsTabT<SettingsTab>
|
||||
{
|
||||
public:
|
||||
SettingsTab(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
|
||||
void Focus(winrt::Windows::UI::Xaml::FocusState focusState);
|
||||
winrt::Windows::UI::Xaml::FocusState FocusState() const noexcept;
|
||||
|
||||
void Shutdown();
|
||||
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
|
||||
GETSET_PROPERTY(winrt::hstring, Title);
|
||||
GETSET_PROPERTY(winrt::hstring, Icon);
|
||||
GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::Command, SwitchToTabCommand, nullptr);
|
||||
GETSET_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Xaml::Controls::Page, Content, nullptr);
|
||||
|
||||
// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
|
||||
// This is needed since Tab is going to be managing its own SwitchToTab command.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewIndex, _PropertyChangedHandlers, 0);
|
||||
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewNumTabs, _PropertyChangedHandlers, 0);
|
||||
|
||||
private:
|
||||
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
|
||||
|
||||
void _MakeTabViewItem();
|
||||
void _CreateContextMenu();
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutSubItem _CreateCloseSubMenu();
|
||||
void _EnableCloseMenuItems();
|
||||
winrt::fire_and_forget _CreateIcon();
|
||||
void _CloseTabsAfter();
|
||||
void _CloseOtherTabs();
|
||||
};
|
||||
}
|
||||
11
src/cascadia/TerminalApp/SettingsTab.idl
Normal file
11
src/cascadia/TerminalApp/SettingsTab.idl
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "ITab.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
[default_interface] runtimeclass SettingsTab : ITab
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,8 @@ namespace TerminalApp
|
||||
Microsoft.Terminal.Settings.Model.Command SwitchToTabCommand { get; };
|
||||
UInt32 TabViewIndex { get; };
|
||||
|
||||
Windows.UI.Xaml.FrameworkElement Content { get; };
|
||||
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,12 @@
|
||||
<ClInclude Include="MinMaxCloseControl.h">
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SettingsTab.h">
|
||||
<DependentUpon>SettingsTab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TerminalTab.h">
|
||||
<DependentUpon>TerminalTab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TerminalPage.h">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -101,9 +107,6 @@
|
||||
<ClInclude Include="IconPathConverter.h">
|
||||
<DependentUpon>IconPathConverter.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Tab.h">
|
||||
<DependentUpon>Tab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Pane.h" />
|
||||
<ClInclude Include="ColorHelper.h" />
|
||||
<ClInclude Include="TerminalSettings.h">
|
||||
@@ -133,6 +136,12 @@
|
||||
<ClCompile Include="MinMaxCloseControl.cpp">
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SettingsTab.cpp">
|
||||
<DependentUpon>SettingsTab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalTab.cpp">
|
||||
<DependentUpon>TerminalTab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalPage.cpp">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -158,9 +167,6 @@
|
||||
<ClCompile Include="IconPathConverter.cpp">
|
||||
<DependentUpon>IconPathConverter.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Tab.cpp">
|
||||
<DependentUpon>Tab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Pane.cpp" />
|
||||
<ClCompile Include="Pane.LayoutSizeNode.cpp" />
|
||||
<ClCompile Include="ColorHelper.cpp" />
|
||||
@@ -196,6 +202,7 @@
|
||||
<Midl Include="App.idl">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="SettingsTab.idl" />
|
||||
<Midl Include="ShortcutActionDispatch.idl" />
|
||||
<Midl Include="AppKeyBindings.idl" />
|
||||
<Midl Include="AppLogic.idl" />
|
||||
@@ -203,6 +210,8 @@
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="ITab.idl" />
|
||||
<Midl Include="TerminalTab.idl" />
|
||||
<Midl Include="TerminalPage.idl">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -226,7 +235,6 @@
|
||||
<Midl Include="EmptyStringVisibilityConverter.idl" />
|
||||
<Midl Include="HasNestedCommandsVisibilityConverter.idl" />
|
||||
<Midl Include="IconPathConverter.idl" />
|
||||
<Midl Include="Tab.idl" />
|
||||
<Midl Include="TerminalSettings.idl" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
@@ -279,6 +287,12 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Editor">
|
||||
<HintPath>$(_BinRoot)Microsoft.Terminal.Settings.Editor\Microsoft.Terminal.Settings.Editor.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Model">
|
||||
<HintPath>$(_BinRoot)Microsoft.Terminal.Settings.Model\Microsoft.Terminal.Settings.Model.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
<ClCompile Include="TerminalSettings.cpp">
|
||||
<Filter>settings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Jumplist.cpp" />
|
||||
<ClCompile Include="Tab.cpp">
|
||||
<Filter>tab</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SettingsTab.cpp">
|
||||
<Filter>tab</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Utils.h" />
|
||||
@@ -48,6 +55,13 @@
|
||||
<ClInclude Include="TerminalSettings.h">
|
||||
<Filter>settings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Jumplist.h" />
|
||||
<ClInclude Include="Tab.h">
|
||||
<Filter>tab</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SettingsTab.h">
|
||||
<Filter>tab</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="AppLogic.idl">
|
||||
@@ -62,14 +76,19 @@
|
||||
<Midl Include="ShortcutActionDispatch.idl">
|
||||
<Filter>settings</Filter>
|
||||
</Midl>
|
||||
<Midl Include="Tab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="IDirectKeyListener.idl" />
|
||||
<Midl Include="CommandKeyChordVisibilityConverter.idl" />
|
||||
<Midl Include="TerminalSettings.idl">
|
||||
<Filter>settings</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ITab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="SettingsTab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="TerminalTab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
@@ -119,4 +138,4 @@
|
||||
<Filter>app</Filter>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "TabRowControl.h"
|
||||
#include "ColorHelper.h"
|
||||
#include "DebugTapConnection.h"
|
||||
#include "SettingsTab.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
@@ -42,7 +43,8 @@ namespace winrt
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
TerminalPage::TerminalPage() :
|
||||
_tabs{ winrt::single_threaded_observable_vector<TerminalApp::Tab>() },
|
||||
_tabs{ winrt::single_threaded_observable_vector<TerminalApp::ITab>() },
|
||||
_mruTabActions{ winrt::single_threaded_vector<Command>() },
|
||||
_startupActions{ winrt::single_threaded_vector<ActionAndArgs>() }
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -223,13 +225,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
|
||||
_tabs.VectorChanged([weakThis{ get_weak() }](auto&& s, auto&& e) {
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
page->CommandPalette().OnTabsChanged(s, e);
|
||||
}
|
||||
});
|
||||
|
||||
// Settings AllowDependentAnimations will affect whether animations are
|
||||
// enabled application-wide, so we don't need to check it each time we
|
||||
// want to create an animation.
|
||||
@@ -668,9 +663,12 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
TermControl term{ settings, connection };
|
||||
|
||||
auto newTabImpl = winrt::make_self<TerminalTab>(profileGuid, term);
|
||||
_MakeSwitchToTabCommand(*newTabImpl, _tabs.Size());
|
||||
|
||||
// Add the new tab to the list of our tabs.
|
||||
auto newTabImpl = winrt::make_self<Tab>(profileGuid, term);
|
||||
_tabs.Append(*newTabImpl);
|
||||
_mruTabActions.Append(newTabImpl->SwitchToTabCommand());
|
||||
|
||||
newTabImpl->SetDispatch(*_actionDispatch);
|
||||
|
||||
@@ -685,7 +683,8 @@ namespace winrt::TerminalApp::implementation
|
||||
auto weakTab = make_weak(newTabImpl);
|
||||
|
||||
// When the tab's active pane changes, we'll want to lookup a new icon
|
||||
// for it, and possibly propagate the title up to the window.
|
||||
// for it. The Title change will be propagated upwards through the tab's
|
||||
// PropertyChanged event handler.
|
||||
newTabImpl->ActivePaneChanged([weakTab, weakThis{ get_weak() }]() {
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
@@ -694,24 +693,12 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Possibly update the icon of the tab.
|
||||
page->_UpdateTabIcon(*tab);
|
||||
// Possibly update the title of the tab, window to match the newly
|
||||
// focused pane.
|
||||
page->_UpdateTitle(*tab);
|
||||
}
|
||||
});
|
||||
|
||||
auto tabViewItem = newTabImpl->GetTabViewItem();
|
||||
auto tabViewItem = newTabImpl->TabViewItem();
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
// GH#6570
|
||||
// The TabView does not apply compact sizing to items added after Compact is enabled.
|
||||
// By forcibly reapplying compact sizing every time we add a new tab, we'll make sure
|
||||
// that it works.
|
||||
// Workaround from https://github.com/microsoft/microsoft-ui-xaml/issues/2711
|
||||
if (_tabView.TabWidthMode() == MUX::Controls::TabViewWidthMode::Compact)
|
||||
{
|
||||
_tabView.UpdateLayout();
|
||||
_tabView.TabWidthMode(MUX::Controls::TabViewWidthMode::Compact);
|
||||
}
|
||||
_ReapplyCompactTabSize();
|
||||
|
||||
// Set this tab's icon to the icon from the user's profile
|
||||
const auto profile = _settings.FindProfile(profileGuid);
|
||||
@@ -928,12 +915,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// TitleChanged event.
|
||||
// Arguments:
|
||||
// - tab: the Tab to update the title for.
|
||||
void TerminalPage::_UpdateTitle(const Tab& tab)
|
||||
void TerminalPage::_UpdateTitle(const TerminalTab& tab)
|
||||
{
|
||||
auto newTabTitle = tab.GetActiveTitle();
|
||||
auto newTabTitle = tab.Title();
|
||||
|
||||
if (_settings.GlobalSettings().ShowTitleInTitlebar() &&
|
||||
tab.IsFocused())
|
||||
tab.FocusState() != FocusState::Unfocused)
|
||||
{
|
||||
_titleChangeHandlers(*this, newTabTitle);
|
||||
}
|
||||
@@ -944,7 +931,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// tab's icon to that icon.
|
||||
// Arguments:
|
||||
// - tab: the Tab to update the title for.
|
||||
void TerminalPage::_UpdateTabIcon(Tab& tab)
|
||||
void TerminalPage::_UpdateTabIcon(TerminalTab& tab)
|
||||
{
|
||||
const auto lastFocusedProfileOpt = tab.GetFocusedProfile();
|
||||
if (lastFocusedProfileOpt.has_value())
|
||||
@@ -995,30 +982,32 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
try
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
auto focusedTab = _GetStrongTabImpl(*index);
|
||||
// TODO: GH#5047 - In the future, we should get the Profile of
|
||||
// the focused pane, and use that to build a new instance of the
|
||||
// settings so we can duplicate this tab/pane.
|
||||
//
|
||||
// Currently, if the profile doesn't exist anymore in our
|
||||
// settings, we'll silently do nothing.
|
||||
//
|
||||
// In the future, it will be preferable to just duplicate the
|
||||
// current control's settings, but we can't do that currently,
|
||||
// because we won't be able to create a new instance of the
|
||||
// connection without keeping an instance of the original Profile
|
||||
// object around.
|
||||
|
||||
const auto& profileGuid = focusedTab->GetFocusedProfile();
|
||||
if (profileGuid.has_value())
|
||||
try
|
||||
{
|
||||
const auto settings{ winrt::make<TerminalSettings>(_settings, profileGuid.value(), *_bindings) };
|
||||
_CreateNewTabFromSettings(profileGuid.value(), settings);
|
||||
// TODO: GH#5047 - In the future, we should get the Profile of
|
||||
// the focused pane, and use that to build a new instance of the
|
||||
// settings so we can duplicate this tab/pane.
|
||||
//
|
||||
// Currently, if the profile doesn't exist anymore in our
|
||||
// settings, we'll silently do nothing.
|
||||
//
|
||||
// In the future, it will be preferable to just duplicate the
|
||||
// current control's settings, but we can't do that currently,
|
||||
// because we won't be able to create a new instance of the
|
||||
// connection without keeping an instance of the original Profile
|
||||
// object around.
|
||||
|
||||
const auto& profileGuid = terminalTab->GetFocusedProfile();
|
||||
if (profileGuid.has_value())
|
||||
{
|
||||
const auto settings{ winrt::make<TerminalSettings>(_settings, profileGuid.value(), *_bindings) };
|
||||
_CreateNewTabFromSettings(profileGuid.value(), settings);
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1045,8 +1034,15 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Removing the tab from the collection should destroy its control and disconnect its connection,
|
||||
// but it doesn't always do so. The UI tree may still be holding the control and preventing its destruction.
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
tab->Shutdown();
|
||||
auto tab{ _tabs.GetAt(tabIndex) };
|
||||
tab.Shutdown();
|
||||
|
||||
uint32_t mruIndex;
|
||||
if (_mruTabActions.IndexOf(_tabs.GetAt(tabIndex).SwitchToTabCommand(), mruIndex))
|
||||
{
|
||||
_mruTabActions.RemoveAt(mruIndex);
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
}
|
||||
|
||||
_tabs.RemoveAt(tabIndex);
|
||||
_tabView.TabItems().RemoveAt(tabIndex);
|
||||
@@ -1089,8 +1085,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// here. If we don't, then the TabView will technically not have a
|
||||
// selected item at all, which can make things like ClosePane not
|
||||
// work correctly.
|
||||
auto newSelectedTab{ _GetStrongTabImpl(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab->GetTabViewItem());
|
||||
auto newSelectedTab{ _tabs.GetAt(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab.TabViewItem());
|
||||
}
|
||||
|
||||
// GH#5559 - If we were in the middle of a drag/drop, end it by clearing
|
||||
@@ -1112,7 +1108,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Arguments:
|
||||
// - term: The newly created TermControl to connect the events for
|
||||
// - hostingTab: The Tab that's hosting this TermControl instance
|
||||
void TerminalPage::_RegisterTerminalEvents(TermControl term, Tab& hostingTab)
|
||||
void TerminalPage::_RegisterTerminalEvents(TermControl term, TerminalTab& hostingTab)
|
||||
{
|
||||
// Add an event handler when the terminal's selection wants to be copied.
|
||||
// When the text buffer data is retrieved, we'll copy the data into the Clipboard
|
||||
@@ -1140,6 +1136,16 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
page->_UpdateTitle(*tab);
|
||||
}
|
||||
else if (args.PropertyName() == L"Content")
|
||||
{
|
||||
if (*tab == page->_GetFocusedTab())
|
||||
{
|
||||
page->_tabContent.Children().Clear();
|
||||
page->_tabContent.Children().Append(tab->Content());
|
||||
|
||||
tab->Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1148,7 +1154,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && tab->IsFocused())
|
||||
if (page && tab && (tab->FocusState() != FocusState::Unfocused))
|
||||
{
|
||||
page->_SetNonClientAreaColors(color);
|
||||
}
|
||||
@@ -1158,7 +1164,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && tab->IsFocused())
|
||||
if (page && tab && (tab->FocusState() != FocusState::Unfocused))
|
||||
{
|
||||
page->_ClearNonClientAreaColors();
|
||||
}
|
||||
@@ -1176,28 +1182,33 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Sets focus to the tab to the right or left the currently selected tab.
|
||||
void TerminalPage::_SelectNextTab(const bool bMoveRight)
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
if (_settings.GlobalSettings().UseTabSwitcher())
|
||||
{
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
|
||||
// Since ATS is always MRU, our focused tab index is always 0.
|
||||
// So, going next should go to index 1, and going prev should wrap to the end.
|
||||
uint32_t tabCount = _mruTabActions.Size();
|
||||
auto newTabIndex = ((tabCount + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
|
||||
if (CommandPalette().Visibility() == Visibility::Visible)
|
||||
{
|
||||
CommandPalette().SelectNextItem(bMoveRight);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommandPalette().EnableTabSwitcherMode(false, newTabIndex);
|
||||
CommandPalette().Visibility(Visibility::Visible);
|
||||
}
|
||||
}
|
||||
else if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
uint32_t tabCount = _tabs.Size();
|
||||
// Wraparound math. By adding tabCount and then calculating modulo tabCount,
|
||||
// we clamp the values to the range [0, tabCount) while still supporting moving
|
||||
// leftward from 0 to tabCount - 1.
|
||||
const auto newTabIndex = ((tabCount + *index + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
|
||||
if (_settings.GlobalSettings().UseTabSwitcher())
|
||||
{
|
||||
if (CommandPalette().Visibility() == Visibility::Visible)
|
||||
{
|
||||
CommandPalette().SelectNextItem(bMoveRight);
|
||||
}
|
||||
|
||||
CommandPalette().EnableTabSwitcherMode(false, newTabIndex);
|
||||
CommandPalette().Visibility(Visibility::Visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
_SelectTab(newTabIndex);
|
||||
}
|
||||
auto newTabIndex = ((tabCount + *index + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
_SelectTab(newTabIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1217,8 +1228,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (_startupState == StartupState::InStartup)
|
||||
{
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
auto tab{ _tabs.GetAt(tabIndex) };
|
||||
_tabView.SelectedItem(tab.TabViewItem());
|
||||
_UpdatedSelectedTab(tabIndex);
|
||||
}
|
||||
else
|
||||
@@ -1246,15 +1257,21 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
void TerminalPage::_UnZoomIfNeeded()
|
||||
{
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab && activeTab->IsZoomed())
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
{
|
||||
// Remove the content from the tab first, so Pane::UnZoom can
|
||||
// re-attach the content to the tree w/in the pane
|
||||
_tabContent.Children().Clear();
|
||||
activeTab->ExitZoom();
|
||||
// Re-attach the tab's content to the UI tree.
|
||||
_tabContent.Children().Append(activeTab->GetRootElement());
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
if (activeTab->IsZoomed())
|
||||
{
|
||||
// Remove the content from the tab first, so Pane::UnZoom can
|
||||
// re-attach the content to the tree w/in the pane
|
||||
_tabContent.Children().Clear();
|
||||
// In ExitZoom, we'll change the Tab's Content(), triggering the
|
||||
// content changed event, which will re-attach the tab's new content
|
||||
// root to the tree.
|
||||
activeTab->ExitZoom();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1270,9 +1287,11 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->NavigateFocus(direction);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->NavigateFocus(direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1280,13 +1299,12 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
return focusedTab->GetActiveTerminalControl();
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
return terminalTab->GetActiveTerminalControl();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1309,11 +1327,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// Method Description:
|
||||
// - returns a com_ptr to the currently focused tab. This might return null,
|
||||
// so make sure to check the result!
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetFocusedTab()
|
||||
ITab TerminalPage::_GetFocusedTab()
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
return _GetStrongTabImpl(*index);
|
||||
return _tabs.GetAt(*index);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1338,8 +1356,8 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
auto tabToFocus = page->_tabs.GetAt(tabIndex);
|
||||
_tabView.SelectedItem(tabToFocus.TabViewItem());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1361,9 +1379,11 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->ClosePane();
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->ClosePane();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1403,8 +1423,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
focusedTab->Scroll(delta);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
terminalTab->Scroll(delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1437,9 +1459,16 @@ namespace winrt::TerminalApp::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
auto focusedTab = _GetTerminalTabImpl(_tabs.GetAt(*indexOpt));
|
||||
|
||||
// Do nothing if the focused tab isn't a TerminalTab
|
||||
if (!focusedTab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
auto focusedTab = _GetStrongTabImpl(*indexOpt);
|
||||
TerminalApp::TerminalSettings controlSettings;
|
||||
GUID realGuid;
|
||||
bool profileFound = false;
|
||||
@@ -1513,9 +1542,11 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->ResizePane(direction);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->ResizePane(direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1536,11 +1567,13 @@ namespace winrt::TerminalApp::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
delta = std::clamp(delta, -1, 1);
|
||||
const auto control = _GetActiveControl();
|
||||
const auto termHeight = control.GetViewHeight();
|
||||
auto focusedTab{ _GetStrongTabImpl(*indexOpt) };
|
||||
focusedTab->Scroll(termHeight * delta);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*indexOpt)))
|
||||
{
|
||||
delta = std::clamp(delta, -1, 1);
|
||||
const auto control = _GetActiveControl();
|
||||
const auto termHeight = control.GetViewHeight();
|
||||
terminalTab->Scroll(termHeight * delta);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1651,8 +1684,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
return focusedTab->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
return terminalTab->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dimension;
|
||||
@@ -1850,32 +1885,39 @@ namespace winrt::TerminalApp::implementation
|
||||
// a background thread, as to not hang/crash the UI thread.
|
||||
fire_and_forget TerminalPage::_LaunchSettings(const SettingsTarget target)
|
||||
{
|
||||
// This will switch the execution of the function to a background (not
|
||||
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
|
||||
// (used for retrieving the path to the file) will crash on the UI
|
||||
// thread, because the main thread is a STA.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
auto openFile = [](const auto& filePath) {
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, filePath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", filePath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
};
|
||||
|
||||
switch (target)
|
||||
if (target == SettingsTarget::SettingsUI)
|
||||
{
|
||||
case SettingsTarget::DefaultsFile:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
break;
|
||||
case SettingsTarget::SettingsFile:
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
case SettingsTarget::AllFiles:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
_OpenSettingsUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This will switch the execution of the function to a background (not
|
||||
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
|
||||
// (used for retrieving the path to the file) will crash on the UI
|
||||
// thread, because the main thread is a STA.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
auto openFile = [](const auto& filePath) {
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, filePath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", filePath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
};
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case SettingsTarget::DefaultsFile:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
break;
|
||||
case SettingsTarget::SettingsFile:
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
case SettingsTarget::AllFiles:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1903,10 +1945,6 @@ namespace winrt::TerminalApp::implementation
|
||||
_rearrangeTo = eventArgs.Index();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_UpdateCommandsForPalette();
|
||||
}
|
||||
|
||||
_UpdateTabView();
|
||||
}
|
||||
@@ -1934,18 +1972,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// Unfocus all the tabs.
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->SetFocused(false);
|
||||
tab.Focus(FocusState::Unfocused);
|
||||
}
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto tab{ _GetStrongTabImpl(index) };
|
||||
auto tab{ _tabs.GetAt(index) };
|
||||
|
||||
_tabContent.Children().Clear();
|
||||
_tabContent.Children().Append(tab->GetRootElement());
|
||||
_tabContent.Children().Append(tab.Content());
|
||||
|
||||
// GH#7409: If the tab switcher is open, then we _don't_ want to
|
||||
// automatically focus the new tab here. The tab switcher wants
|
||||
@@ -1959,11 +1996,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// need to worry about focus getting lost.
|
||||
if (CommandPalette().Visibility() != Visibility::Visible)
|
||||
{
|
||||
tab->SetFocused(true);
|
||||
tab.Focus(FocusState::Programmatic);
|
||||
_UpdateMRUTab(index);
|
||||
}
|
||||
|
||||
// Raise an event that our title changed
|
||||
_titleChangeHandlers(*this, tab->GetActiveTitle());
|
||||
_titleChangeHandlers(*this, tab.Title());
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -1998,8 +2036,10 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto newSize = e.NewSize();
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->ResizeContent(newSize);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
terminalTab->ResizeContent(newSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2056,9 +2096,10 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
// Attempt to reload the settings of any panes with this profile
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->UpdateSettings(settings, profileGuid);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
terminalTab->UpdateSettings(settings, profileGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
@@ -2070,11 +2111,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// anymore, so we can't possibly update its settings.
|
||||
|
||||
// Update the icon of the tab for the currently focused profile in that tab.
|
||||
// Only do this for TerminalTabs. Other types of tabs won't have multiple panes
|
||||
// and profiles so the Title and Icon will be set once and only once on init.
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
_UpdateTabIcon(*tabImpl);
|
||||
_UpdateTitle(*tabImpl);
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
_UpdateTabIcon(*terminalTab);
|
||||
|
||||
// Force the TerminalTab to re-grab its currently active control's title.
|
||||
terminalTab->UpdateTitle();
|
||||
}
|
||||
}
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
@@ -2267,32 +2314,6 @@ namespace winrt::TerminalApp::implementation
|
||||
_alwaysOnTopChangedHandlers(*this, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the tab at the given index
|
||||
// Arguments:
|
||||
// - index: an unsigned integer index to a tab in _tabs
|
||||
// Return Value:
|
||||
// - a com_ptr to the implementation type of the Tab
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetStrongTabImpl(const uint32_t index) const
|
||||
{
|
||||
winrt::com_ptr<Tab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<Tab>(_tabs.GetAt(index)));
|
||||
return tabImpl;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the given projected Tab
|
||||
// Arguments:
|
||||
// - tab: the projected type of a Tab
|
||||
// Return Value:
|
||||
// - a com_ptr to the implementation type of the Tab
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetStrongTabImpl(const ::winrt::TerminalApp::Tab& tab) const
|
||||
{
|
||||
winrt::com_ptr<Tab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<Tab>(tab));
|
||||
return tabImpl;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the tab split button color when a new tab color is selected
|
||||
// Arguments:
|
||||
@@ -2494,7 +2515,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return focus to the active control
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
_GetStrongTabImpl(index.value())->SetFocused(true);
|
||||
_tabs.GetAt(*index).Focus(FocusState::Programmatic);
|
||||
_UpdateMRUTab(index.value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2532,7 +2554,143 @@ namespace winrt::TerminalApp::implementation
|
||||
const uint32_t size = _tabs.Size();
|
||||
for (uint32_t i = 0; i < size; ++i)
|
||||
{
|
||||
_GetStrongTabImpl(i)->UpdateTabViewIndex(i, size);
|
||||
auto command = _tabs.GetAt(i).SwitchToTabCommand();
|
||||
command.Action().Args().as<SwitchToTabArgs>().TabIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a settings UI tab and focuses it. If there's already a settings UI tab open,
|
||||
// just focus the existing one.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_OpenSettingsUI()
|
||||
{
|
||||
// If we're holding the settings tab's switch command, don't create a new one, switch to the existing one.
|
||||
if (!_switchToSettingsCommand)
|
||||
{
|
||||
auto newTabImpl = winrt::make_self<SettingsTab>(_settings);
|
||||
_MakeSwitchToTabCommand(*newTabImpl, _tabs.Size());
|
||||
|
||||
// Add the new tab to the list of our tabs.
|
||||
_tabs.Append(*newTabImpl);
|
||||
_mruTabActions.Append(newTabImpl->SwitchToTabCommand());
|
||||
|
||||
// Don't capture a strong ref to the tab. If the tab is removed as this
|
||||
// is called, we don't really care anymore about handling the event.
|
||||
auto weakTab = make_weak(newTabImpl);
|
||||
|
||||
auto tabViewItem = newTabImpl->TabViewItem();
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
|
||||
_ReapplyCompactTabSize();
|
||||
|
||||
tabViewItem.PointerPressed({ this, &TerminalPage::_OnTabClick });
|
||||
|
||||
// When the tab is closed, remove it from our list of tabs.
|
||||
newTabImpl->Closed([tabViewItem, weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
page->_switchToSettingsCommand = nullptr;
|
||||
page->_RemoveOnCloseRoutine(tabViewItem, page);
|
||||
}
|
||||
});
|
||||
|
||||
_switchToSettingsCommand = newTabImpl->SwitchToTabCommand();
|
||||
|
||||
// This kicks off TabView::SelectionChanged, in response to which
|
||||
// we'll attach the terminal's Xaml control to the Xaml root.
|
||||
_tabView.SelectedItem(tabViewItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
_actionDispatch->DoAction(_switchToSettingsCommand.Action());
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the given tab if it's a TerminalTab.
|
||||
// If the tab is not a TerminalTab, returns nullptr.
|
||||
// Arguments:
|
||||
// - tab: the projected type of a Tab
|
||||
// Return Value:
|
||||
// - If the tab is a TerminalTab, a com_ptr to the implementation type.
|
||||
// If the tab is not a TerminalTab, nullptr
|
||||
winrt::com_ptr<TerminalTab> TerminalPage::_GetTerminalTabImpl(const ITab& tab) const
|
||||
{
|
||||
if (auto terminalTab = tab.try_as<TerminalApp::TerminalTab>())
|
||||
{
|
||||
winrt::com_ptr<TerminalTab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<TerminalTab>(terminalTab));
|
||||
return tabImpl;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - The TabView does not apply compact sizing to items added after Compact is enabled.
|
||||
// By forcibly reapplying compact sizing every time we add a new tab, we'll make sure
|
||||
// that it works.
|
||||
// Workaround from https://github.com/microsoft/microsoft-ui-xaml/issues/2711
|
||||
// TODO: Remove this function and its calls when ingesting the above changes.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_ReapplyCompactTabSize()
|
||||
{
|
||||
if (_tabView.TabWidthMode() == MUX::Controls::TabViewWidthMode::Compact)
|
||||
{
|
||||
_tabView.UpdateLayout();
|
||||
_tabView.TabWidthMode(MUX::Controls::TabViewWidthMode::Compact);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Initializes a SwitchToTab command object for this Tab instance.
|
||||
// This should be done before the tab is added to the _tabs vector so that
|
||||
// controls like the CmdPal that observe the vector changes can always expect
|
||||
// a SwitchToTab command to be available.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_MakeSwitchToTabCommand(const ITab& tab, const uint32_t index)
|
||||
{
|
||||
SwitchToTabArgs args{ index };
|
||||
ActionAndArgs focusTabAction{ ShortcutAction::SwitchToTab, args };
|
||||
|
||||
Command command;
|
||||
command.Action(focusTabAction);
|
||||
command.Name(tab.Title());
|
||||
command.Icon(tab.Icon());
|
||||
|
||||
tab.SwitchToTabCommand(command);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Bumps the tab in its in-order index up to the top of the mru list.
|
||||
// Arguments:
|
||||
// - index: the in-order index of the tab to bump.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_UpdateMRUTab(const uint32_t index)
|
||||
{
|
||||
uint32_t mruIndex;
|
||||
auto command = _tabs.GetAt(index).SwitchToTabCommand();
|
||||
if (_mruTabActions.IndexOf(command, mruIndex))
|
||||
{
|
||||
if (mruIndex > 0)
|
||||
{
|
||||
_mruTabActions.RemoveAt(mruIndex);
|
||||
_mruTabActions.InsertAt(0, command);
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "TerminalPage.g.h"
|
||||
#include "Tab.h"
|
||||
#include "TerminalTab.h"
|
||||
#include "AppKeyBindings.h"
|
||||
#include "TerminalSettings.h"
|
||||
|
||||
@@ -88,11 +88,14 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<TerminalApp::Tab> _tabs;
|
||||
winrt::com_ptr<Tab> _GetStrongTabImpl(const uint32_t index) const;
|
||||
winrt::com_ptr<Tab> _GetStrongTabImpl(const ::winrt::TerminalApp::Tab& tab) const;
|
||||
Windows::Foundation::Collections::IObservableVector<TerminalApp::ITab> _tabs;
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::Settings::Model::Command> _mruTabActions;
|
||||
winrt::com_ptr<TerminalTab> _GetTerminalTabImpl(const ITab& tab) const;
|
||||
|
||||
void _UpdateTabIndices();
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::Model::Command _switchToSettingsCommand{ nullptr };
|
||||
|
||||
bool _isInFocusMode{ false };
|
||||
bool _isFullscreen{ false };
|
||||
bool _isAlwaysOnTop{ false };
|
||||
@@ -133,8 +136,8 @@ namespace winrt::TerminalApp::implementation
|
||||
void _HookupKeyBindings(const Microsoft::Terminal::Settings::Model::KeyMapping& keymap) noexcept;
|
||||
void _RegisterActionCallbacks();
|
||||
|
||||
void _UpdateTitle(const Tab& tab);
|
||||
void _UpdateTabIcon(Tab& tab);
|
||||
void _UpdateTitle(const TerminalTab& tab);
|
||||
void _UpdateTabIcon(TerminalTab& tab);
|
||||
void _UpdateTabView();
|
||||
void _UpdateTabWidthMode();
|
||||
void _UpdateCommandsForPalette();
|
||||
@@ -146,7 +149,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void _RemoveTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem);
|
||||
void _RemoveTabViewItemByIndex(uint32_t tabIndex);
|
||||
|
||||
void _RegisterTerminalEvents(Microsoft::Terminal::TerminalControl::TermControl term, Tab& hostingTab);
|
||||
void _RegisterTerminalEvents(Microsoft::Terminal::TerminalControl::TermControl term, TerminalTab& hostingTab);
|
||||
|
||||
void _SelectNextTab(const bool bMoveRight);
|
||||
bool _SelectTab(const uint32_t tabIndex);
|
||||
@@ -154,7 +157,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalControl::TermControl _GetActiveControl();
|
||||
std::optional<uint32_t> _GetFocusedTabIndex() const noexcept;
|
||||
winrt::com_ptr<Tab> _GetFocusedTab();
|
||||
ITab _GetFocusedTab();
|
||||
winrt::fire_and_forget _SetFocusedTabIndex(const uint32_t tabIndex);
|
||||
void _CloseFocusedTab();
|
||||
void _CloseFocusedPane();
|
||||
@@ -205,6 +208,14 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _UnZoomIfNeeded();
|
||||
|
||||
void _OpenSettingsUI();
|
||||
|
||||
void _ReapplyCompactTabSize();
|
||||
|
||||
void _MakeSwitchToTabCommand(const ITab& tab, const uint32_t index);
|
||||
void _UpdateTabSwitcherCommands(const bool mru);
|
||||
void _UpdateMRUTab(const uint32_t index);
|
||||
|
||||
#pragma region ActionHandlers
|
||||
// These are all defined in AppActionHandlers.cpp
|
||||
void _HandleOpenNewTabDropdown(const IInspectable& sender, const Microsoft::Terminal::Settings::Model::ActionEventArgs& args);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "Tab.h"
|
||||
#include "Tab.g.cpp"
|
||||
#include "TerminalTab.h"
|
||||
#include "TerminalTab.g.cpp"
|
||||
#include "Utils.h"
|
||||
#include "ColorHelper.h"
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace winrt
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
Tab::Tab(const GUID& profile, const TermControl& control)
|
||||
TerminalTab::TerminalTab(const GUID& profile, const TermControl& control)
|
||||
{
|
||||
_rootPane = std::make_shared<Pane>(profile, control, true);
|
||||
|
||||
@@ -33,9 +33,10 @@ namespace winrt::TerminalApp::implementation
|
||||
});
|
||||
|
||||
_activePane = _rootPane;
|
||||
Content(_rootPane->GetRootElement());
|
||||
|
||||
_MakeTabViewItem();
|
||||
_MakeSwitchToTabCommand();
|
||||
_CreateContextMenu();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -44,11 +45,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_MakeTabViewItem()
|
||||
void TerminalTab::_MakeTabViewItem()
|
||||
{
|
||||
_tabViewItem = ::winrt::MUX::Controls::TabViewItem{};
|
||||
TabViewItem(::winrt::MUX::Controls::TabViewItem{});
|
||||
|
||||
_tabViewItem.DoubleTapped([weakThis = get_weak()](auto&& /*s*/, auto&& /*e*/) {
|
||||
TabViewItem().DoubleTapped([weakThis = get_weak()](auto&& /*s*/, auto&& /*e*/) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_inRename = true;
|
||||
@@ -56,28 +57,10 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
|
||||
_UpdateTitle();
|
||||
UpdateTitle();
|
||||
_RecalculateAndApplyTabColor();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Get the root UIElement of this Tab's root pane.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The UIElement acting as root of the Tab's root pane.
|
||||
UIElement Tab::GetRootElement()
|
||||
{
|
||||
if (_zoomedPane)
|
||||
{
|
||||
return _zoomedPane->GetRootElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
return _rootPane->GetRootElement();
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns nullptr if no children of this tab were the last control to be
|
||||
// focused, or the TermControl that _was_ the last control to be focused (if
|
||||
@@ -89,64 +72,55 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - nullptr if no children were marked `_lastFocused`, else the TermControl
|
||||
// that was last focused.
|
||||
TermControl Tab::GetActiveTerminalControl() const
|
||||
TermControl TerminalTab::GetActiveTerminalControl() const
|
||||
{
|
||||
return _activePane->GetTerminalControl();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Gets the TabViewItem that represents this Tab
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The TabViewItem that represents this Tab
|
||||
winrt::MUX::Controls::TabViewItem Tab::GetTabViewItem()
|
||||
{
|
||||
return _tabViewItem;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called after construction of a Tab object to bind event handlers to its
|
||||
// associated Pane and TermControl object and to create the context menu of
|
||||
// the tab item
|
||||
// associated Pane and TermControl object
|
||||
// Arguments:
|
||||
// - control: reference to the TermControl object to bind event to
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::Initialize(const TermControl& control)
|
||||
void TerminalTab::Initialize(const TermControl& control)
|
||||
{
|
||||
_BindEventHandlers(control);
|
||||
_CreateContextMenu();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns true if this is the currently focused tab. For any set of tabs,
|
||||
// - Returns the focus state of this Tab. Unfocused means this tab is not focused,
|
||||
// and any other FocusState means that this tab is focused. For any set of tabs,
|
||||
// there should only be one tab that is marked as focused, though each tab has
|
||||
// no control over the other tabs in the set.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - true iff this tab is focused.
|
||||
bool Tab::IsFocused() const noexcept
|
||||
// - A FocusState enum value
|
||||
WUX::FocusState TerminalTab::FocusState() const noexcept
|
||||
{
|
||||
return _focused;
|
||||
return _focusState;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Updates our focus state. If we're gaining focus, make sure to transfer
|
||||
// focus to the last focused terminal control in our tree of controls.
|
||||
// Arguments:
|
||||
// - focused: our new focus state. If true, we should be focused. If false, we
|
||||
// should be unfocused.
|
||||
// - focused: our new focus state
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::SetFocused(const bool focused)
|
||||
void TerminalTab::Focus(WUX::FocusState focusState)
|
||||
{
|
||||
_focused = focused;
|
||||
_focusState = focusState;
|
||||
|
||||
if (_focused)
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
{
|
||||
_Focus();
|
||||
auto lastFocusedControl = GetActiveTerminalControl();
|
||||
if (lastFocusedControl)
|
||||
{
|
||||
lastFocusedControl.Focus(_focusState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +133,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - nullopt if no children of this tab were the last control to be
|
||||
// focused, else the GUID of the profile of the last control to be focused
|
||||
std::optional<GUID> Tab::GetFocusedProfile() const noexcept
|
||||
std::optional<GUID> TerminalTab::GetFocusedProfile() const noexcept
|
||||
{
|
||||
return _activePane->GetFocusedProfile();
|
||||
}
|
||||
@@ -171,7 +145,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: reference to the TermControl object to bind event to
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_BindEventHandlers(const TermControl& control) noexcept
|
||||
void TerminalTab::_BindEventHandlers(const TermControl& control) noexcept
|
||||
{
|
||||
_AttachEventHandlersToPane(_rootPane);
|
||||
_AttachEventHandlersToControl(control);
|
||||
@@ -184,35 +158,18 @@ namespace winrt::TerminalApp::implementation
|
||||
// - profile: The GUID of the profile these settings should apply to.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::UpdateSettings(const TerminalSettings& settings, const GUID& profile)
|
||||
void TerminalTab::UpdateSettings(const TerminalSettings& settings, const GUID& profile)
|
||||
{
|
||||
_rootPane->UpdateSettings(settings, profile);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Focus the last focused control in our tree of panes.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_Focus()
|
||||
{
|
||||
_focused = true;
|
||||
|
||||
auto lastFocusedControl = GetActiveTerminalControl();
|
||||
if (lastFocusedControl)
|
||||
{
|
||||
lastFocusedControl.Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Set the icon on the TabViewItem for this tab.
|
||||
// Arguments:
|
||||
// - iconPath: The new path string to use as the IconPath for our TabViewItem
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget Tab::UpdateIcon(const winrt::hstring iconPath)
|
||||
winrt::fire_and_forget TerminalTab::UpdateIcon(const winrt::hstring iconPath)
|
||||
{
|
||||
// Don't reload our icon if it hasn't changed.
|
||||
if (iconPath == _lastIconPath)
|
||||
@@ -224,13 +181,13 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(_tabViewItem.Dispatcher());
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
// The TabViewItem Icon needs MUX while the IconSourceElement in the CommandPalette needs WUX...
|
||||
IconSource(IconPathConverter::IconSourceWUX(_lastIconPath));
|
||||
_tabViewItem.IconSource(IconPathConverter::IconSourceMUX(_lastIconPath));
|
||||
Icon(_lastIconPath);
|
||||
TabViewItem().IconSource(IconPathConverter::IconSourceMUX(_lastIconPath));
|
||||
|
||||
// Update SwitchToTab command's icon
|
||||
SwitchToTabCommand().Icon(_lastIconPath);
|
||||
@@ -244,7 +201,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title string of the last focused terminal control in our tree.
|
||||
winrt::hstring Tab::GetActiveTitle() const
|
||||
winrt::hstring TerminalTab::_GetActiveTitle() const
|
||||
{
|
||||
if (!_runtimeTabText.empty())
|
||||
{
|
||||
@@ -262,14 +219,14 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget Tab::_UpdateTitle()
|
||||
winrt::fire_and_forget TerminalTab::UpdateTitle()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
co_await winrt::resume_foreground(_tabViewItem.Dispatcher());
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
// Bubble our current tab text to anyone who's listening for changes.
|
||||
Title(GetActiveTitle());
|
||||
Title(_GetActiveTitle());
|
||||
|
||||
// Update SwitchToTab command's name
|
||||
SwitchToTabCommand().Name(Title());
|
||||
@@ -287,7 +244,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - delta: a number of lines to move the viewport relative to the current viewport.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget Tab::Scroll(const int delta)
|
||||
winrt::fire_and_forget TerminalTab::Scroll(const int delta)
|
||||
{
|
||||
auto control = GetActiveTerminalControl();
|
||||
|
||||
@@ -303,7 +260,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - splitType: The type of split we want to create.
|
||||
// Return Value:
|
||||
// - True if the focused pane can be split. False otherwise.
|
||||
bool Tab::CanSplitPane(SplitState splitType)
|
||||
bool TerminalTab::CanSplitPane(SplitState splitType)
|
||||
{
|
||||
return _activePane->CanSplit(splitType);
|
||||
}
|
||||
@@ -317,7 +274,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: A TermControl to use in the new pane.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::SplitPane(SplitState splitType, const GUID& profile, TermControl& control)
|
||||
void TerminalTab::SplitPane(SplitState splitType, const GUID& profile, TermControl& control)
|
||||
{
|
||||
auto [first, second] = _activePane->Split(splitType, profile, control);
|
||||
_activePane = first;
|
||||
@@ -337,7 +294,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - See Pane::CalcSnappedDimension
|
||||
float Tab::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
|
||||
float TerminalTab::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
|
||||
{
|
||||
return _rootPane->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
}
|
||||
@@ -349,7 +306,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - newSize: the amount of space that the panes have to fill now.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ResizeContent(const winrt::Windows::Foundation::Size& newSize)
|
||||
void TerminalTab::ResizeContent(const winrt::Windows::Foundation::Size& newSize)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -363,7 +320,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - direction: The direction to move the separator in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ResizePane(const Direction& direction)
|
||||
void TerminalTab::ResizePane(const Direction& direction)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -377,7 +334,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - direction: The direction to move the focus in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::NavigateFocus(const Direction& direction)
|
||||
void TerminalTab::NavigateFocus(const Direction& direction)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -386,7 +343,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Prepares this tab for being removed from the UI hierarchy by shutting down all active connections.
|
||||
void Tab::Shutdown()
|
||||
void TerminalTab::Shutdown()
|
||||
{
|
||||
_rootPane->Shutdown();
|
||||
}
|
||||
@@ -399,21 +356,21 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ClosePane()
|
||||
void TerminalTab::ClosePane()
|
||||
{
|
||||
_activePane->Close();
|
||||
}
|
||||
|
||||
void Tab::SetTabText(winrt::hstring title)
|
||||
void TerminalTab::SetTabText(winrt::hstring title)
|
||||
{
|
||||
_runtimeTabText = title;
|
||||
_UpdateTitle();
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
void Tab::ResetTabText()
|
||||
void TerminalTab::ResetTabText()
|
||||
{
|
||||
_runtimeTabText = L"";
|
||||
_UpdateTitle();
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -426,7 +383,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: the TermControl to add events to.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_AttachEventHandlersToControl(const TermControl& control)
|
||||
void TerminalTab::_AttachEventHandlersToControl(const TermControl& control)
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -436,7 +393,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// The title of the control changed, but not necessarily the title of the tab.
|
||||
// Set the tab's text to the active panes' text.
|
||||
tab->_UpdateTitle();
|
||||
tab->UpdateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -473,7 +430,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - pane: a Pane to mark as active.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_UpdateActivePane(std::shared_ptr<Pane> pane)
|
||||
void TerminalTab::_UpdateActivePane(std::shared_ptr<Pane> pane)
|
||||
{
|
||||
// Clear the active state of the entire tree, and mark only the pane as active.
|
||||
_rootPane->ClearActive();
|
||||
@@ -481,7 +438,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_activePane->SetActive();
|
||||
|
||||
// Update our own title text to match the newly-active pane.
|
||||
_UpdateTitle();
|
||||
UpdateTitle();
|
||||
|
||||
// Raise our own ActivePaneChanged event.
|
||||
_ActivePaneChangedHandlers();
|
||||
@@ -496,7 +453,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_AttachEventHandlersToPane(std::shared_ptr<Pane> pane)
|
||||
void TerminalTab::_AttachEventHandlersToPane(std::shared_ptr<Pane> pane)
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -510,6 +467,22 @@ namespace winrt::TerminalApp::implementation
|
||||
tab->_RecalculateAndApplyTabColor();
|
||||
}
|
||||
});
|
||||
|
||||
// Add a Closed event handler to the Pane. If the pane closes out from
|
||||
// underneath us, and it's zoomed, we want to be able to make sure to
|
||||
// update our state accordingly to un-zoom that pane. See GH#7252.
|
||||
pane->Closed([weakThis](auto&& /*s*/, auto && /*e*/) -> winrt::fire_and_forget {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
if (tab->_zoomedPane)
|
||||
{
|
||||
co_await winrt::resume_foreground(tab->Content().Dispatcher());
|
||||
|
||||
tab->Content(tab->_rootPane->GetRootElement());
|
||||
tab->ExitZoom();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -520,7 +493,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_CreateContextMenu()
|
||||
void TerminalTab::_CreateContextMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -595,7 +568,7 @@ namespace winrt::TerminalApp::implementation
|
||||
newTabFlyout.Items().Append(menuSeparator);
|
||||
newTabFlyout.Items().Append(_CreateCloseSubMenu());
|
||||
newTabFlyout.Items().Append(closeTabMenuItem);
|
||||
_tabViewItem.ContextFlyout(newTabFlyout);
|
||||
TabViewItem().ContextFlyout(newTabFlyout);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -604,7 +577,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the created MenuFlyoutSubItem
|
||||
Controls::MenuFlyoutSubItem Tab::_CreateCloseSubMenu()
|
||||
Controls::MenuFlyoutSubItem TerminalTab::_CreateCloseSubMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -640,7 +613,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_EnableCloseMenuItems()
|
||||
void TerminalTab::_EnableCloseMenuItems()
|
||||
{
|
||||
// close other tabs is enabled only if there are other tabs
|
||||
_closeOtherTabsMenuItem.IsEnabled(TabViewNumTabs() > 1);
|
||||
@@ -660,9 +633,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_UpdateTabHeader()
|
||||
void TerminalTab::_UpdateTabHeader()
|
||||
{
|
||||
winrt::hstring tabText{ GetActiveTitle() };
|
||||
winrt::hstring tabText{ Title() };
|
||||
|
||||
if (!_inRename)
|
||||
{
|
||||
@@ -680,13 +653,13 @@ namespace winrt::TerminalApp::implementation
|
||||
tb.Text(tabText);
|
||||
sp.Children().Append(tb);
|
||||
|
||||
_tabViewItem.Header(sp);
|
||||
TabViewItem().Header(sp);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we're not currently in the process of renaming the tab,
|
||||
// then just set the tab's text to whatever our active title is.
|
||||
_tabViewItem.Header(winrt::box_value(tabText));
|
||||
TabViewItem().Header(winrt::box_value(tabText));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -703,9 +676,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tabText: This should be the text to initialize the rename text box with.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_ConstructTabRenameBox(const winrt::hstring& tabText)
|
||||
void TerminalTab::_ConstructTabRenameBox(const winrt::hstring& tabText)
|
||||
{
|
||||
if (_tabViewItem.Header().try_as<Controls::TextBox>())
|
||||
if (TabViewItem().Header().try_as<Controls::TextBox>())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -753,7 +726,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
tab->_runtimeTabText = textBox.Text();
|
||||
tab->_inRename = false;
|
||||
tab->_UpdateTitle();
|
||||
tab->UpdateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -775,7 +748,7 @@ namespace winrt::TerminalApp::implementation
|
||||
e.Handled(true);
|
||||
textBox.Text(tab->_runtimeTabText);
|
||||
tab->_inRename = false;
|
||||
tab->_UpdateTitle();
|
||||
tab->UpdateTitle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -785,7 +758,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_tabRenameBoxLayoutUpdatedRevoker = tabTextBox.LayoutUpdated(winrt::auto_revoke, [this](auto&&, auto&&) {
|
||||
// Curiously, the sender for this event is null, so we have to
|
||||
// get the TextBox from the Tab's Header().
|
||||
auto textBox{ _tabViewItem.Header().try_as<Controls::TextBox>() };
|
||||
auto textBox{ TabViewItem().Header().try_as<Controls::TextBox>() };
|
||||
if (textBox)
|
||||
{
|
||||
textBox.SelectAll();
|
||||
@@ -795,7 +768,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_tabRenameBoxLayoutUpdatedRevoker.revoke();
|
||||
});
|
||||
|
||||
_tabViewItem.Header(tabTextBox);
|
||||
TabViewItem().Header(tabTextBox);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -804,7 +777,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The tab's color, if any
|
||||
std::optional<winrt::Windows::UI::Color> Tab::GetTabColor()
|
||||
std::optional<winrt::Windows::UI::Color> TerminalTab::GetTabColor()
|
||||
{
|
||||
const auto currControlColor{ GetActiveTerminalControl().TabColor() };
|
||||
std::optional<winrt::Windows::UI::Color> controlTabColor;
|
||||
@@ -841,7 +814,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - color: the color the user picked for their tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::SetRuntimeTabColor(const winrt::Windows::UI::Color& color)
|
||||
void TerminalTab::SetRuntimeTabColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
_runtimeTabColor.emplace(color);
|
||||
_RecalculateAndApplyTabColor();
|
||||
@@ -856,11 +829,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_RecalculateAndApplyTabColor()
|
||||
void TerminalTab::_RecalculateAndApplyTabColor()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
_tabViewItem.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis]() {
|
||||
TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis]() {
|
||||
auto ptrTab = weakThis.get();
|
||||
if (!ptrTab)
|
||||
return;
|
||||
@@ -888,7 +861,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - color: the color the user picked for their tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_ApplyTabColor(const winrt::Windows::UI::Color& color)
|
||||
void TerminalTab::_ApplyTabColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
Media::SolidColorBrush selectedTabBrush{};
|
||||
Media::SolidColorBrush deselectedTabBrush{};
|
||||
@@ -917,15 +890,15 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// currently if a tab has a custom color, a deselected state is
|
||||
// signified by using the same color with a bit ot transparency
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush);
|
||||
|
||||
_RefreshVisualState();
|
||||
|
||||
@@ -940,7 +913,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ResetRuntimeTabColor()
|
||||
void TerminalTab::ResetRuntimeTabColor()
|
||||
{
|
||||
_runtimeTabColor.reset();
|
||||
_RecalculateAndApplyTabColor();
|
||||
@@ -953,7 +926,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_ClearTabBackgroundColor()
|
||||
void TerminalTab::_ClearTabBackgroundColor()
|
||||
{
|
||||
winrt::hstring keys[] = {
|
||||
L"TabViewItemHeaderBackground",
|
||||
@@ -971,9 +944,9 @@ namespace winrt::TerminalApp::implementation
|
||||
for (auto keyString : keys)
|
||||
{
|
||||
auto key = winrt::box_value(keyString);
|
||||
if (_tabViewItem.Resources().HasKey(key))
|
||||
if (TabViewItem().Resources().HasKey(key))
|
||||
{
|
||||
_tabViewItem.Resources().Remove(key);
|
||||
TabViewItem().Resources().Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -987,9 +960,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ActivateColorPicker()
|
||||
void TerminalTab::ActivateColorPicker()
|
||||
{
|
||||
_tabColorPickup.ShowAt(_tabViewItem);
|
||||
_tabColorPickup.ShowAt(TabViewItem());
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -999,17 +972,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_RefreshVisualState()
|
||||
void TerminalTab::_RefreshVisualState()
|
||||
{
|
||||
if (_focused)
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
{
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1019,7 +992,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The total number of leaf panes hosted by this tab.
|
||||
int Tab::GetLeafPaneCount() const noexcept
|
||||
int TerminalTab::GetLeafPaneCount() const noexcept
|
||||
{
|
||||
return _rootPane->GetLeafPaneCount();
|
||||
}
|
||||
@@ -1034,12 +1007,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - The SplitState that we should use for an `Automatic` split given
|
||||
// `availableSpace`
|
||||
SplitState Tab::PreCalculateAutoSplit(winrt::Windows::Foundation::Size availableSpace) const
|
||||
SplitState TerminalTab::PreCalculateAutoSplit(winrt::Windows::Foundation::Size availableSpace) const
|
||||
{
|
||||
return _rootPane->PreCalculateAutoSplit(_activePane, availableSpace).value_or(SplitState::Vertical);
|
||||
}
|
||||
|
||||
bool Tab::PreCalculateCanSplit(SplitState splitType, winrt::Windows::Foundation::Size availableSpace) const
|
||||
bool TerminalTab::PreCalculateCanSplit(SplitState splitType, winrt::Windows::Foundation::Size availableSpace) const
|
||||
{
|
||||
return _rootPane->PreCalculateCanSplit(_activePane, splitType, availableSpace).value_or(false);
|
||||
}
|
||||
@@ -1048,13 +1021,13 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Toggle our zoom state.
|
||||
// * If we're not zoomed, then zoom the active pane, making it take the
|
||||
// full size of the tab. We'll achieve this by changing our response to
|
||||
// Tab::GetRootElement, so that it'll return the zoomed pane only.
|
||||
// Tab::GetTabContent, so that it'll return the zoomed pane only.
|
||||
// * If we're currently zoomed on a pane, un-zoom that pane.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ToggleZoom()
|
||||
void TerminalTab::ToggleZoom()
|
||||
{
|
||||
if (_zoomedPane)
|
||||
{
|
||||
@@ -1065,46 +1038,29 @@ namespace winrt::TerminalApp::implementation
|
||||
EnterZoom();
|
||||
}
|
||||
}
|
||||
void Tab::EnterZoom()
|
||||
void TerminalTab::EnterZoom()
|
||||
{
|
||||
_zoomedPane = _activePane;
|
||||
_rootPane->Maximize(_zoomedPane);
|
||||
// Update the tab header to show the magnifying glass
|
||||
_UpdateTabHeader();
|
||||
Content(_zoomedPane->GetRootElement());
|
||||
}
|
||||
void Tab::ExitZoom()
|
||||
void TerminalTab::ExitZoom()
|
||||
{
|
||||
_rootPane->Restore(_zoomedPane);
|
||||
_zoomedPane = nullptr;
|
||||
// Update the tab header to hide the magnifying glass
|
||||
_UpdateTabHeader();
|
||||
Content(_rootPane->GetRootElement());
|
||||
}
|
||||
|
||||
bool Tab::IsZoomed()
|
||||
bool TerminalTab::IsZoomed()
|
||||
{
|
||||
return _zoomedPane != nullptr;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Initializes a SwitchToTab command object for this Tab instance.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_MakeSwitchToTabCommand()
|
||||
{
|
||||
SwitchToTabArgs args{ _TabViewIndex };
|
||||
ActionAndArgs focusTabAction{ ShortcutAction::SwitchToTab, args };
|
||||
|
||||
Command command;
|
||||
command.Action(focusTabAction);
|
||||
command.Name(Title());
|
||||
command.Icon(_lastIconPath);
|
||||
|
||||
SwitchToTabCommand(command);
|
||||
}
|
||||
|
||||
void Tab::_CloseTabsAfter()
|
||||
void TerminalTab::_CloseTabsAfter()
|
||||
{
|
||||
CloseTabsAfterArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeTabsAfter{ ShortcutAction::CloseTabsAfter, args };
|
||||
@@ -1112,7 +1068,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_dispatch.DoAction(closeTabsAfter);
|
||||
}
|
||||
|
||||
void Tab::_CloseOtherTabs()
|
||||
void TerminalTab::_CloseOtherTabs()
|
||||
{
|
||||
CloseOtherTabsArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeOtherTabs{ ShortcutAction::CloseOtherTabs, args };
|
||||
@@ -1120,20 +1076,12 @@ namespace winrt::TerminalApp::implementation
|
||||
_dispatch.DoAction(closeOtherTabs);
|
||||
}
|
||||
|
||||
void Tab::UpdateTabViewIndex(const uint32_t idx, const uint32_t numTabs)
|
||||
{
|
||||
TabViewIndex(idx);
|
||||
TabViewNumTabs(numTabs);
|
||||
_EnableCloseMenuItems();
|
||||
SwitchToTabCommand().Action().Args().as<SwitchToTabArgs>().TabIndex(idx);
|
||||
}
|
||||
|
||||
void Tab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
void TerminalTab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
|
||||
DEFINE_EVENT(Tab, ActivePaneChanged, _ActivePaneChangedHandlers, winrt::delegate<>);
|
||||
DEFINE_EVENT(Tab, ColorSelected, _colorSelected, winrt::delegate<winrt::Windows::UI::Color>);
|
||||
DEFINE_EVENT(Tab, ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
DEFINE_EVENT(TerminalTab, ActivePaneChanged, _ActivePaneChangedHandlers, winrt::delegate<>);
|
||||
DEFINE_EVENT(TerminalTab, ColorSelected, _colorSelected, winrt::delegate<winrt::Windows::UI::Color>);
|
||||
DEFINE_EVENT(TerminalTab, ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
#include "Pane.h"
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "Tab.g.h"
|
||||
#include "TerminalTab.g.h"
|
||||
|
||||
// fwdecl unittest classes
|
||||
namespace TerminalAppLocalTests
|
||||
@@ -14,22 +14,19 @@ namespace TerminalAppLocalTests
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct Tab : public TabT<Tab>
|
||||
struct TerminalTab : TerminalTabT<TerminalTab>
|
||||
{
|
||||
public:
|
||||
Tab() = delete;
|
||||
Tab(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
TerminalTab(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
|
||||
// Called after construction to perform the necessary setup, which relies on weak_ptr
|
||||
void Initialize(const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem GetTabViewItem();
|
||||
winrt::Windows::UI::Xaml::UIElement GetRootElement();
|
||||
winrt::Microsoft::Terminal::TerminalControl::TermControl GetActiveTerminalControl() const;
|
||||
std::optional<GUID> GetFocusedProfile() const noexcept;
|
||||
|
||||
bool IsFocused() const noexcept;
|
||||
void SetFocused(const bool focused);
|
||||
void Focus(winrt::Windows::UI::Xaml::FocusState focusState);
|
||||
winrt::Windows::UI::Xaml::FocusState FocusState() const noexcept;
|
||||
|
||||
winrt::fire_and_forget Scroll(const int delta);
|
||||
|
||||
@@ -47,7 +44,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void NavigateFocus(const winrt::Microsoft::Terminal::Settings::Model::Direction& direction);
|
||||
|
||||
void UpdateSettings(const winrt::TerminalApp::TerminalSettings& settings, const GUID& profile);
|
||||
winrt::hstring GetActiveTitle() const;
|
||||
winrt::fire_and_forget UpdateTitle();
|
||||
|
||||
void Shutdown();
|
||||
void ClosePane();
|
||||
@@ -68,8 +65,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
int GetLeafPaneCount() const noexcept;
|
||||
|
||||
void UpdateTabViewIndex(const uint32_t idx, const uint32_t numTabs);
|
||||
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
@@ -79,15 +74,18 @@ namespace winrt::TerminalApp::implementation
|
||||
DECLARE_EVENT(ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::Controls::IconSource, IconSource, _PropertyChangedHandlers, nullptr);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::Command, SwitchToTabCommand, _PropertyChangedHandlers, nullptr);
|
||||
|
||||
GETSET_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);
|
||||
// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
|
||||
// This is needed since Tab is going to be managing its own SwitchToTab command.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewIndex, _PropertyChangedHandlers, 0);
|
||||
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewNumTabs, _PropertyChangedHandlers, 0);
|
||||
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::FrameworkElement, Content, _PropertyChangedHandlers, nullptr);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Pane> _rootPane{ nullptr };
|
||||
std::shared_ptr<Pane> _activePane{ nullptr };
|
||||
@@ -99,8 +97,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
|
||||
|
||||
bool _focused{ false };
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem _tabViewItem{ nullptr };
|
||||
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
|
||||
|
||||
winrt::hstring _runtimeTabText{};
|
||||
bool _inRename{ false };
|
||||
@@ -109,7 +106,6 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
|
||||
|
||||
void _MakeTabViewItem();
|
||||
void _Focus();
|
||||
|
||||
void _CreateContextMenu();
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutSubItem _CreateCloseSubMenu();
|
||||
@@ -124,16 +120,14 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _UpdateActivePane(std::shared_ptr<Pane> pane);
|
||||
|
||||
winrt::hstring _GetActiveTitle() const;
|
||||
void _UpdateTabHeader();
|
||||
winrt::fire_and_forget _UpdateTitle();
|
||||
void _ConstructTabRenameBox(const winrt::hstring& tabText);
|
||||
|
||||
void _RecalculateAndApplyTabColor();
|
||||
void _ApplyTabColor(const winrt::Windows::UI::Color& color);
|
||||
void _ClearTabBackgroundColor();
|
||||
|
||||
void _MakeSwitchToTabCommand();
|
||||
|
||||
void _CloseTabsAfter();
|
||||
void _CloseOtherTabs();
|
||||
|
||||
11
src/cascadia/TerminalApp/TerminalTab.idl
Normal file
11
src/cascadia/TerminalApp/TerminalTab.idl
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "ITab.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
[default_interface] runtimeclass TerminalTab : ITab, Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,8 @@
|
||||
<ClInclude Include="../TitlebarControl.h" />
|
||||
<ClInclude Include="../TabRowControl.h" />
|
||||
<ClInclude Include="../App.h" />
|
||||
<ClInclude Include="../Tab.h" />
|
||||
<ClInclude Include="../TerminalTab.h" />
|
||||
<ClInclude Include="../SettingsTab.h" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Cpp Files ======================== -->
|
||||
<ItemGroup>
|
||||
@@ -69,6 +70,7 @@
|
||||
include Settings and Connection, since Control will include them for us) -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
|
||||
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as
|
||||
our TerminalApp.winmd. This didn't work correctly in VS2017, you'd need to
|
||||
|
||||
@@ -67,7 +67,9 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalAppProvider);
|
||||
|
||||
#include <winrt/Microsoft.Terminal.TerminalControl.h>
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Editor.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||
|
||||
#include <winrt/Windows.UI.Popups.h>
|
||||
|
||||
#include <CLI11/CLI11.hpp>
|
||||
|
||||
@@ -895,7 +895,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// keybindings on the keyUp, then we'll still send the keydown to the
|
||||
// connected terminal application, and something like ctrl+shift+T will
|
||||
// emit a ^T to the pipe.
|
||||
if (!modifiers.IsAltGrPressed() && keyDown && _TryHandleKeyBinding(vkey, modifiers))
|
||||
if (!modifiers.IsAltGrPressed() && keyDown && _TryHandleKeyBinding(vkey, scanCode, modifiers))
|
||||
{
|
||||
e.Handled(true);
|
||||
return;
|
||||
@@ -917,8 +917,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - Attempt to handle this key combination as a key binding
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
// - modifiers: The ControlKeyStates representing the modifier key states.
|
||||
bool TermControl::_TryHandleKeyBinding(const WORD vkey, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const
|
||||
bool TermControl::_TryHandleKeyBinding(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const
|
||||
{
|
||||
auto bindings = _settings.KeyBindings();
|
||||
if (!bindings)
|
||||
@@ -926,12 +927,44 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
return false;
|
||||
}
|
||||
|
||||
return bindings.TryKeyChord({
|
||||
auto success = bindings.TryKeyChord({
|
||||
modifiers.IsCtrlPressed(),
|
||||
modifiers.IsAltPressed(),
|
||||
modifiers.IsShiftPressed(),
|
||||
vkey,
|
||||
});
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Discards currently pressed dead keys.
|
||||
// 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
|
||||
{
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -941,6 +974,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - Makes the cursor briefly visible during typing.
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
// - states: The Microsoft::Terminal::Core::ControlKeyStates representing the modifier key states.
|
||||
// - keyDown: If true, the key was pressed, otherwise the key was released.
|
||||
bool TermControl::_TrySendKeyEvent(const WORD vkey,
|
||||
|
||||
@@ -285,7 +285,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
|
||||
void _KeyHandler(Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e, const bool keyDown);
|
||||
::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() const;
|
||||
bool _TryHandleKeyBinding(const WORD vkey, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const;
|
||||
bool _TryHandleKeyBinding(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const;
|
||||
void _ClearKeyboardState(const WORD vkey, const WORD scanCode) const noexcept;
|
||||
bool _TrySendKeyEvent(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
|
||||
bool _TrySendMouseEvent(Windows::UI::Input::PointerPoint const& point);
|
||||
bool _CanSendVTMouseInput();
|
||||
|
||||
@@ -582,7 +582,7 @@ CATCH_LOG_RETURN_FALSE()
|
||||
bool Terminal::AddHyperlink(std::wstring_view uri, std::wstring_view params) noexcept
|
||||
{
|
||||
auto attr = _buffer->GetCurrentAttributes();
|
||||
const auto id = _buffer->GetHyperlinkId(params);
|
||||
const auto id = _buffer->GetHyperlinkId(uri, params);
|
||||
attr.SetHyperlinkId(id);
|
||||
_buffer->SetCurrentAttributes(attr);
|
||||
_buffer->AddHyperlinkToMap(uri, id);
|
||||
|
||||
17
src/cascadia/TerminalSettingsEditor/AddProfile.cpp
Normal file
17
src/cascadia/TerminalSettingsEditor/AddProfile.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "AddProfile.h"
|
||||
#include "AddProfile.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
AddProfile::AddProfile()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
20
src/cascadia/TerminalSettingsEditor/AddProfile.h
Normal file
20
src/cascadia/TerminalSettingsEditor/AddProfile.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AddProfile.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct AddProfile : AddProfileT<AddProfile>
|
||||
{
|
||||
AddProfile();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(AddProfile);
|
||||
}
|
||||
7
src/cascadia/TerminalSettingsEditor/AddProfile.idl
Normal file
7
src/cascadia/TerminalSettingsEditor/AddProfile.idl
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
AddProfile();
|
||||
}
|
||||
}
|
||||
267
src/cascadia/TerminalSettingsEditor/AddProfile.xaml
Normal file
267
src/cascadia/TerminalSettingsEditor/AddProfile.xaml
Normal file
@@ -0,0 +1,267 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.AddProfile"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!--TODO: SETTINGS UI make sure there isn't a separate UI for a new profile vs existing ones.-->
|
||||
<Page.Resources>
|
||||
<Flyout x:Key="cursorColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="cursorColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="cursorColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--TODO: SETTINGS UI consolidate common styles across XAML pages. -->
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="foregroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="foregroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="foregroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="backgroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="backgroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="backgroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="selectionBackgroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="selectionBackgroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="selectionBackgroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
</Page.Resources>
|
||||
|
||||
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout>
|
||||
<Grid/>
|
||||
</Flyout>
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text=""
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,8" />
|
||||
|
||||
<GridView x:Name="ProfilesGridView"
|
||||
Margin="0,0,0,8"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True"
|
||||
RelativePanel.Below="TitleTextBox" Height="52">
|
||||
<GridView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
|
||||
MaximumRowsOrColumns="2"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</GridView.ItemsPanel>
|
||||
</GridView>
|
||||
<Pivot >
|
||||
<PivotItem Header="General">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBox Header="Name" Margin="0,0,0,10" />
|
||||
<TextBox Header="GUID" Margin="0,0,0,10" />
|
||||
<TextBox Header="Command line" Margin="0,0,0,10" />
|
||||
<TextBox Header="Starting directory" Margin="0,0,0,10" />
|
||||
<TextBox Header="Icon" Margin="0,0,0,10" />
|
||||
<TextBox Header="Tab title" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Scrollbar visibility" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="ScrollBarVisible" Content="Visible"/>
|
||||
<RadioButton x:Name="ScrollBarHidden" Content="Hidden"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
<PivotItem Header="Appearance">
|
||||
|
||||
<ScrollViewer >
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- THIS IS WHERE THE MINI-TERMINAL WOULD GO -->
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox Content="Enable acrylic" />
|
||||
<Controls:NumberBox Header="Acrylic opacity" Margin="0,0,0,10" Value="0.5" SpinButtonPlacementMode="Compact" SmallChange="0.1" LargeChange="0.25" />
|
||||
<TextBox Header="Background image" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Background image stretch mode" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="backgroundImageStretchModeNone" Content="none"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeFill" Content="fill"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeUniform" Content="uniform"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeUniformToFill" Content="uniformToFill"/>
|
||||
</Controls:RadioButtons>
|
||||
<Windows10version1809:DropDownButton Content="Background image alignment" Margin="0,0,0,10" >
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="center"/>
|
||||
<MenuFlyoutItem Text="left"/>
|
||||
<MenuFlyoutItem Text="top"/>
|
||||
<MenuFlyoutItem Text="right"/>
|
||||
<MenuFlyoutItem Text="bottom"/>
|
||||
<MenuFlyoutItem Text="topLeft"/>
|
||||
<MenuFlyoutItem Text="topRight"/>
|
||||
<MenuFlyoutItem Text="bottomLeft"/>
|
||||
<MenuFlyoutItem Text="bottomRight"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</Windows10version1809:DropDownButton>
|
||||
<Controls:NumberBox Header="Background image opacity" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="25" />
|
||||
<CheckBox Content="Retro terminal effects" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Margin="0,0,80,0">
|
||||
<TextBox Header="Font face" Margin="0,0,0,10" />
|
||||
<Controls:NumberBox Header="Font size" Margin="0,0,0,10" Value="12" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" />
|
||||
<TextBox Header="Font weight" Margin="0,0,0,10"/>
|
||||
<TextBox Header="Padding" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Cursor shape" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="CursorShapeBar" Content="Bar"/>
|
||||
<RadioButton x:Name="CursorShapeVintage" Content="Vintage"/>
|
||||
<RadioButton x:Name="CursorShapeUnderscore" Content="Underscore"/>
|
||||
<RadioButton x:Name="CursorShapeFilledBox" Content="FilledBox"/>
|
||||
<RadioButton x:Name="CursorShapeEmptyBox" Content="EmptyBox"/>
|
||||
</Controls:RadioButtons>
|
||||
<Controls:NumberBox Header="Cursor height" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" />
|
||||
<Button x:Name="cursorColorPickerButton" Content="Cursor color" Flyout="{StaticResource cursorColorPickerFlyout}"/>
|
||||
<Controls:NumberBox Header="Cursor height" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="25" />
|
||||
<Windows10version1809:DropDownButton Content="Color scheme" Margin="0,0,0,10" >
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="Campbell"/>
|
||||
<MenuFlyoutItem Text="Campbell Powershell"/>
|
||||
<MenuFlyoutItem Text="Vintage"/>
|
||||
<MenuFlyoutItem Text="One Half Dark"/>
|
||||
<MenuFlyoutItem Text="One Half Light"/>
|
||||
<MenuFlyoutItem Text="Tango Dark"/>
|
||||
<MenuFlyoutItem Text="Tango Light"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</Windows10version1809:DropDownButton>
|
||||
<Button x:Name="foregroundColorPickerButton" Content="Foreground color" Flyout="{StaticResource foregroundColorPickerFlyout}"/>
|
||||
<Button x:Name="backgroundColorPickerButton" Content="Background color" Flyout="{StaticResource backgroundColorPickerFlyout}"/>
|
||||
<Button x:Name="selectionBackgroundColorPickerButton" Content="Selection background color" Flyout="{StaticResource selectionBackgroundColorPickerFlyout}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
<PivotItem Header="Advanced">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox Content="Hide profile from dropdown" />
|
||||
<CheckBox Content="Suppress title changes" />
|
||||
<Controls:RadioButtons Header="Antialiasing text" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="antialiasingTextGrayscale" Content="grayscale"/>
|
||||
<RadioButton x:Name="antialiasingTextCleartype" Content="cleartype"/>
|
||||
<RadioButton x:Name="antialiasingTextAliased" Content="aliased"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox Content="AltGr aliasing" />
|
||||
<CheckBox Content="Scroll to input when typing" />
|
||||
<Controls:NumberBox Header="History size" Margin="0,0,0,10" Value="9001" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="100" />
|
||||
<Controls:RadioButtons Header="How the profile closes" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="closeOnExitGraceful" Content="graceful"/>
|
||||
<RadioButton x:Name="closeOnExitAlways" Content="always"/>
|
||||
<RadioButton x:Name="closeOnExitNever" Content="never"/>
|
||||
<RadioButton x:Name="closeOnExitTrue" Content="true"/>
|
||||
<RadioButton x:Name="closeOnExitFalse" Content="false"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
</RelativePanel>
|
||||
</Page>
|
||||
|
||||
112
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
Normal file
112
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
Normal file
@@ -0,0 +1,112 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.h"
|
||||
#include "ColorSchemes.h"
|
||||
#include "ColorTableEntry.g.cpp"
|
||||
#include "ColorSchemes.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
using namespace winrt::Windows::UI::Xaml::Media;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
static constexpr std::array<std::string_view, 16> TableColors = {
|
||||
"Black",
|
||||
"Red",
|
||||
"Green",
|
||||
"Yellow",
|
||||
"Blue",
|
||||
"Purple",
|
||||
"Cyan",
|
||||
"White",
|
||||
"Bright Black",
|
||||
"Bright Red",
|
||||
"Bright Green",
|
||||
"Bright Yellow",
|
||||
"Bright Blue",
|
||||
"Bright Purple",
|
||||
"Bright Cyan",
|
||||
"Bright White"
|
||||
};
|
||||
|
||||
ColorSchemes::ColorSchemes() :
|
||||
_ColorSchemeList{ single_threaded_observable_vector<hstring>() },
|
||||
_CurrentColorTable{ single_threaded_observable_vector<Editor::ColorTableEntry>() }
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Initialize our list of color schemes and initially set color scheme and table.
|
||||
auto colorSchemeMap = MainPage::Settings().GlobalSettings().ColorSchemes();
|
||||
for (const auto& pair : MainPage::Settings().GlobalSettings().ColorSchemes())
|
||||
{
|
||||
_ColorSchemeList.Append(pair.Key());
|
||||
}
|
||||
}
|
||||
|
||||
IObservableVector<hstring> ColorSchemes::ColorSchemeList()
|
||||
{
|
||||
return _ColorSchemeList;
|
||||
}
|
||||
|
||||
void ColorSchemes::ColorSchemeSelectionChanged(IInspectable const& /*sender*/,
|
||||
SelectionChangedEventArgs const& args)
|
||||
{
|
||||
// Update the color scheme this page is modifying
|
||||
auto str = winrt::unbox_value<hstring>(args.AddedItems().GetAt(0));
|
||||
auto colorScheme = MainPage::Settings().GlobalSettings().ColorSchemes().Lookup(str);
|
||||
CurrentColorScheme(colorScheme);
|
||||
_UpdateColorTable(colorScheme);
|
||||
}
|
||||
|
||||
void ColorSchemes::_UpdateColorSchemeList()
|
||||
{
|
||||
auto colorSchemeMap = MainPage::Settings().GlobalSettings().ColorSchemes();
|
||||
for (const auto& pair : MainPage::Settings().GlobalSettings().ColorSchemes())
|
||||
{
|
||||
_ColorSchemeList.Append(pair.Key());
|
||||
}
|
||||
}
|
||||
|
||||
void ColorSchemes::ColorPickerChanged(IInspectable const& sender,
|
||||
ColorChangedEventArgs const& /*args*/)
|
||||
{
|
||||
if (auto picker = sender.try_as<ColorPicker>())
|
||||
{
|
||||
// TODO: Commented out for now because Tag currently won't bind to an index correctly.
|
||||
// The idea is this function will grab the index from the tag and call SetColorTableEntry.
|
||||
//auto index = winrt::unbox_value<uint8_t>(picker.Tag());
|
||||
//CurrentColorScheme().SetColorTableEntry(index, args.NewColor());
|
||||
}
|
||||
}
|
||||
|
||||
// Update the Page's displayed color table
|
||||
void ColorSchemes::_UpdateColorTable(const Model::ColorScheme& colorScheme)
|
||||
{
|
||||
_CurrentColorTable.Clear();
|
||||
for (uint8_t i = 0; i < TableColors.size(); ++i)
|
||||
{
|
||||
auto entry = winrt::make<ColorTableEntry>(i, colorScheme.Table()[i]);
|
||||
_CurrentColorTable.Append(entry);
|
||||
}
|
||||
}
|
||||
|
||||
ColorTableEntry::ColorTableEntry(uint32_t index, Windows::UI::Color color)
|
||||
{
|
||||
Index(winrt::box_value(index));
|
||||
Color(color);
|
||||
Name(to_hstring(TableColors[index]));
|
||||
}
|
||||
|
||||
Windows::UI::Xaml::Media::Brush ColorTableEntry::ColorToBrush(Windows::UI::Color color)
|
||||
{
|
||||
return SolidColorBrush(color);
|
||||
}
|
||||
}
|
||||
50
src/cascadia/TerminalSettingsEditor/ColorSchemes.h
Normal file
50
src/cascadia/TerminalSettingsEditor/ColorSchemes.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ColorTableEntry.g.h"
|
||||
#include "ColorSchemes.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct ColorSchemes : ColorSchemesT<ColorSchemes>
|
||||
{
|
||||
ColorSchemes();
|
||||
|
||||
void ColorSchemeSelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& args);
|
||||
void ColorPickerChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::ColorChangedEventArgs const& args);
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::hstring> ColorSchemeList();
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::ColorScheme, CurrentColorScheme, _PropertyChangedHandlers, nullptr);
|
||||
GETSET_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::ColorTableEntry>, CurrentColorTable, nullptr);
|
||||
|
||||
private:
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::hstring> _ColorSchemeList{ nullptr };
|
||||
|
||||
void _UpdateColorTable(const winrt::Microsoft::Terminal::Settings::Model::ColorScheme& colorScheme);
|
||||
void _UpdateColorSchemeList();
|
||||
};
|
||||
|
||||
struct ColorTableEntry : ColorTableEntryT<ColorTableEntry>
|
||||
{
|
||||
public:
|
||||
ColorTableEntry() = default;
|
||||
ColorTableEntry(uint32_t index, Windows::UI::Color color);
|
||||
|
||||
Windows::UI::Xaml::Media::Brush ColorToBrush(Windows::UI::Color color);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Name, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(IInspectable, Index, _PropertyChangedHandlers, nullptr);
|
||||
OBSERVABLE_GETSET_PROPERTY(Windows::UI::Color, Color, _PropertyChangedHandlers);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ColorSchemes);
|
||||
}
|
||||
23
src/cascadia/TerminalSettingsEditor/ColorSchemes.idl
Normal file
23
src/cascadia/TerminalSettingsEditor/ColorSchemes.idl
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
ColorSchemes();
|
||||
|
||||
Microsoft.Terminal.Settings.Model.ColorScheme CurrentColorScheme { get; };
|
||||
Windows.Foundation.Collections.IObservableVector<ColorTableEntry> CurrentColorTable;
|
||||
Windows.Foundation.Collections.IObservableVector<String> ColorSchemeList { get; };
|
||||
}
|
||||
|
||||
[default_interface] runtimeclass ColorTableEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
String Name { get; };
|
||||
IInspectable Index { get; };
|
||||
Windows.UI.Color Color;
|
||||
|
||||
Windows.UI.Xaml.Media.Brush ColorToBrush(Windows.UI.Color color);
|
||||
}
|
||||
}
|
||||
96
src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml
Normal file
96
src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml
Normal file
@@ -0,0 +1,96 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.ColorSchemes"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:model="using:Microsoft.Terminal.Settings.Model"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows.Foundation.UniversalApiContract" xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<Page.Resources>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Margin" Value="0,0,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource SystemBaseLowColor}"/>
|
||||
<Setter Property="Height" Value="37" />
|
||||
<Setter Property="Width" Value="37" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="Margin" Value="10,22,0,0" />
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="Width" Value="100"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
</Style>
|
||||
|
||||
<local:ColorToHexConverter x:Key="ColorToHexConverter"/>
|
||||
|
||||
<DataTemplate x:Key="ColorTableTemplate" x:DataType="local:ColorTableEntry">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Header="{x:Bind Name, Mode=OneWay}"
|
||||
Text="{x:Bind Color, Converter={StaticResource ColorToHexConverter}, Mode=TwoWay}"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Button Background="{x:Bind ColorToBrush(Color), Mode=OneWay}">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker Tag="{x:Bind Index, Mode=OneWay}"
|
||||
Color="{x:Bind Color, Mode=TwoWay}"
|
||||
IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True"
|
||||
ColorChanged="ColorPickerChanged"/>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Page.Resources>
|
||||
|
||||
<ScrollViewer>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Uid="ColorScheme_ColorSchemes"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20"
|
||||
Grid.Row="0" />
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0">
|
||||
<ComboBox x:Name="ColorSchemeComboBox"
|
||||
SelectedIndex="0"
|
||||
ItemsSource="{x:Bind ColorSchemeList, Mode=OneWay}"
|
||||
SelectionChanged="ColorSchemeSelectionChanged" Width="160">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl x:Name="ColorTableControl"
|
||||
ItemsSource="{x:Bind CurrentColorTable, Mode=TwoWay}"
|
||||
ItemTemplate="{StaticResource ColorTableTemplate}">
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
37
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.cpp
Normal file
37
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "ColorToHexConverter.h"
|
||||
#include "ColorToHexConverter.g.cpp"
|
||||
|
||||
using namespace winrt::Windows;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Foundation::IInspectable ColorToHexConverter::Convert(Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /* parameter */,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
til::color color{ winrt::unbox_value<winrt::Windows::UI::Color>(value) };
|
||||
auto hex = winrt::to_hstring(color.ToHexString().data());
|
||||
return winrt::box_value(hex);
|
||||
}
|
||||
|
||||
Foundation::IInspectable ColorToHexConverter::ConvertBack(Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /* parameter */,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
auto str = winrt::unbox_value<winrt::hstring>(value);
|
||||
std::wstring hex{ str.data() };
|
||||
Windows::UI::Color newColor;
|
||||
newColor.A = base::checked_cast<uint8_t>(std::stoi(hex.substr(1, 2), nullptr, 16));
|
||||
newColor.R = base::checked_cast<uint8_t>(std::stoi(hex.substr(3, 2), nullptr, 16));
|
||||
newColor.G = base::checked_cast<uint8_t>(std::stoi(hex.substr(5, 2), nullptr, 16));
|
||||
newColor.B = base::checked_cast<uint8_t>(std::stoi(hex.substr(7, 2), nullptr, 16));
|
||||
return winrt::box_value(newColor);
|
||||
}
|
||||
}
|
||||
30
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.h
Normal file
30
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.h
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ColorToHexConverter.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct ColorToHexConverter : ColorToHexConverterT<ColorToHexConverter>
|
||||
{
|
||||
ColorToHexConverter() = default;
|
||||
|
||||
Windows::Foundation::IInspectable Convert(Windows::Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& targetType,
|
||||
Windows::Foundation::IInspectable const& parameter,
|
||||
hstring const& language);
|
||||
|
||||
Windows::Foundation::IInspectable ConvertBack(Windows::Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& targetType,
|
||||
Windows::Foundation::IInspectable const& parameter,
|
||||
hstring const& language);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ColorToHexConverter);
|
||||
}
|
||||
10
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.idl
Normal file
10
src/cascadia/TerminalSettingsEditor/ColorToHexConverter.idl
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass ColorToHexConverter : [default] Windows.UI.Xaml.Data.IValueConverter
|
||||
{
|
||||
ColorToHexConverter();
|
||||
};
|
||||
}
|
||||
20
src/cascadia/TerminalSettingsEditor/CommonResources.xaml
Normal file
20
src/cascadia/TerminalSettingsEditor/CommonResources.xaml
Normal file
@@ -0,0 +1,20 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor">
|
||||
|
||||
<Style x:Key="GridViewItemStyle" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="0,0,12,12" />
|
||||
</Style>
|
||||
<Style x:Key="IndentedGridViewItemStyle" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="12,0,0,12" />
|
||||
</Style>
|
||||
<Style x:Key="GridViewItemStyleSmall" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="0,0,0,12" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style x:Key="IndentedGridViewItemStyleSmall" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="12,0,12,12" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
24
src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
Normal file
24
src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "GlobalAppearance.h"
|
||||
#include "GlobalAppearance.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
GlobalAppearance::GlobalAppearance()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings GlobalAppearance::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
21
src/cascadia/TerminalSettingsEditor/GlobalAppearance.h
Normal file
21
src/cascadia/TerminalSettingsEditor/GlobalAppearance.h
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GlobalAppearance.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct GlobalAppearance : GlobalAppearanceT<GlobalAppearance>
|
||||
{
|
||||
GlobalAppearance();
|
||||
winrt::Microsoft::Terminal::Settings::Model::GlobalAppSettings GlobalSettings();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(GlobalAppearance);
|
||||
}
|
||||
11
src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl
Normal file
11
src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass GlobalAppearance : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
GlobalAppearance();
|
||||
Microsoft.Terminal.Settings.Model.GlobalAppSettings GlobalSettings { get; };
|
||||
}
|
||||
}
|
||||
45
src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
Normal file
45
src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<!--TODO: SETTINGS UI All strings must be attached to UIDs-->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.GlobalAppearance"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Uid="Globals_GlobalAppearance"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<Controls:RadioButtons x:Uid="Globals_Theme" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Globals_ThemeDefault" x:Name="DefaultTheme"/>
|
||||
<RadioButton x:Uid="Globals_ThemeDark" x:Name="DarkTheme"/>
|
||||
<RadioButton x:Uid="Globals_ThemeLight" x:Name="LightTheme"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox x:Uid="Globals_ShowTitlebar" IsChecked="{x:Bind GlobalSettings.ShowTabsInTitlebar, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_ShowTitleInTitlebar" IsChecked="{x:Bind GlobalSettings.ShowTitleInTitlebar, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_AlwaysShowTabs" IsChecked="{x:Bind GlobalSettings.AlwaysShowTabs, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<Controls:RadioButtons x:Uid="Globals_TabWidthMode" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Globals_TabWidthModeEqual" x:Name="EqualTabWidthMode"/>
|
||||
<RadioButton x:Uid="Globals_TabWidthModeTitleLength" x:Name="TitleLengthTabWidthMode"/>
|
||||
<RadioButton x:Uid="Globals_TabWidthModeCompact" x:Name="CompactTabWidthMode"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox x:Uid="Globals_ConfirmCloseAllTabs" IsChecked="{x:Bind GlobalSettings.ConfirmCloseAllTabs, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
35
src/cascadia/TerminalSettingsEditor/GlobalSettings.idl
Normal file
35
src/cascadia/TerminalSettingsEditor/GlobalSettings.idl
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "SettingsTypes.idl";
|
||||
|
||||
namespace SettingsControl
|
||||
{
|
||||
[default_interface] runtimeclass GlobalSettings {
|
||||
GlobalSettings();
|
||||
|
||||
String UnparsedDefaultProfile();
|
||||
|
||||
Guid DefaultProfile;
|
||||
Int32 InitialRows;
|
||||
Int32 InitialCols;
|
||||
Boolean AlwaysShowTabs;
|
||||
Boolean ShowTitleInTitlebar;
|
||||
Boolean ConfirmCloseAllTabs;
|
||||
Windows.UI.Xaml.ElementTheme Theme;
|
||||
TabWidthMode TabWidth;
|
||||
Boolean ShowTabsInTitlebar;
|
||||
String WordDelimiters;
|
||||
Boolean CopyOnSelect;
|
||||
Boolean CopyFormatting;
|
||||
Boolean WarnAboutLargePaste;
|
||||
Boolean WarnAboutMultiLinePaste;
|
||||
Boolean SnapToGridOnResize;
|
||||
Boolean ForceFullRepaintRendering;
|
||||
Boolean SoftwareRendering;
|
||||
Boolean ForceVTInput;
|
||||
Boolean DebugFeaturesEnabled;
|
||||
Boolean StartOnUserLogin;
|
||||
Boolean AlwaysOnTop;
|
||||
}
|
||||
}
|
||||
17
src/cascadia/TerminalSettingsEditor/Globals.cpp
Normal file
17
src/cascadia/TerminalSettingsEditor/Globals.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Globals.h"
|
||||
#include "Globals.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Globals::Globals()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
20
src/cascadia/TerminalSettingsEditor/Globals.h
Normal file
20
src/cascadia/TerminalSettingsEditor/Globals.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Globals.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Globals : GlobalsT<Globals>
|
||||
{
|
||||
Globals();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Globals);
|
||||
}
|
||||
11
src/cascadia/TerminalSettingsEditor/Globals.idl
Normal file
11
src/cascadia/TerminalSettingsEditor/Globals.idl
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Globals : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Globals();
|
||||
}
|
||||
}
|
||||
82
src/cascadia/TerminalSettingsEditor/Globals.xaml
Normal file
82
src/cascadia/TerminalSettingsEditor/Globals.xaml
Normal file
@@ -0,0 +1,82 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Globals"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Globals"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,10" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBlock Text="Appearance"
|
||||
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Requested Theme" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="SystemTheme" Content="System"/>
|
||||
<RadioButton x:Name="DarkTheme" Content="Dark"/>
|
||||
<RadioButton x:Name="LightTheme" Content="Light"/>
|
||||
</Controls:RadioButtons>
|
||||
<Controls:RadioButtons Header="Launch mode" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="DefaultLaunchMode" Content="Default"/>
|
||||
<RadioButton x:Name="MaximizedLaunchMode" Content="Maximized"/>
|
||||
</Controls:RadioButtons>
|
||||
<RelativePanel Margin="0,0,0,10">
|
||||
<Controls:NumberBox x:Name="InitialCols"
|
||||
Header="Initial Columns"
|
||||
Value="120"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Margin="0,0,20,0"/>
|
||||
<Controls:NumberBox x:Name="InitialRows"
|
||||
Header="Initial Rows"
|
||||
Value="30"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Margin="0,0,20,0"
|
||||
RelativePanel.RightOf="InitialCols"/>
|
||||
<TextBox Header="Initial position"
|
||||
RelativePanel.RightOf="InitialRows"/>
|
||||
</RelativePanel>
|
||||
<CheckBox Content="Always show tabs" />
|
||||
<CheckBox Content="Show Terminal title in titlebar" />
|
||||
<CheckBox Content="Show tabs in titlebar" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Tab width mode">
|
||||
<RadioButton x:Name="EqualTabWidthMode" Content="Equal"/>
|
||||
<RadioButton x:Name="TitleLengthTabWidthMode" Content="Title length"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,100,0">
|
||||
<TextBlock Text="Interaction"
|
||||
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<TextBox Header="Default profile" Margin="0,0,0,10" />
|
||||
<TextBox Header="Word delimiters" Margin="0,0,0,10" />
|
||||
<CheckBox Content="Confirm close all tabs" />
|
||||
<CheckBox Content="Copy on select" />
|
||||
<CheckBox Content="Snap to grid on resize" Margin="0,0,0,10" />
|
||||
<Controls:NumberBox x:Name="RowsToScroll"
|
||||
Header="Rows to scroll"
|
||||
Value="30"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Width="100" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
40
src/cascadia/TerminalSettingsEditor/Home.cpp
Normal file
40
src/cascadia/TerminalSettingsEditor/Home.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Home.h"
|
||||
#include "Home.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Home::Home()
|
||||
{
|
||||
m_homeViewModel = winrt::make<SettingsEditorViewModel>();
|
||||
InitializeComponent();
|
||||
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Startup", L"Launch_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Interaction", L"Interaction_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Rendering", L"Rendering_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Global appearance", L"GlobalAppearance_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Color schemes", L"ColorSchemes_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Global profile settings", L"GlobalProfile_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Keyboard", L"Keyboard_Nav"));
|
||||
}
|
||||
|
||||
void Home::HomeGridItemClickHandler(IInspectable const&, Controls::ItemClickEventArgs const& args)
|
||||
{
|
||||
auto clickedItemContainer = args.ClickedItem().as<HomeGridItem>();
|
||||
hstring tag = clickedItemContainer->PageTag();
|
||||
MainPage::Navigate(frame(), tag);
|
||||
}
|
||||
|
||||
Editor::SettingsEditorViewModel Home::HomeViewModel()
|
||||
{
|
||||
return m_homeViewModel;
|
||||
}
|
||||
|
||||
}
|
||||
28
src/cascadia/TerminalSettingsEditor/Home.h
Normal file
28
src/cascadia/TerminalSettingsEditor/Home.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Home.g.h"
|
||||
#include "SettingsEditorViewModel.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Home : HomeT<Home>
|
||||
{
|
||||
Home();
|
||||
|
||||
Editor::SettingsEditorViewModel HomeViewModel();
|
||||
|
||||
void HomeGridItemClickHandler(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::ItemClickEventArgs const& args);
|
||||
|
||||
private:
|
||||
Editor::SettingsEditorViewModel m_homeViewModel{ nullptr };
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Home);
|
||||
}
|
||||
13
src/cascadia/TerminalSettingsEditor/Home.idl
Normal file
13
src/cascadia/TerminalSettingsEditor/Home.idl
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "SettingsEditorViewModel.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass Home : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Home();
|
||||
SettingsEditorViewModel HomeViewModel{ get; };
|
||||
}
|
||||
}
|
||||
79
src/cascadia/TerminalSettingsEditor/Home.xaml
Normal file
79
src/cascadia/TerminalSettingsEditor/Home.xaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Home"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="CommonResources.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
<ScrollViewer>
|
||||
<Frame x:Name="frame">
|
||||
<Frame.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<NavigationThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</Frame.ContentTransitions>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="Windows Terminal Settings"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
TextAlignment="Center"
|
||||
Margin="0,0,0,20" />
|
||||
<GridView Grid.Row="1"
|
||||
x:Name="HomeGridView"
|
||||
ItemsSource="{x:Bind HomeViewModel.HomeGridItems}"
|
||||
ItemContainerStyle="{StaticResource GridViewItemStyle}"
|
||||
IsItemClickEnabled="True"
|
||||
SelectionMode="None"
|
||||
ItemClick="HomeGridItemClickHandler">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate x:DataType="local:HomeGridItem">
|
||||
<UserControl>
|
||||
<Grid
|
||||
x:Name="homeGridItemRoot"
|
||||
Width="344"
|
||||
Height="140"
|
||||
Padding="12"
|
||||
Background="{ThemeResource SystemControlBackgroundListLowBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<RelativePanel Grid.Column="1" Grid.ColumnSpan="2" Margin="16,6,0,0">
|
||||
<TextBlock
|
||||
x:Name="titleText"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Text="{x:Bind Title}"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
TextLineBounds="TrimToCapHeight"
|
||||
TextWrapping="NoWrap" />
|
||||
</RelativePanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
15
src/cascadia/TerminalSettingsEditor/HomeGridItem.cpp
Normal file
15
src/cascadia/TerminalSettingsEditor/HomeGridItem.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "HomeGridItem.h"
|
||||
#include "HomeGridItem.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
HomeGridItem::HomeGridItem(hstring const& title, hstring const& pageTag) :
|
||||
_Title{ title },
|
||||
_PageTag{ pageTag }
|
||||
{
|
||||
}
|
||||
}
|
||||
19
src/cascadia/TerminalSettingsEditor/HomeGridItem.h
Normal file
19
src/cascadia/TerminalSettingsEditor/HomeGridItem.h
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
#include "HomeGridItem.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct HomeGridItem : HomeGridItemT<HomeGridItem>
|
||||
{
|
||||
HomeGridItem() = delete;
|
||||
HomeGridItem(hstring const& title, hstring const& pageTag);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(hstring, Title, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(hstring, PageTag, _PropertyChangedHandlers);
|
||||
};
|
||||
}
|
||||
11
src/cascadia/TerminalSettingsEditor/HomeGridItem.idl
Normal file
11
src/cascadia/TerminalSettingsEditor/HomeGridItem.idl
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass HomeGridItem : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
String Title;
|
||||
String PageTag;
|
||||
}
|
||||
}
|
||||
24
src/cascadia/TerminalSettingsEditor/Interaction.cpp
Normal file
24
src/cascadia/TerminalSettingsEditor/Interaction.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Interaction.h"
|
||||
#include "Interaction.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Interaction::Interaction()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings Interaction::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user