mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-16 11:11:03 +00:00
Compare commits
25 Commits
dev/miniks
...
v1.0.1401.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dfe1bed1e | ||
|
|
bae91cee67 | ||
|
|
d7a54cb07d | ||
|
|
09f02dffe2 | ||
|
|
70cb335fd1 | ||
|
|
b9483a9471 | ||
|
|
43266a2f3d | ||
|
|
c31c857c1b | ||
|
|
36c5b5b5dc | ||
|
|
91fd1d0cbf | ||
|
|
15e338a7cd | ||
|
|
12488968dc | ||
|
|
1085914d1f | ||
|
|
ef8e4bf753 | ||
|
|
8ece1378e5 | ||
|
|
2314df8798 | ||
|
|
a52a588141 | ||
|
|
b1e4daaeed | ||
|
|
e119959943 | ||
|
|
7b291ea39a | ||
|
|
d739523db2 | ||
|
|
04a172ed92 | ||
|
|
06640d3c51 | ||
|
|
cbc42caebb | ||
|
|
420a0c9245 |
17
.github/actions/spell-check/advice.txt
vendored
Normal file
17
.github/actions/spell-check/advice.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<details>
|
||||
<summary>
|
||||
:pencil2: Contributor please read this
|
||||
</summary>
|
||||
|
||||
* If the items listed above are names, please add them to `.github/actions/spell-check/dictionary/names.txt`.
|
||||
* If they're APIs, you can add them to a file in `.github/actions/spell-check/dictionary/`.
|
||||
* If they're just things you're using, please add them to an appropriate file in `.github/actions/spell-check/whitelist/`.
|
||||
* If you need to use a specific token in one place and it 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.
|
||||
</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.
|
||||
@@ -1,6 +1,6 @@
|
||||
# Allow files are lists of words to accept unconditionally
|
||||
# Dictionaries are lists of words to accept unconditionally
|
||||
|
||||
While check spelling will complain about an expected word
|
||||
While check spelling will complain about a whitelisted word
|
||||
which is no longer present, you can include things here even if
|
||||
they are not otherwise present in the repository.
|
||||
|
||||
@@ -8,14 +8,13 @@ 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 |
|
||||
| ---- | ----------- |
|
||||
| [Allow](allow.txt) | Supplements to the dictionary |
|
||||
| [Dictionary](dictionary.txt) | Primary US English dictionary |
|
||||
| [Chinese](chinese.txt) | Chinese words |
|
||||
| [Japanese](japanese.txt) | Japanese words |
|
||||
| [Microsoft](microsoft.txt) | Microsoft brand items |
|
||||
| [Fonts](fonts.txt) | Font names |
|
||||
| [Names](names.txt) | Names of people |
|
||||
| [Colors](colors.txt) | Names of color |
|
||||
13
.github/actions/spell-check/dictionary/apis.txt
vendored
Normal file
13
.github/actions/spell-check/dictionary/apis.txt
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
IBox
|
||||
ICustom
|
||||
IMap
|
||||
IObject
|
||||
LCID
|
||||
NCHITTEST
|
||||
NCLBUTTONDBLCLK
|
||||
NCRBUTTONDBLCLK
|
||||
NOREDIRECTIONBITMAP
|
||||
oaidl
|
||||
ocidl
|
||||
rfind
|
||||
SIZENS
|
||||
479807
.github/actions/spell-check/dictionary/dictionary.txt
vendored
Normal file
479807
.github/actions/spell-check/dictionary/dictionary.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,8 @@
|
||||
Consolas
|
||||
emoji
|
||||
emojis
|
||||
Extralight
|
||||
Gabriola
|
||||
Iosevka
|
||||
MDL
|
||||
Monofur
|
||||
Segoe
|
||||
wght
|
||||
3
.github/actions/spell-check/dictionary/math.txt
vendored
Normal file
3
.github/actions/spell-check/dictionary/math.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
powf
|
||||
sqrtf
|
||||
isnan
|
||||
9
.github/actions/spell-check/dictionary/microsoft.txt
vendored
Normal file
9
.github/actions/spell-check/dictionary/microsoft.txt
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
LKG
|
||||
mfcribbon
|
||||
microsoft
|
||||
microsoftonline
|
||||
osgvsowi
|
||||
powershell
|
||||
tdbuildteamid
|
||||
vcruntime
|
||||
visualstudio
|
||||
@@ -1,66 +1,42 @@
|
||||
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
|
||||
@@ -68,24 +44,15 @@ Pham
|
||||
Rincewind
|
||||
rprichard
|
||||
Schoonover
|
||||
shadertoy
|
||||
Shomnipotence
|
||||
simioni
|
||||
Somuah
|
||||
sonph
|
||||
sonpham
|
||||
stakx
|
||||
talo
|
||||
thereses
|
||||
Walisch
|
||||
WDX
|
||||
Wellons
|
||||
Wirt
|
||||
Wojciech
|
||||
zadjii
|
||||
Zamor
|
||||
Zamora
|
||||
zamora
|
||||
Zoey
|
||||
zorio
|
||||
Zverovich
|
||||
62
.github/actions/spell-check/excludes.txt
vendored
Normal file
62
.github/actions/spell-check/excludes.txt
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
(?:^|/)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$
|
||||
^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$
|
||||
12
.github/actions/spell-check/patterns/patterns.txt
vendored
Normal file
12
.github/actions/spell-check/patterns/patterns.txt
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_\/.]*
|
||||
https://aka\.ms/[-a-zA-Z0-9?&=\/_]*
|
||||
https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
||||
(?:0[Xx]|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]?\b
|
||||
\{[0-9A-FA-F]{8}-(?:[0-9A-FA-F]{4}-){3}[0-9A-FA-F]{12}\}
|
||||
\d+x\d+Logo
|
||||
Scro\&ll
|
||||
# selectionInput.cpp
|
||||
:\\windows\\syste\b
|
||||
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
|
||||
hostSm\.ProcessString\(L"[^"]+"
|
||||
\b([A-Za-z])\1{3,}\b
|
||||
7
.github/actions/spell-check/whitelist/README.md
vendored
Normal file
7
.github/actions/spell-check/whitelist/README.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
The contents of each `.txt` file in this directory are merged together.
|
||||
|
||||
* [alphabet](alphabet.txt) is a sample for alphabet related items
|
||||
* [web](web.txt) is a sample for web/html related items
|
||||
* [whitelist](whitelist.txt) is the main whitelist -- there is nothing
|
||||
particularly special about the file name (beyond the extension which is
|
||||
important).
|
||||
@@ -1,31 +1,21 @@
|
||||
AAAa
|
||||
AAAAA
|
||||
AAAAAAAAAAAAA
|
||||
AAAAAABBBBBBCCC
|
||||
AAAAABBBBBBCCC
|
||||
abcd
|
||||
abcd
|
||||
abcde
|
||||
abcdef
|
||||
ABCDEFG
|
||||
ABCDEFGH
|
||||
ABCDEFGHIJ
|
||||
abcdefghijk
|
||||
ABCDEFGHIJKLMNO
|
||||
abcdefghijklmnop
|
||||
ABCDEFGHIJKLMNOPQRST
|
||||
ABCG
|
||||
ABE
|
||||
abf
|
||||
BBBBB
|
||||
BBBBBBBB
|
||||
BBBBBCCC
|
||||
BBBBCCCCC
|
||||
BBGGRR
|
||||
EFG
|
||||
EFGh
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
BBBBBBBBBBBBBBDDDD
|
||||
QQQQQQQQQQABCDEFGHIJ
|
||||
QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQ
|
||||
QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ
|
||||
QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ
|
||||
qrstuvwxyz
|
||||
qwerty
|
||||
QWERTYUIOP
|
||||
qwertyuiopasdfg
|
||||
YYYYYYYDDDDDDDDDDD
|
||||
ZAAZZ
|
||||
@@ -37,4 +27,3 @@ ZYXWVUT
|
||||
ZZBBZ
|
||||
ZZZBB
|
||||
ZZZBZ
|
||||
ZZZZZ
|
||||
4
.github/actions/spell-check/whitelist/web.txt
vendored
Normal file
4
.github/actions/spell-check/whitelist/web.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
http
|
||||
td
|
||||
www
|
||||
ecma
|
||||
File diff suppressed because it is too large
Load Diff
15
.github/actions/spelling/README.md
vendored
15
.github/actions/spelling/README.md
vendored
@@ -1,15 +0,0 @@
|
||||
# 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
48
.github/actions/spelling/advice.md
vendored
@@ -1,48 +0,0 @@
|
||||
<!-- 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>
|
||||
108
.github/actions/spelling/allow/allow.txt
vendored
108
.github/actions/spelling/allow/allow.txt
vendored
@@ -1,108 +0,0 @@
|
||||
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
248
.github/actions/spelling/allow/apis.txt
vendored
@@ -1,248 +0,0 @@
|
||||
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
117
.github/actions/spelling/allow/colors.txt
vendored
@@ -1,117 +0,0 @@
|
||||
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
|
||||
11
.github/actions/spelling/allow/math.txt
vendored
11
.github/actions/spelling/allow/math.txt
vendored
@@ -1,11 +0,0 @@
|
||||
atan
|
||||
CPrime
|
||||
HBar
|
||||
HPrime
|
||||
isnan
|
||||
LPrime
|
||||
LStep
|
||||
powf
|
||||
RSub
|
||||
sqrtf
|
||||
ULP
|
||||
85
.github/actions/spelling/allow/microsoft.txt
vendored
85
.github/actions/spelling/allow/microsoft.txt
vendored
@@ -1,85 +0,0 @@
|
||||
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
|
||||
523
.github/actions/spelling/candidate.patterns
vendored
523
.github/actions/spelling/candidate.patterns
vendored
@@ -1,523 +0,0 @@
|
||||
# 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
117
.github/actions/spelling/excludes.txt
vendored
@@ -1,117 +0,0 @@
|
||||
# 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$
|
||||
13
.github/actions/spelling/expect/README.md
vendored
13
.github/actions/spelling/expect/README.md
vendored
@@ -1,13 +0,0 @@
|
||||
The contents of each `.txt` file in this directory are merged together.
|
||||
|
||||
* [alphabet](alphabet.txt) is a sample for alphabet related items
|
||||
* [web](web.txt) is a sample for web/html related items
|
||||
* [expect](expect.txt) is the main list of expected items -- there is nothing
|
||||
particularly special about the file name (beyond the extension which is
|
||||
important).
|
||||
|
||||
These terms are things which temporarily exist in the project, but which
|
||||
aren't necessarily words.
|
||||
|
||||
If something is a word that could come and go, it probably belongs in a
|
||||
[dictionary](../dictionary/README.md).
|
||||
6
.github/actions/spelling/expect/web.txt
vendored
6
.github/actions/spelling/expect/web.txt
vendored
@@ -1,6 +0,0 @@
|
||||
WCAG
|
||||
winui
|
||||
appshellintegration
|
||||
mdtauk
|
||||
gfycat
|
||||
Guake
|
||||
62
.github/actions/spelling/line_forbidden.patterns
vendored
62
.github/actions/spelling/line_forbidden.patterns
vendored
@@ -1,62 +0,0 @@
|
||||
# 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
96
.github/actions/spelling/patterns/patterns.txt
vendored
@@ -1,96 +0,0 @@
|
||||
# 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
12
.github/actions/spelling/reject.txt
vendored
@@ -1,12 +0,0 @@
|
||||
^attache$
|
||||
^attacher$
|
||||
^attachers$
|
||||
benefitting
|
||||
occurences?
|
||||
^dependan.*
|
||||
^oer$
|
||||
Sorce
|
||||
^[Ss]pae.*
|
||||
^untill$
|
||||
^untilling$
|
||||
^wether.*
|
||||
20
.github/workflows/spelling.yml
vendored
Normal file
20
.github/workflows/spelling.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
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.15-alpha
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
bucket: .github/actions
|
||||
project: spell-check
|
||||
134
.github/workflows/spelling2.yml
vendored
134
.github/workflows/spelling2.yml
vendored
@@ -1,134 +0,0 @@
|
||||
# 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 }}
|
||||
@@ -125,7 +125,7 @@ Team members will be happy to help review specs and guide them to completion.
|
||||
|
||||
### Help Wanted
|
||||
|
||||
Once the team have approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/terminal/labels/Help%20Wanted).
|
||||
Once the team have approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/terminal/labels/Help-Wanted).
|
||||
|
||||
---
|
||||
|
||||
@@ -155,4 +155,4 @@ Once your code has been reviewed and approved by the requisite number of team me
|
||||
|
||||
## Thank you
|
||||
|
||||
Thank you in advance for your contribution! Now, [what's next on the list](https://github.com/microsoft/terminal/labels/Help%20Wanted)? 😜
|
||||
Thank you in advance for your contribution! Now, [what's next on the list](https://github.com/microsoft/terminal/labels/Help-Wanted)? 😜
|
||||
|
||||
@@ -231,7 +231,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests_TerminalApp", "sr
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAppLib", "src\cascadia\TerminalApp\lib\TerminalAppLib.vcxproj", "{CA5CAD1A-9A12-429C-B551-8562EC954746}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}
|
||||
EndProjectSection
|
||||
@@ -303,8 +302,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAzBridge", "src\cas
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "src\dep\fmt\fmt.vcxproj", "{6BAE5851-50D5-4934-8D5E-30361A8A40F3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalSettingsControl", "src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj", "{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
AuditMode|Any CPU = AuditMode|Any CPU
|
||||
@@ -1511,27 +1508,6 @@ Global
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x64.Build.0 = Release|x64
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.ActiveCfg = AuditMode|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.Build.0 = AuditMode|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.Build.0 = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.Build.0 = Debug|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.Build.0 = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -1610,7 +1586,6 @@ Global
|
||||
{024052DE-83FB-4653-AEA4-90790D29D5BD} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
|
||||
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}
|
||||
|
||||
24
README.md
24
README.md
@@ -2,8 +2,7 @@
|
||||
|
||||
This repository contains the source code for:
|
||||
|
||||
* [Windows Terminal](https://aka.ms/terminal)
|
||||
* [Windows Terminal Preview](https://aka.ms/terminal-preview)
|
||||
* [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701)
|
||||
* The Windows console host (`conhost.exe`)
|
||||
* Components shared between the two projects
|
||||
* [ColorTool](https://github.com/Microsoft/Terminal/tree/master/src/tools/ColorTool)
|
||||
@@ -11,7 +10,6 @@ This repository contains the source code for:
|
||||
|
||||
Related repositories include:
|
||||
|
||||
* [Windows Terminal Documentation](https://docs.microsoft.com/windows/terminal) ([Repo: Contribute to the docs](https://github.com/MicrosoftDocs/terminal))
|
||||
* [Console API Documentation](https://github.com/MicrosoftDocs/Console-Docs)
|
||||
* [Cascadia Code Font](https://github.com/Microsoft/Cascadia-Code)
|
||||
|
||||
@@ -21,7 +19,7 @@ Related repositories include:
|
||||
|
||||
### Microsoft Store [Recommended]
|
||||
|
||||
Install the [Windows Terminal from the Microsoft Store][store-install-link]. This allows you to always be on the latest version when we release new builds with automatic upgrades.
|
||||
Install the [Windows Terminal from the Microsoft Store][store-install-link]. This allows you to always be on the latest version when we release new builds with automatic upgrades.
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
@@ -36,14 +34,6 @@ For users who are unable to install Terminal from the Microsoft Store, Terminal
|
||||
> * Be sure to install the [Desktop Bridge VC++ v14 Redistributable Package](https://www.microsoft.com/en-us/download/details.aspx?id=53175) otherwise Terminal may not install and/or run and may crash at startup
|
||||
> * Terminal will not auto-update when new builds are released so you will need to regularly install the latest Terminal release to receive all the latest fixes and improvements!
|
||||
|
||||
#### Via Windows Package Manager CLI (aka winget)
|
||||
|
||||
[winget](https://github.com/microsoft/winget-cli) users can download and install the latest Terminal release by installing the `Microsoft.WindowsTerminal` package:
|
||||
|
||||
```powershell
|
||||
winget install --id=Microsoft.WindowsTerminal -e
|
||||
```
|
||||
|
||||
#### Via Chocolatey (unofficial)
|
||||
|
||||
[Chocolatey](https://chocolatey.org) users can download and install the latest Terminal release by installing the `microsoft-windows-terminal` package:
|
||||
@@ -71,6 +61,12 @@ ColorTool|, and will be updated as the project proceeds.
|
||||
|
||||
---
|
||||
|
||||
## Terminal & Console Overview
|
||||
|
||||
Please take a few minutes to review the overview below before diving into the code:
|
||||
@@ -135,7 +131,7 @@ Solution: Make sure you're building & deploying the `CascadiaPackage` project in
|
||||
|
||||
## Documentation
|
||||
|
||||
All project documentation is located at aka.ms/terminal-docs. If you would like to contribute to the documentation, please submit a pull request on the [Windows Terminal Documentation repo](https://github.com/MicrosoftDocs/terminal).
|
||||
All project documentation is located in the `./doc` folder. If you would like to contribute to the documentation, please submit a pull request.
|
||||
|
||||
---
|
||||
|
||||
@@ -230,4 +226,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open
|
||||
[conduct-code]: https://opensource.microsoft.com/codeofconduct/
|
||||
[conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/
|
||||
[conduct-email]: mailto:opencode@microsoft.com
|
||||
[store-install-link]: https://aka.ms/terminal
|
||||
[store-install-link]: https://aka.ms/windowsterminal
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
|
||||
<XesBaseYearForStoreVersion>2020</XesBaseYearForStoreVersion>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>1</VersionMinor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -47,7 +47,6 @@ Properties listed below are specific to each unique profile.
|
||||
| `cursorShape` | Optional | String | `bar` | Sets the cursor shape for the profile. Possible values: `"vintage"` ( ▃ ), `"bar"` ( ┃ ), `"underscore"` ( ▁ ), `"filledBox"` ( █ ), `"emptyBox"` ( ▯ ) |
|
||||
| `fontFace` | Optional | String | `Cascadia Mono` | Name of the font face used in the profile. We will try to fallback to Consolas if this can't be found or is invalid. |
|
||||
| `fontSize` | Optional | Integer | `12` | Sets the font size. |
|
||||
| `fontWeight` | Optional | String | `normal` | Sets the weight (lightness or heaviness of the strokes) for the given font. Possible values: `"thin"`, `"extra-light"`, `"light"`, `"semi-light"`, `"normal"`, `"medium"`, `"semi-bold"`, `"bold"`, `"extra-bold"`, `"black"`, `"extra-black"`, or the corresponding numeric representation of OpenType font weight. |
|
||||
| `foreground` | Optional | String | | Sets the foreground color of the profile. Overrides `foreground` set in color scheme if `colorscheme` is set. Uses hex color format: `#rgb` or `"#rrggbb"`. |
|
||||
| `hidden` | Optional | Boolean | `false` | If set to true, the profile will not appear in the list of profiles. This can be used to hide default profiles and dynamically generated profiles, while leaving them in your settings file. |
|
||||
| `historySize` | Optional | Integer | `9001` | The number of lines above the ones displayed in the window you can scroll back to. |
|
||||
|
||||
@@ -531,32 +531,6 @@
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"fontWeight": {
|
||||
"default": "normal",
|
||||
"description": "Sets the weight (lightness or heaviness of the strokes) for the given font. Possible values:\n -\"thin\"\n -\"extra-light\"\n -\"light\"\n -\"semi-light\"\n -\"normal\" (default)\n -\"medium\"\n -\"semi-bold\"\n -\"bold\"\n -\"extra-bold\"\n -\"black\"\n -\"extra-black\" or the corresponding numeric representation of OpenType font weight.",
|
||||
"oneOf": [
|
||||
{
|
||||
"enum": [
|
||||
"thin",
|
||||
"extra-light",
|
||||
"light",
|
||||
"semi-light",
|
||||
"normal",
|
||||
"medium",
|
||||
"semi-bold",
|
||||
"bold",
|
||||
"extra-bold",
|
||||
"black",
|
||||
"extra-black"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"maximum": 990,
|
||||
"minimum": 100,
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
"foreground": {
|
||||
"$ref": "#/definitions/Color",
|
||||
"default": "#cccccc",
|
||||
|
||||
@@ -88,7 +88,7 @@ This will allow you to simplify the above snippet as follows:
|
||||
}
|
||||
```
|
||||
|
||||
A list of default key bindings is available [here](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/defaults.json#L204).
|
||||
|
||||
|
||||
### Unbinding keys
|
||||
|
||||
@@ -160,7 +160,7 @@ Example settings include
|
||||
|
||||
The profile GUID is used to reference the default profile in the global settings.
|
||||
|
||||
The values for background image stretch mode are documented [here](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.stretch).
|
||||
The values for background image stretch mode are documented [here](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.stretch)
|
||||
|
||||
### Hiding a profile
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ NOTE: The default shell is PowerShell; you can change this using the _Running a
|
||||
|
||||
### Command line options
|
||||
|
||||
Windows Terminal has implemented a rich set of command-line options in part as response to issue [#607](https://github.com/microsoft/terminal/issues/607). See [UsingCommandlineArguments.md](https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingCommandlineArguments.md) for details.
|
||||
None at this time. See issue [#607](https://github.com/microsoft/terminal/issues/607)
|
||||
|
||||
## Multiple Tabs
|
||||
|
||||
@@ -45,7 +45,7 @@ To customize the shell list, see the _Configuring Windows Terminal_ section belo
|
||||
|
||||
## Starting a new PowerShell tab with admin privilege
|
||||
|
||||
There is no current plan to support this feature for security reasons. See issue [#632](https://github.com/microsoft/terminal/issues/632)
|
||||
There is no current plan to support this feature for security reasons. See issue [#623](https://github.com/microsoft/terminal/issues/632)
|
||||
|
||||
## Selecting and Copying Text in Windows Terminal
|
||||
|
||||
@@ -61,7 +61,7 @@ Copy and paste operations can also be keybound. For more information on how to b
|
||||
|
||||
## Add a "Open Windows Terminal Here" to File Explorer
|
||||
|
||||
Not currently supported "out of the box" (See issue [#1060](https://github.com/microsoft/terminal/issues/1060)). However, you can open Windows Terminal in current directory by typing `wt -d .` in the Explorer address bar.
|
||||
Not currently supported "out of the box". See issue [#1060](https://github.com/microsoft/terminal/issues/1060)
|
||||
|
||||
## Configuring Windows Terminal
|
||||
|
||||
@@ -87,5 +87,4 @@ For an introduction to the various settings, see [Using Json Settings](UsingJson
|
||||
2. Terminal zoom can be changed by holding <kbd>Ctrl</kbd> and scrolling with mouse.
|
||||
3. Background opacity can be changed by holding <kbd>Ctrl</kbd>+<kbd>Shift</kbd> and scrolling with mouse. Note that acrylic transparency is limited by the OS only to focused windows.
|
||||
4. Open Windows Terminal in current directory by typing `wt -d .` in the address bar.
|
||||
5. Pin the Windows Terminal to the taskbar. Now it can be launched using the Windows shortcut <kbd>Win</kbd>+<kbd>Number</kbd> (e.g. <kbd>Win</kbd>+<kbd>1</kbd> or any other number based on the position in the taskbar!). Press <kbd>Win</kbd>+<kbd>Shift</kbd>+<kbd>Number</kbd> to always launch a new window.
|
||||
6. Please add more Tips and Tricks.
|
||||
5. Please add more Tips and Tricks.
|
||||
|
||||
@@ -190,6 +190,26 @@ bool ATTR_ROW::SetAttrToEnd(const UINT iStart, const TextAttribute attr)
|
||||
return SUCCEEDED(InsertAttrRuns({ &run, 1 }, iStart, _cchRowWidth - 1, _cchRowWidth));
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
// - Replaces all runs in the row with the given wToBeReplacedAttr with the new
|
||||
// attribute wReplaceWith. This method is used for replacing specifically
|
||||
// legacy attributes.
|
||||
// Arguments:
|
||||
// - wToBeReplacedAttr - the legacy attribute to replace in this row.
|
||||
// - wReplaceWith - the new value for the matching runs' attributes.
|
||||
// Return Value:
|
||||
// <none>
|
||||
void ATTR_ROW::ReplaceLegacyAttrs(_In_ WORD wToBeReplacedAttr, _In_ WORD wReplaceWith) noexcept
|
||||
{
|
||||
TextAttribute ToBeReplaced;
|
||||
ToBeReplaced.SetFromLegacy(wToBeReplacedAttr);
|
||||
|
||||
TextAttribute ReplaceWith;
|
||||
ReplaceWith.SetFromLegacy(wReplaceWith);
|
||||
|
||||
ReplaceAttrs(ToBeReplaced, ReplaceWith);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Replaces all runs in the row with the given toBeReplacedAttr with the new
|
||||
// attribute replaceWith.
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
size_t* const pApplies) const;
|
||||
|
||||
bool SetAttrToEnd(const UINT iStart, const TextAttribute attr);
|
||||
void ReplaceLegacyAttrs(const WORD wToBeReplacedAttr, const WORD wReplaceWith) noexcept;
|
||||
void ReplaceAttrs(const TextAttribute& toBeReplacedAttr, const TextAttribute& replaceWith) noexcept;
|
||||
|
||||
void Resize(const size_t newWidth);
|
||||
|
||||
@@ -44,6 +44,15 @@ OutputCell::OutputCell(const std::wstring_view charData,
|
||||
_setFromStringView(charData);
|
||||
}
|
||||
|
||||
OutputCell::OutputCell(const CHAR_INFO& charInfo) :
|
||||
_text{ UNICODE_INVALID },
|
||||
_dbcsAttribute{},
|
||||
_textAttribute{ InvalidTextAttribute },
|
||||
_behavior{ TextAttributeBehavior::Stored }
|
||||
{
|
||||
_setFromCharInfo(charInfo);
|
||||
}
|
||||
|
||||
OutputCell::OutputCell(const OutputCellView& cell)
|
||||
{
|
||||
_setFromOutputCellView(cell);
|
||||
@@ -75,6 +84,23 @@ void OutputCell::_setFromBehavior(const TextAttributeBehavior behavior)
|
||||
THROW_HR_IF(E_INVALIDARG, behavior == TextAttributeBehavior::Stored);
|
||||
}
|
||||
|
||||
void OutputCell::_setFromCharInfo(const CHAR_INFO& charInfo)
|
||||
{
|
||||
_text = charInfo.Char.UnicodeChar;
|
||||
|
||||
if (WI_IsFlagSet(charInfo.Attributes, COMMON_LVB_LEADING_BYTE))
|
||||
{
|
||||
_dbcsAttribute.SetLeading();
|
||||
}
|
||||
else if (WI_IsFlagSet(charInfo.Attributes, COMMON_LVB_TRAILING_BYTE))
|
||||
{
|
||||
_dbcsAttribute.SetTrailing();
|
||||
}
|
||||
_textAttribute.SetFromLegacy(charInfo.Attributes);
|
||||
|
||||
_behavior = TextAttributeBehavior::Stored;
|
||||
}
|
||||
|
||||
void OutputCell::_setFromStringView(const std::wstring_view view)
|
||||
{
|
||||
_text = view;
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
const DbcsAttribute dbcsAttribute,
|
||||
const TextAttribute textAttribute);
|
||||
|
||||
OutputCell(const CHAR_INFO& charInfo);
|
||||
OutputCell(const OutputCellView& view);
|
||||
|
||||
OutputCell(const OutputCell&) = default;
|
||||
@@ -85,6 +86,7 @@ private:
|
||||
TextAttributeBehavior _behavior;
|
||||
|
||||
void _setFromBehavior(const TextAttributeBehavior behavior);
|
||||
void _setFromCharInfo(const CHAR_INFO& charInfo);
|
||||
void _setFromStringView(const std::wstring_view view);
|
||||
void _setFromOutputCellView(const OutputCellView& cell);
|
||||
};
|
||||
|
||||
@@ -518,7 +518,8 @@ OutputCellView OutputCellIterator::s_GenerateView(const CHAR_INFO& charInfo) noe
|
||||
dbcsAttr.SetTrailing();
|
||||
}
|
||||
|
||||
const TextAttribute textAttr(charInfo.Attributes);
|
||||
TextAttribute textAttr;
|
||||
textAttr.SetFromLegacy(charInfo.Attributes);
|
||||
|
||||
const auto behavior = TextAttributeBehavior::Stored;
|
||||
return OutputCellView(glyph, dbcsAttr, textAttr, behavior);
|
||||
|
||||
@@ -18,7 +18,7 @@ COLORREF TextAttribute::CalculateRgbForeground(std::basic_string_view<COLORREF>
|
||||
COLORREF defaultFgColor,
|
||||
COLORREF defaultBgColor) const noexcept
|
||||
{
|
||||
return IsReverseVideo() ? _GetRgbBackground(colorTable, defaultBgColor) : _GetRgbForeground(colorTable, defaultFgColor);
|
||||
return _IsReverseVideo() ? _GetRgbBackground(colorTable, defaultBgColor) : _GetRgbForeground(colorTable, defaultFgColor);
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
@@ -31,7 +31,7 @@ COLORREF TextAttribute::CalculateRgbBackground(std::basic_string_view<COLORREF>
|
||||
COLORREF defaultFgColor,
|
||||
COLORREF defaultBgColor) const noexcept
|
||||
{
|
||||
return IsReverseVideo() ? _GetRgbForeground(colorTable, defaultFgColor) : _GetRgbBackground(colorTable, defaultBgColor);
|
||||
return _IsReverseVideo() ? _GetRgbForeground(colorTable, defaultFgColor) : _GetRgbBackground(colorTable, defaultBgColor);
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
@@ -60,6 +60,21 @@ COLORREF TextAttribute::_GetRgbBackground(std::basic_string_view<COLORREF> color
|
||||
return _background.GetColor(colorTable, defaultColor, false);
|
||||
}
|
||||
|
||||
void TextAttribute::SetMetaAttributes(const WORD wMeta) noexcept
|
||||
{
|
||||
WI_UpdateFlagsInMask(_wAttrLegacy, META_ATTRS, wMeta);
|
||||
WI_ClearAllFlags(_wAttrLegacy, COMMON_LVB_SBCSDBCS);
|
||||
}
|
||||
|
||||
WORD TextAttribute::GetMetaAttributes() const noexcept
|
||||
{
|
||||
WORD wMeta = _wAttrLegacy;
|
||||
WI_ClearAllFlags(wMeta, FG_ATTRS);
|
||||
WI_ClearAllFlags(wMeta, BG_ATTRS);
|
||||
WI_ClearAllFlags(wMeta, COMMON_LVB_SBCSDBCS);
|
||||
return wMeta;
|
||||
}
|
||||
|
||||
void TextAttribute::SetForeground(const COLORREF rgbForeground) noexcept
|
||||
{
|
||||
_foreground = TextColor(rgbForeground);
|
||||
@@ -70,14 +85,62 @@ void TextAttribute::SetBackground(const COLORREF rgbBackground) noexcept
|
||||
_background = TextColor(rgbBackground);
|
||||
}
|
||||
|
||||
void TextAttribute::SetIndexedForeground(const BYTE fgIndex) noexcept
|
||||
void TextAttribute::SetFromLegacy(const WORD wLegacy) noexcept
|
||||
{
|
||||
_wAttrLegacy = gsl::narrow_cast<WORD>(wLegacy & META_ATTRS);
|
||||
WI_ClearAllFlags(_wAttrLegacy, COMMON_LVB_SBCSDBCS);
|
||||
const BYTE fgIndex = gsl::narrow_cast<BYTE>(wLegacy & FG_ATTRS);
|
||||
const BYTE bgIndex = gsl::narrow_cast<BYTE>(wLegacy & BG_ATTRS) >> 4;
|
||||
_foreground = TextColor(fgIndex);
|
||||
_background = TextColor(bgIndex);
|
||||
}
|
||||
|
||||
void TextAttribute::SetIndexedBackground(const BYTE bgIndex) noexcept
|
||||
void TextAttribute::SetLegacyAttributes(const WORD attrs,
|
||||
const bool setForeground,
|
||||
const bool setBackground,
|
||||
const bool setMeta) noexcept
|
||||
{
|
||||
_background = TextColor(bgIndex);
|
||||
if (setForeground)
|
||||
{
|
||||
const BYTE fgIndex = gsl::narrow_cast<BYTE>(attrs & FG_ATTRS);
|
||||
_foreground = TextColor(fgIndex);
|
||||
}
|
||||
if (setBackground)
|
||||
{
|
||||
const BYTE bgIndex = gsl::narrow_cast<BYTE>(attrs & BG_ATTRS) >> 4;
|
||||
_background = TextColor(bgIndex);
|
||||
}
|
||||
if (setMeta)
|
||||
{
|
||||
SetMetaAttributes(attrs);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the foreground and/or background to a particular index in the 256color
|
||||
// table. If either parameter is nullptr, it's ignored.
|
||||
// This method can be used to set the colors to indexes in the range [0, 255],
|
||||
// as opposed to SetLegacyAttributes, which clamps them to [0,15]
|
||||
// Arguments:
|
||||
// - foreground: nullptr if we should ignore this attr, else a pointer to a byte
|
||||
// value to use as an index into the 256-color table.
|
||||
// - background: nullptr if we should ignore this attr, else a pointer to a byte
|
||||
// value to use as an index into the 256-color table.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TextAttribute::SetIndexedAttributes(const std::optional<const BYTE> foreground,
|
||||
const std::optional<const BYTE> background) noexcept
|
||||
{
|
||||
if (foreground)
|
||||
{
|
||||
const BYTE fgIndex = (*foreground) & 0xFF;
|
||||
_foreground = TextColor(fgIndex);
|
||||
}
|
||||
if (background)
|
||||
{
|
||||
const BYTE bgIndex = (*background) & 0xFF;
|
||||
_background = TextColor(bgIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void TextAttribute::SetColor(const COLORREF rgbColor, const bool fIsForeground) noexcept
|
||||
@@ -132,81 +195,19 @@ void TextAttribute::SetRightVerticalDisplayed(const bool isDisplayed) noexcept
|
||||
WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_GRID_RVERTICAL, isDisplayed);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsBold() const noexcept
|
||||
void TextAttribute::Embolden() noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Bold);
|
||||
_SetBoldness(true);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsItalic() const noexcept
|
||||
void TextAttribute::Debolden() noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Italics);
|
||||
_SetBoldness(false);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsBlinking() const noexcept
|
||||
void TextAttribute::SetExtendedAttributes(const ExtendedAttributes attrs) noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Blinking);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsInvisible() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Invisible);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsCrossedOut() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::CrossedOut);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsUnderlined() const noexcept
|
||||
{
|
||||
// TODO:GH#2915 Treat underline separately from LVB_UNDERSCORE
|
||||
return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_UNDERSCORE);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsReverseVideo() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO);
|
||||
}
|
||||
|
||||
void TextAttribute::SetBold(bool isBold) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Bold, isBold);
|
||||
}
|
||||
|
||||
void TextAttribute::SetItalics(bool isItalic) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Italics, isItalic);
|
||||
}
|
||||
|
||||
void TextAttribute::SetBlinking(bool isBlinking) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Blinking, isBlinking);
|
||||
}
|
||||
|
||||
void TextAttribute::SetInvisible(bool isInvisible) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Invisible, isInvisible);
|
||||
}
|
||||
|
||||
void TextAttribute::SetCrossedOut(bool isCrossedOut) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::CrossedOut, isCrossedOut);
|
||||
}
|
||||
|
||||
void TextAttribute::SetUnderline(bool isUnderlined) noexcept
|
||||
{
|
||||
// TODO:GH#2915 Treat underline separately from LVB_UNDERSCORE
|
||||
WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_UNDERSCORE, isUnderlined);
|
||||
}
|
||||
|
||||
void TextAttribute::SetReverseVideo(bool isReversed) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO, isReversed);
|
||||
}
|
||||
|
||||
ExtendedAttributes TextAttribute::GetExtendedAttributes() const noexcept
|
||||
{
|
||||
return _extendedAttrs;
|
||||
_extendedAttrs = attrs;
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
@@ -216,6 +217,11 @@ void TextAttribute::Invert() noexcept
|
||||
WI_ToggleFlag(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO);
|
||||
}
|
||||
|
||||
void TextAttribute::_SetBoldness(const bool isBold) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Bold, isBold);
|
||||
}
|
||||
|
||||
void TextAttribute::SetDefaultForeground() noexcept
|
||||
{
|
||||
_foreground = TextColor();
|
||||
@@ -261,6 +267,6 @@ bool TextAttribute::BackgroundIsDefault() const noexcept
|
||||
// requires for most erasing and filling operations.
|
||||
void TextAttribute::SetStandardErase() noexcept
|
||||
{
|
||||
_extendedAttrs = ExtendedAttributes::Normal;
|
||||
_wAttrLegacy = 0;
|
||||
SetExtendedAttributes(ExtendedAttributes::Normal);
|
||||
SetMetaAttributes(0);
|
||||
}
|
||||
|
||||
@@ -107,6 +107,22 @@ public:
|
||||
void SetLeftVerticalDisplayed(const bool isDisplayed) noexcept;
|
||||
void SetRightVerticalDisplayed(const bool isDisplayed) noexcept;
|
||||
|
||||
void SetFromLegacy(const WORD wLegacy) noexcept;
|
||||
|
||||
void SetLegacyAttributes(const WORD attrs,
|
||||
const bool setForeground,
|
||||
const bool setBackground,
|
||||
const bool setMeta) noexcept;
|
||||
|
||||
void SetIndexedAttributes(const std::optional<const BYTE> foreground,
|
||||
const std::optional<const BYTE> background) noexcept;
|
||||
|
||||
void SetMetaAttributes(const WORD wMeta) noexcept;
|
||||
WORD GetMetaAttributes() const noexcept;
|
||||
|
||||
void Embolden() noexcept;
|
||||
void Debolden() noexcept;
|
||||
|
||||
void Invert() noexcept;
|
||||
|
||||
friend constexpr bool operator==(const TextAttribute& a, const TextAttribute& b) noexcept;
|
||||
@@ -117,28 +133,21 @@ public:
|
||||
friend constexpr bool operator!=(const WORD& legacyAttr, const TextAttribute& attr) noexcept;
|
||||
|
||||
bool IsLegacy() const noexcept;
|
||||
bool IsBold() const noexcept;
|
||||
bool IsItalic() const noexcept;
|
||||
bool IsBlinking() const noexcept;
|
||||
bool IsInvisible() const noexcept;
|
||||
bool IsCrossedOut() const noexcept;
|
||||
bool IsUnderlined() const noexcept;
|
||||
bool IsReverseVideo() const noexcept;
|
||||
|
||||
void SetBold(bool isBold) noexcept;
|
||||
void SetItalics(bool isItalic) noexcept;
|
||||
void SetBlinking(bool isBlinking) noexcept;
|
||||
void SetInvisible(bool isInvisible) noexcept;
|
||||
void SetCrossedOut(bool isCrossedOut) noexcept;
|
||||
void SetUnderline(bool isUnderlined) noexcept;
|
||||
void SetReverseVideo(bool isReversed) noexcept;
|
||||
constexpr bool IsBold() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Bold);
|
||||
}
|
||||
|
||||
ExtendedAttributes GetExtendedAttributes() const noexcept;
|
||||
constexpr ExtendedAttributes GetExtendedAttributes() const noexcept
|
||||
{
|
||||
return _extendedAttrs;
|
||||
}
|
||||
|
||||
void SetExtendedAttributes(const ExtendedAttributes attrs) noexcept;
|
||||
|
||||
void SetForeground(const COLORREF rgbForeground) noexcept;
|
||||
void SetBackground(const COLORREF rgbBackground) noexcept;
|
||||
void SetIndexedForeground(const BYTE fgIndex) noexcept;
|
||||
void SetIndexedBackground(const BYTE bgIndex) noexcept;
|
||||
void SetColor(const COLORREF rgbColor, const bool fIsForeground) noexcept;
|
||||
|
||||
void SetDefaultForeground() noexcept;
|
||||
@@ -156,13 +165,13 @@ public:
|
||||
|
||||
// This returns whether this attribute, if printed directly next to another attribute, for the space
|
||||
// character, would look identical to the other one.
|
||||
bool HasIdenticalVisualRepresentationForBlankSpace(const TextAttribute& other, const bool inverted = false) const noexcept
|
||||
constexpr bool HasIdenticalVisualRepresentationForBlankSpace(const TextAttribute& other, const bool inverted = false) const noexcept
|
||||
{
|
||||
// sneaky-sneaky: I'm using xor here
|
||||
// inverted is whether there's a global invert; Reverse is a local one.
|
||||
// global ^ local == true : the background attribute is actually the visible foreground, so we care about the foregrounds being identical
|
||||
// global ^ local == false: the foreground attribute is the visible foreground, so we care about the backgrounds being identical
|
||||
const auto checkForeground = (inverted != IsReverseVideo());
|
||||
const auto checkForeground = (inverted != _IsReverseVideo());
|
||||
return !IsAnyGridLineEnabled() && // grid lines have a visual representation
|
||||
// crossed out, doubly and singly underlined have a visual representation
|
||||
WI_AreAllFlagsClear(_extendedAttrs, ExtendedAttributes::CrossedOut | ExtendedAttributes::DoublyUnderlined | ExtendedAttributes::Underlined) &&
|
||||
@@ -184,6 +193,13 @@ private:
|
||||
COLORREF _GetRgbBackground(std::basic_string_view<COLORREF> colorTable,
|
||||
COLORREF defaultColor) const noexcept;
|
||||
|
||||
constexpr bool _IsReverseVideo() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO);
|
||||
}
|
||||
|
||||
void _SetBoldness(const bool isBold) noexcept;
|
||||
|
||||
WORD _wAttrLegacy;
|
||||
TextColor _foreground;
|
||||
TextColor _background;
|
||||
|
||||
@@ -45,3 +45,14 @@ void TextAttributeRun::SetAttributes(const TextAttribute textAttribute) noexcept
|
||||
{
|
||||
_attributes = textAttribute;
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
// - Sets the attributes of this run to the given legacy attributes
|
||||
// Arguments:
|
||||
// - wNew - the new value for this run's attributes
|
||||
// Return Value:
|
||||
// <none>
|
||||
void TextAttributeRun::SetAttributesFromLegacy(const WORD wNew) noexcept
|
||||
{
|
||||
_attributes.SetFromLegacy(wNew);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public:
|
||||
|
||||
const TextAttribute& GetAttributes() const noexcept;
|
||||
void SetAttributes(const TextAttribute textAttribute) noexcept;
|
||||
void SetAttributesFromLegacy(const WORD wNew) noexcept;
|
||||
|
||||
private:
|
||||
size_t _cchLength;
|
||||
|
||||
@@ -138,7 +138,7 @@ void TextAttributeTests::TestTextAttributeColorGetters()
|
||||
|
||||
// verify that calculated foreground/background are the same as the direct
|
||||
// values when reverse video is not set
|
||||
VERIFY_IS_FALSE(attr.IsReverseVideo());
|
||||
VERIFY_IS_FALSE(attr._IsReverseVideo());
|
||||
|
||||
VERIFY_ARE_EQUAL(red, attr._GetRgbForeground(view, _defaultFg));
|
||||
VERIFY_ARE_EQUAL(red, attr.CalculateRgbForeground(view, _defaultFg, _defaultBg));
|
||||
@@ -148,7 +148,7 @@ void TextAttributeTests::TestTextAttributeColorGetters()
|
||||
|
||||
// with reverse video set, calculated foreground/background values should be
|
||||
// switched while getters stay the same
|
||||
attr.SetReverseVideo(true);
|
||||
attr.SetMetaAttributes(COMMON_LVB_REVERSE_VIDEO);
|
||||
|
||||
VERIFY_ARE_EQUAL(red, attr._GetRgbForeground(view, _defaultFg));
|
||||
VERIFY_ARE_EQUAL(green, attr.CalculateRgbForeground(view, _defaultFg, _defaultBg));
|
||||
@@ -166,7 +166,7 @@ void TextAttributeTests::TestReverseDefaultColors()
|
||||
|
||||
// verify that calculated foreground/background are the same as the direct
|
||||
// values when reverse video is not set
|
||||
VERIFY_IS_FALSE(attr.IsReverseVideo());
|
||||
VERIFY_IS_FALSE(attr._IsReverseVideo());
|
||||
|
||||
VERIFY_ARE_EQUAL(_defaultFg, attr._GetRgbForeground(view, _defaultFg));
|
||||
VERIFY_ARE_EQUAL(_defaultFg, attr.CalculateRgbForeground(view, _defaultFg, _defaultBg));
|
||||
@@ -176,8 +176,8 @@ void TextAttributeTests::TestReverseDefaultColors()
|
||||
|
||||
// with reverse video set, calculated foreground/background values should be
|
||||
// switched while getters stay the same
|
||||
attr.SetReverseVideo(true);
|
||||
VERIFY_IS_TRUE(attr.IsReverseVideo());
|
||||
attr.SetMetaAttributes(COMMON_LVB_REVERSE_VIDEO);
|
||||
VERIFY_IS_TRUE(attr._IsReverseVideo());
|
||||
|
||||
VERIFY_ARE_EQUAL(_defaultFg, attr._GetRgbForeground(view, _defaultFg));
|
||||
VERIFY_ARE_EQUAL(_defaultBg, attr.CalculateRgbForeground(view, _defaultFg, _defaultBg));
|
||||
@@ -186,7 +186,7 @@ void TextAttributeTests::TestReverseDefaultColors()
|
||||
VERIFY_ARE_EQUAL(_defaultFg, attr.CalculateRgbBackground(view, _defaultFg, _defaultBg));
|
||||
|
||||
attr.SetForeground(red);
|
||||
VERIFY_IS_TRUE(attr.IsReverseVideo());
|
||||
VERIFY_IS_TRUE(attr._IsReverseVideo());
|
||||
|
||||
VERIFY_ARE_EQUAL(red, attr._GetRgbForeground(view, _defaultFg));
|
||||
VERIFY_ARE_EQUAL(_defaultBg, attr.CalculateRgbForeground(view, _defaultFg, _defaultBg));
|
||||
@@ -195,7 +195,7 @@ void TextAttributeTests::TestReverseDefaultColors()
|
||||
VERIFY_ARE_EQUAL(red, attr.CalculateRgbBackground(view, _defaultFg, _defaultBg));
|
||||
|
||||
attr.Invert();
|
||||
VERIFY_IS_FALSE(attr.IsReverseVideo());
|
||||
VERIFY_IS_FALSE(attr._IsReverseVideo());
|
||||
attr.SetDefaultForeground();
|
||||
attr.SetBackground(green);
|
||||
|
||||
|
||||
@@ -783,7 +783,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
VERIFY_IS_FALSE(profile0._guid.has_value());
|
||||
|
||||
const auto serialized0Profile = profile0.GenerateStub();
|
||||
const auto serialized0Profile = profile0.ToJson();
|
||||
const auto profile1 = Profile::FromJson(serialized0Profile);
|
||||
VERIFY_IS_FALSE(profile0._guid.has_value());
|
||||
VERIFY_ARE_EQUAL(profile1._guid.has_value(), profile0._guid.has_value());
|
||||
@@ -794,7 +794,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
VERIFY_IS_TRUE(settings._profiles.at(0)._guid.has_value());
|
||||
|
||||
const auto serialized1Profile = settings._profiles.at(0).GenerateStub();
|
||||
const auto serialized1Profile = settings._profiles.at(0).ToJson();
|
||||
|
||||
const auto profile2 = Profile::FromJson(serialized1Profile);
|
||||
VERIFY_IS_TRUE(settings._profiles.at(0)._guid.has_value());
|
||||
|
||||
@@ -17,7 +17,6 @@ using namespace winrt::TerminalApp;
|
||||
using namespace WEX::Logging;
|
||||
using namespace WEX::TestExecution;
|
||||
using namespace WEX::Common;
|
||||
using namespace winrt::Windows::ApplicationModel::DataTransfer;
|
||||
|
||||
namespace TerminalAppLocalTests
|
||||
{
|
||||
|
||||
@@ -39,8 +39,6 @@ Author(s):
|
||||
#include "../../types/inc/utils.hpp"
|
||||
#include "../../inc/DefaultSettings.h"
|
||||
|
||||
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
||||
#include "winrt/Windows.UI.Xaml.Markup.h"
|
||||
#include <winrt/Windows.system.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "AppLogic.h"
|
||||
#include "AppCommandlineArgs.h"
|
||||
#include "ActionArgs.h"
|
||||
#include <LibraryResources.h>
|
||||
@@ -141,11 +140,6 @@ int AppCommandlineArgs::_handleExit(const CLI::App& command, const CLI::Error& e
|
||||
{
|
||||
_exitMessage = err.str();
|
||||
}
|
||||
|
||||
// We're displaying an error message - we should always exit instead of
|
||||
// actually starting the Terminal.
|
||||
_shouldExitEarly = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -157,22 +151,6 @@ int AppCommandlineArgs::_handleExit(const CLI::App& command, const CLI::Error& e
|
||||
// - <none>
|
||||
void AppCommandlineArgs::_buildParser()
|
||||
{
|
||||
auto versionCallback = [this](int64_t /*count*/) {
|
||||
if (const auto appLogic{ winrt::TerminalApp::implementation::AppLogic::Current() })
|
||||
{
|
||||
// Set our message to display the application name and the current version.
|
||||
_exitMessage = fmt::format("{0}\n{1}",
|
||||
til::u16u8(appLogic->ApplicationDisplayName()),
|
||||
til::u16u8(appLogic->ApplicationVersion()));
|
||||
// Theoretically, we don't need to exit now, since this isn't really
|
||||
// an error case. However, in practice, it feels weird to have `wt
|
||||
// -v` open a new tab, and makes enough sense that `wt -v ;
|
||||
// split-pane` (or whatever) just displays the version and exits.
|
||||
_shouldExitEarly = true;
|
||||
}
|
||||
};
|
||||
_app.add_flag_function("-v,--version", versionCallback, RS_A(L"CmdVersionDesc"));
|
||||
|
||||
_buildNewTabParser();
|
||||
_buildSplitPaneParser();
|
||||
_buildFocusTabParser();
|
||||
@@ -562,19 +540,6 @@ const std::string& AppCommandlineArgs::GetExitMessage()
|
||||
return _exitMessage;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns true if we should exit the application before even starting the
|
||||
// window. We might want to do this if we're displaying an error message or
|
||||
// the version string, or if we want to open the settings file.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - true iff we should exit the application before even starting the window
|
||||
bool AppCommandlineArgs::ShouldExitEarly() const noexcept
|
||||
{
|
||||
return _shouldExitEarly;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Ensure that the first command in our list of actions is a NewTab action.
|
||||
// This makes sure that if the user passes a commandline like "wt split-pane
|
||||
|
||||
@@ -36,7 +36,6 @@ public:
|
||||
void ValidateStartupCommands();
|
||||
std::deque<winrt::TerminalApp::ActionAndArgs>& GetStartupActions();
|
||||
const std::string& GetExitMessage();
|
||||
bool ShouldExitEarly() const noexcept;
|
||||
|
||||
private:
|
||||
static const std::wregex _commandDelimiterRegex;
|
||||
@@ -80,7 +79,6 @@ private:
|
||||
|
||||
std::deque<winrt::TerminalApp::ActionAndArgs> _startupActions;
|
||||
std::string _exitMessage;
|
||||
bool _shouldExitEarly{ false };
|
||||
|
||||
winrt::TerminalApp::NewTerminalArgs _getNewTerminalArgs(NewTerminalSubcommand& subcommand);
|
||||
void _addNewTerminalArgs(NewTerminalSubcommand& subcommand);
|
||||
|
||||
@@ -902,24 +902,15 @@ namespace winrt::TerminalApp::implementation
|
||||
return 0;
|
||||
}
|
||||
|
||||
winrt::hstring AppLogic::ParseCommandlineMessage()
|
||||
winrt::hstring AppLogic::EarlyExitMessage()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
return _root->ParseCommandlineMessage();
|
||||
return _root->EarlyExitMessage();
|
||||
}
|
||||
return { L"" };
|
||||
}
|
||||
|
||||
bool AppLogic::ShouldExitEarly()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
return _root->ShouldExitEarly();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
winrt::hstring AppLogic::ApplicationDisplayName() const
|
||||
{
|
||||
try
|
||||
|
||||
@@ -28,8 +28,7 @@ namespace winrt::TerminalApp::implementation
|
||||
[[nodiscard]] std::shared_ptr<::TerminalApp::CascadiaSettings> GetSettings() const noexcept;
|
||||
|
||||
int32_t SetStartupCommandline(array_view<const winrt::hstring> actions);
|
||||
winrt::hstring ParseCommandlineMessage();
|
||||
bool ShouldExitEarly();
|
||||
winrt::hstring EarlyExitMessage();
|
||||
|
||||
winrt::hstring ApplicationDisplayName() const;
|
||||
winrt::hstring ApplicationVersion() const;
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace TerminalApp
|
||||
MaximizedMode,
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass AppLogic : IF7Listener
|
||||
{
|
||||
[default_interface] runtimeclass AppLogic: IF7Listener {
|
||||
AppLogic();
|
||||
|
||||
// For your own sanity, it's better to do setup outside the ctor.
|
||||
@@ -29,8 +28,7 @@ namespace TerminalApp
|
||||
Boolean IsElevated();
|
||||
|
||||
Int32 SetStartupCommandline(String[] commands);
|
||||
String ParseCommandlineMessage { get; };
|
||||
Boolean ShouldExitEarly { get; };
|
||||
String EarlyExitMessage { get; };
|
||||
|
||||
void LoadSettings();
|
||||
Windows.UI.Xaml.UIElement GetRoot();
|
||||
|
||||
@@ -1,269 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "ColorHelper.h"
|
||||
#include <limits>
|
||||
|
||||
using namespace winrt::TerminalApp;
|
||||
|
||||
// Method Description:
|
||||
// Determines whether or not a given color is light
|
||||
// Arguments:
|
||||
// - color: this color is going to be examined whether it
|
||||
// is light or not
|
||||
// Return Value:
|
||||
// - true of light, false if dark
|
||||
bool ColorHelper::IsBrightColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
// https://www.w3.org/TR/AERT#color-contrast
|
||||
auto brightness = (color.R * 299 + color.G * 587 + color.B * 114) / 1000.f;
|
||||
return brightness > 128.f;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Converts a rgb color to an hsl one
|
||||
// Arguments:
|
||||
// - color: the rgb color, which is going to be converted
|
||||
// Return Value:
|
||||
// - a hsl color with the following ranges
|
||||
// - H: [0.f -360.f]
|
||||
// - L: [0.f - 1.f] (rounded to the third decimal place)
|
||||
// - S: [0.f - 1.f] (rounded to the third decimal place)
|
||||
HSL ColorHelper::RgbToHsl(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
// https://www.rapidtables.com/convert/color/rgb-to-hsl.html
|
||||
auto epsilon = std::numeric_limits<float>::epsilon();
|
||||
auto r = color.R / 255.f;
|
||||
auto g = color.G / 255.f;
|
||||
auto b = color.B / 255.f;
|
||||
|
||||
auto max = std::max(r, std::max(g, b));
|
||||
auto min = std::min(r, std::min(g, b));
|
||||
|
||||
auto delta = max - min;
|
||||
|
||||
auto h = 0.f;
|
||||
auto s = 0.f;
|
||||
auto l = (max + min) / 2;
|
||||
|
||||
if (delta < epsilon || max < epsilon) /* delta == 0 || max == 0*/
|
||||
{
|
||||
l = std::roundf(l * 1000) / 1000;
|
||||
return HSL{ h, s, l };
|
||||
}
|
||||
|
||||
s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
||||
|
||||
if (max - r < epsilon) // max == r
|
||||
{
|
||||
h = (g - b) / delta + (g < b ? 6 : 0);
|
||||
}
|
||||
else if (max - g < epsilon) // max == g
|
||||
{
|
||||
h = (b - r) / delta + 2;
|
||||
}
|
||||
else if (max - b < epsilon) // max == b
|
||||
{
|
||||
h = (r - g) / delta + 4;
|
||||
}
|
||||
|
||||
// three decimal places after the comma ought
|
||||
// to be enough for everybody - Bill Gates, 1981
|
||||
float finalH = std::roundf(h * 60);
|
||||
float finalS = std::roundf(s * 1000) / 1000;
|
||||
float finalL = std::roundf(l * 1000) / 1000;
|
||||
|
||||
return HSL{ finalH, finalS, finalL };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Converts a hsl color to rgb one
|
||||
// Arguments:
|
||||
// - color: the hsl color, which is going to be converted
|
||||
// Return Value:
|
||||
// - the rgb color (r,g,b - [0, 255] range)
|
||||
winrt::Windows::UI::Color ColorHelper::HslToRgb(const HSL& color)
|
||||
{
|
||||
auto epsilon = std::numeric_limits<float>::epsilon();
|
||||
|
||||
auto h = (color.H - 1.f > epsilon) ? color.H / 360.f : color.H;
|
||||
auto s = (color.S - 1.f > epsilon) ? color.S / 100.f : color.S;
|
||||
auto l = (color.L - 1.f > epsilon) ? color.L / 100.f : color.L;
|
||||
|
||||
auto r = l;
|
||||
auto g = l;
|
||||
auto b = l;
|
||||
|
||||
if (s > epsilon)
|
||||
{
|
||||
auto q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
||||
auto p = 2 * l - q;
|
||||
r = HueToRgb(p, q, h + 1.f / 3.f);
|
||||
g = HueToRgb(p, q, h);
|
||||
b = HueToRgb(p, q, h - 1.f / 3.f);
|
||||
}
|
||||
|
||||
auto finalR = static_cast<uint8_t>(std::roundf(r * 255));
|
||||
auto finalG = static_cast<uint8_t>(std::roundf(g * 255));
|
||||
auto finalB = static_cast<uint8_t>(std::roundf(b * 255));
|
||||
uint8_t finalA = 255; //opaque
|
||||
|
||||
return winrt::Windows::UI::ColorHelper::FromArgb(finalA, finalR, finalG, finalB);
|
||||
}
|
||||
|
||||
float ColorHelper::HueToRgb(float p, float q, float t)
|
||||
{
|
||||
auto epsilon = std::numeric_limits<float>::epsilon();
|
||||
|
||||
if (t < 0)
|
||||
t += 1;
|
||||
if (t > 1)
|
||||
t -= 1;
|
||||
if (t - (1.f / 6.f) < epsilon)
|
||||
return p + (q - p) * 6 * t;
|
||||
if (t - .5f < epsilon)
|
||||
return q;
|
||||
if (t - 2.f / 3.f < epsilon)
|
||||
return p + (q - p) * (2.f / 3.f - t) * 6;
|
||||
return p;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Lightens a color by a given amount
|
||||
// Arguments:
|
||||
// - color: the color which is going to be lightened
|
||||
// - amount: the lighten amount (0-100)
|
||||
// Return Value:
|
||||
// - the lightened color in RGB format
|
||||
winrt::Windows::UI::Color ColorHelper::Lighten(const winrt::Windows::UI::Color& color, float amount /* = 10.f*/)
|
||||
{
|
||||
auto hsl = RgbToHsl(color);
|
||||
hsl.L += amount / 100;
|
||||
hsl.L = std::clamp(hsl.L, 0.f, 1.f);
|
||||
return HslToRgb(hsl);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Darkens a color by a given amount
|
||||
// Arguments:
|
||||
// - color: the color which is going to be darkened
|
||||
// - amount: the darken amount (0-100)
|
||||
// Return Value:
|
||||
// - the darkened color in RGB format
|
||||
winrt::Windows::UI::Color ColorHelper::Darken(const winrt::Windows::UI::Color& color, float amount /* = 10.f*/)
|
||||
{
|
||||
auto hsl = RgbToHsl(color);
|
||||
hsl.L -= amount / 100;
|
||||
hsl.L = std::clamp(hsl.L, 0.f, 1.f);
|
||||
return HslToRgb(hsl);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Gets an accent color to a given color. Basically, generates
|
||||
// 16 shades of the color and finds the first which has a good
|
||||
// contrast according to https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
||||
// Readability ratio of 3.5 seems to look quite nicely
|
||||
// Arguments:
|
||||
// - color: the color for which we need an accent
|
||||
// Return Value:
|
||||
// - the accent color in RGB format
|
||||
winrt::Windows::UI::Color ColorHelper::GetAccentColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
auto accentColor = RgbToHsl(color);
|
||||
|
||||
if (accentColor.S < 0.15)
|
||||
{
|
||||
accentColor.S = 0.15f;
|
||||
}
|
||||
|
||||
constexpr auto shadeCount = 16;
|
||||
constexpr auto shadeStep = 1.f / shadeCount;
|
||||
auto shades = std::map<float, HSL>();
|
||||
for (auto i = 0; i < 15; i++)
|
||||
{
|
||||
auto shade = HSL{ accentColor.H, accentColor.S, i * shadeStep };
|
||||
auto contrast = GetReadability(shade, accentColor);
|
||||
shades.insert(std::make_pair(contrast, shade));
|
||||
}
|
||||
|
||||
// 3f is quite nice if the whole non-client area is painted
|
||||
constexpr auto readability = 1.75f;
|
||||
for (auto shade : shades)
|
||||
{
|
||||
if (shade.first >= readability)
|
||||
{
|
||||
return HslToRgb(shade.second);
|
||||
}
|
||||
}
|
||||
return HslToRgb(shades.end()->second);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Gets the readability of two colors according to
|
||||
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
||||
// Arguments:
|
||||
// - firstColor: the first color for the readability check (hsl)
|
||||
// - secondColor: the second color for the readability check (hsl)
|
||||
// Return Value:
|
||||
// - the readability of the colors according to (WCAG Version 2)
|
||||
float ColorHelper::GetReadability(const HSL& first, const HSL& second)
|
||||
{
|
||||
return GetReadability(HslToRgb(first), HslToRgb(second));
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Gets the readability of two colors according to
|
||||
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
||||
// Arguments:
|
||||
// - firstColor: the first color for the readability check (rgb)
|
||||
// - secondColor: the second color for the readability check (rgb)
|
||||
// Return Value:
|
||||
// - the readability of the colors according to (WCAG Version 2)
|
||||
float ColorHelper::GetReadability(const winrt::Windows::UI::Color& first, const winrt::Windows::UI::Color& second)
|
||||
{
|
||||
auto l1 = GetLuminance(first);
|
||||
auto l2 = GetLuminance(second);
|
||||
|
||||
return (std::max(l1, l2) + 0.05f) / std::min(l1, l2) + 0.05f;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Calculates the luminance of a given color according to
|
||||
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
||||
// Arguments:
|
||||
// - color: its luminance is going to be calculated
|
||||
// Return Value:
|
||||
// - the luminance of the color
|
||||
float ColorHelper::GetLuminance(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
auto epsilon = std::numeric_limits<float>::epsilon();
|
||||
float R, G, B;
|
||||
auto RsRGB = color.R / 255.f;
|
||||
auto GsRGB = color.G / 255.f;
|
||||
auto BsRGB = color.B / 255.f;
|
||||
|
||||
if (RsRGB - 0.03928f <= epsilon)
|
||||
{
|
||||
R = RsRGB / 12.92f;
|
||||
}
|
||||
else
|
||||
{
|
||||
R = std::pow(((RsRGB + 0.055f) / 1.055f), 2.4f);
|
||||
}
|
||||
if (GsRGB - 0.03928f <= epsilon)
|
||||
{
|
||||
G = GsRGB / 12.92f;
|
||||
}
|
||||
else
|
||||
{
|
||||
G = std::pow(((GsRGB + 0.055f) / 1.055f), 2.4f);
|
||||
}
|
||||
if (BsRGB - 0.03928f <= epsilon)
|
||||
{
|
||||
B = BsRGB / 12.92f;
|
||||
}
|
||||
else
|
||||
{
|
||||
B = std::pow(((BsRGB + 0.055f) / 1.055f), 2.4f);
|
||||
}
|
||||
float luminance = (0.2126f * R) + (0.7152f * G) + (0.0722f * B);
|
||||
return std::roundf(luminance * 10000) / 10000.f;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
#include <winrt/windows.ui.core.h>
|
||||
|
||||
namespace winrt::TerminalApp
|
||||
{
|
||||
class HSL
|
||||
{
|
||||
public:
|
||||
float H;
|
||||
float S;
|
||||
float L;
|
||||
};
|
||||
|
||||
class ColorHelper
|
||||
{
|
||||
public:
|
||||
static bool IsBrightColor(const Windows::UI::Color& color);
|
||||
static HSL RgbToHsl(const Windows::UI::Color& color);
|
||||
static Windows::UI::Color HslToRgb(const HSL& color);
|
||||
static Windows::UI::Color Lighten(const Windows::UI::Color& color, float amount = 10.f);
|
||||
static Windows::UI::Color Darken(const Windows::UI::Color& color, float amount = 10.f);
|
||||
static Windows::UI::Color GetAccentColor(const Windows::UI::Color& color);
|
||||
static float GetLuminance(const Windows::UI::Color& color);
|
||||
static float GetReadability(const Windows::UI::Color& first, const Windows::UI::Color& second);
|
||||
static float GetReadability(const HSL& first, const HSL& second);
|
||||
|
||||
private:
|
||||
static float HueToRgb(float p, float q, float t);
|
||||
};
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "ColorPickupFlyout.g.cpp"
|
||||
#include "winrt/Windows.UI.Xaml.Media.h"
|
||||
#include "winrt/Windows.UI.Xaml.Shapes.h"
|
||||
#include "winrt/Windows.UI.Xaml.Interop.h"
|
||||
#include <LibraryResources.h>
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Default constructor, localizes the buttons and hooks
|
||||
// up the event fired by the custom color picker, so that
|
||||
// the tab color is set on the fly when selecting a non-preset color
|
||||
// Arguments:
|
||||
// - <none>
|
||||
ColorPickupFlyout::ColorPickupFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
OkButton().Content(winrt::box_value(RS_(L"Ok")));
|
||||
CustomColorButton().Content(winrt::box_value(RS_(L"TabColorCustomButton/Content")));
|
||||
ClearColorButton().Content(winrt::box_value(RS_(L"TabColorClearButton/Content")));
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Handler of the click event for the preset color swatches.
|
||||
// Reads the color from the clicked rectangle and fires an event
|
||||
// with the selected color. After that hides the flyout
|
||||
// Arguments:
|
||||
// - sender: the rectangle that got clicked
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ColorPickupFlyout::ColorButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
auto button{ sender.as<Windows::UI::Xaml::Controls::Button>() };
|
||||
auto rectangle{ button.Content().as<Windows::UI::Xaml::Shapes::Rectangle>() };
|
||||
auto rectClr{ rectangle.Fill().as<Windows::UI::Xaml::Media::SolidColorBrush>() };
|
||||
_ColorSelectedHandlers(rectClr.Color());
|
||||
Hide();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Handler of the clear color button. Clears the current
|
||||
// color of the tab, if any. Hides the flyout after that
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ColorPickupFlyout::ClearColorButton_Click(IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
_ColorClearedHandlers();
|
||||
Hide();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Handler of the select custom color button. Expands or collapses the flyout
|
||||
// to show the color picker. In order to accomplish this a FlyoutPresenterStyle is used,
|
||||
// in which a Style is embedded, containing the desired width
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ColorPickupFlyout::ShowColorPickerButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
auto targetType = this->FlyoutPresenterStyle().TargetType();
|
||||
auto s = Windows::UI::Xaml::Style{};
|
||||
s.TargetType(targetType);
|
||||
auto visibility = customColorPanel().Visibility();
|
||||
if (visibility == winrt::Windows::UI::Xaml::Visibility::Collapsed)
|
||||
{
|
||||
customColorPanel().Visibility(winrt::Windows::UI::Xaml::Visibility::Visible);
|
||||
auto setter = Windows::UI::Xaml::Setter(Windows::UI::Xaml::FrameworkElement::MinWidthProperty(), winrt::box_value(540));
|
||||
s.Setters().Append(setter);
|
||||
}
|
||||
else
|
||||
{
|
||||
customColorPanel().Visibility(winrt::Windows::UI::Xaml::Visibility::Collapsed);
|
||||
auto setter = Windows::UI::Xaml::Setter(Windows::UI::Xaml::FrameworkElement::MinWidthProperty(), winrt::box_value(0));
|
||||
s.Setters().Append(setter);
|
||||
}
|
||||
this->FlyoutPresenterStyle(s);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Handles the color selection of the color pickup. Gets
|
||||
// the currently selected color and fires an event with it
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ColorPickupFlyout::CustomColorButton_Click(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
auto color = customColorPicker().Color();
|
||||
_ColorSelectedHandlers(color);
|
||||
Hide();
|
||||
}
|
||||
|
||||
void ColorPickupFlyout::ColorPicker_ColorChanged(const Windows::UI::Xaml::Controls::ColorPicker&, const Windows::UI::Xaml::Controls::ColorChangedEventArgs& args)
|
||||
{
|
||||
_ColorSelectedHandlers(args.NewColor());
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
#include "ColorPickupFlyout.g.h"
|
||||
#include "../cascadia/inc/cppwinrt_utils.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout>
|
||||
{
|
||||
ColorPickupFlyout();
|
||||
|
||||
void ColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void ShowColorPickerButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void CustomColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void ClearColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void ColorPicker_ColorChanged(const Windows::UI::Xaml::Controls::ColorPicker&, const Windows::UI::Xaml::Controls::ColorChangedEventArgs& args);
|
||||
|
||||
WINRT_CALLBACK(ColorCleared, TerminalApp::ColorClearedArgs);
|
||||
WINRT_CALLBACK(ColorSelected, TerminalApp::ColorSelectedArgs);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
{
|
||||
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout, implementation::ColorPickupFlyout>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace TerminalApp
|
||||
{
|
||||
delegate void ColorSelectedArgs(Windows.UI.Color color);
|
||||
delegate void ColorClearedArgs();
|
||||
|
||||
[default_interface] runtimeclass ColorPickupFlyout : Windows.UI.Xaml.Controls.Flyout
|
||||
{
|
||||
ColorPickupFlyout();
|
||||
event ColorSelectedArgs ColorSelected;
|
||||
event ColorClearedArgs ColorCleared;
|
||||
}
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
<Flyout
|
||||
x:Class="TerminalApp.ColorPickupFlyout"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel>
|
||||
<VariableSizedWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="4" HorizontalAlignment="Center" Margin="0, 3, 0, 0">
|
||||
<VariableSizedWrapGrid.Resources>
|
||||
<Style TargetType="Rectangle">
|
||||
<Setter Property="Width" Value="30"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
</Style>
|
||||
</VariableSizedWrapGrid.Resources>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Crimson">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Crimson"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="SteelBlue">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SteelBlue"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="MediumSeaGreen">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="MediumSeaGreen"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="DarkOrange">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DarkOrange"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="MediumVioletRed">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="MediumVioletRed"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="DodgerBlue">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DodgerBlue"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="LimeGreen">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="LimeGreen"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Yellow">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Yellow"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="BlueViolet">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="BlueViolet"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="SlateBlue">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SlateBlue"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Lime">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Lime"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Tan">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Tan"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Magenta">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Magenta"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="Cyan">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Cyan"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="SkyBlue">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SkyBlue"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Click="ColorButton_Click" AutomationProperties.Name="DarkGray">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DarkGray"/>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</VariableSizedWrapGrid>
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<Button Padding="5"
|
||||
Click="ClearColorButton_Click"
|
||||
x:Name="ClearColorButton" x:Uid="TabColorClearButton" Content="Reset">
|
||||
</Button>
|
||||
<Button Padding="5"
|
||||
Click="ShowColorPickerButton_Click"
|
||||
x:Name="CustomColorButton" x:Uid="TabColorCustomButton" Content="Custom...">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid Visibility="Collapsed" x:Name="customColorPanel" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ColorPicker x:Name="customColorPicker"
|
||||
IsMoreButtonVisible="True"
|
||||
IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="True"
|
||||
IsHexInputVisible="True"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="False"
|
||||
IsAlphaTextInputVisible="False"
|
||||
FontSize="10"
|
||||
Grid.Row="0"
|
||||
ColorChanged="ColorPicker_ColorChanged"
|
||||
>
|
||||
</ColorPicker>
|
||||
<Button x:Name="OkButton" Click="CustomColorButton_Click" Grid.Row="1" HorizontalAlignment="Center" MinWidth="130" MinHeight="12" Margin="0, 5, 0, 0" x:Uid="OkButton" Content="**OK**"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
@@ -47,7 +47,7 @@ ColorScheme::ColorScheme() :
|
||||
{
|
||||
}
|
||||
|
||||
ColorScheme::ColorScheme(std::wstring name, til::color defaultFg, til::color defaultBg, til::color cursorColor) :
|
||||
ColorScheme::ColorScheme(std::wstring name, COLORREF defaultFg, COLORREF defaultBg, COLORREF cursorColor) :
|
||||
_schemeName{ name },
|
||||
_table{},
|
||||
_defaultForeground{ defaultFg },
|
||||
@@ -70,18 +70,44 @@ ColorScheme::~ColorScheme()
|
||||
// - <none>
|
||||
void ColorScheme::ApplyScheme(TerminalSettings terminalSettings) const
|
||||
{
|
||||
terminalSettings.DefaultForeground(static_cast<COLORREF>(_defaultForeground));
|
||||
terminalSettings.DefaultBackground(static_cast<COLORREF>(_defaultBackground));
|
||||
terminalSettings.SelectionBackground(static_cast<COLORREF>(_selectionBackground));
|
||||
terminalSettings.CursorColor(static_cast<COLORREF>(_cursorColor));
|
||||
terminalSettings.DefaultForeground(_defaultForeground);
|
||||
terminalSettings.DefaultBackground(_defaultBackground);
|
||||
terminalSettings.SelectionBackground(_selectionBackground);
|
||||
terminalSettings.CursorColor(_cursorColor);
|
||||
|
||||
auto const tableCount = gsl::narrow_cast<int>(_table.size());
|
||||
for (int i = 0; i < tableCount; i++)
|
||||
{
|
||||
terminalSettings.SetColorTableEntry(i, static_cast<COLORREF>(_table[i]));
|
||||
terminalSettings.SetColorTableEntry(i, _table[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value ColorScheme::ToJson() const
|
||||
{
|
||||
Json::Value root;
|
||||
root[JsonKey(NameKey)] = winrt::to_string(_schemeName);
|
||||
root[JsonKey(ForegroundKey)] = Utils::ColorToHexString(_defaultForeground);
|
||||
root[JsonKey(BackgroundKey)] = Utils::ColorToHexString(_defaultBackground);
|
||||
root[JsonKey(SelectionBackgroundKey)] = Utils::ColorToHexString(_selectionBackground);
|
||||
root[JsonKey(CursorColorKey)] = Utils::ColorToHexString(_cursorColor);
|
||||
|
||||
int i = 0;
|
||||
for (const auto& colorName : TableColors)
|
||||
{
|
||||
auto& colorValue = _table.at(i);
|
||||
root[JsonKey(colorName)] = Utils::ColorToHexString(colorValue);
|
||||
i++;
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Create a new instance of this class from a serialized JsonObject.
|
||||
// Arguments:
|
||||
@@ -167,27 +193,27 @@ std::wstring_view ColorScheme::GetName() const noexcept
|
||||
return { _schemeName };
|
||||
}
|
||||
|
||||
std::array<til::color, COLOR_TABLE_SIZE>& ColorScheme::GetTable() noexcept
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE>& ColorScheme::GetTable() noexcept
|
||||
{
|
||||
return _table;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetForeground() const noexcept
|
||||
COLORREF ColorScheme::GetForeground() const noexcept
|
||||
{
|
||||
return _defaultForeground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetBackground() const noexcept
|
||||
COLORREF ColorScheme::GetBackground() const noexcept
|
||||
{
|
||||
return _defaultBackground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetSelectionBackground() const noexcept
|
||||
COLORREF ColorScheme::GetSelectionBackground() const noexcept
|
||||
{
|
||||
return _selectionBackground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetCursorColor() const noexcept
|
||||
COLORREF ColorScheme::GetCursorColor() const noexcept
|
||||
{
|
||||
return _cursorColor;
|
||||
}
|
||||
|
||||
@@ -35,31 +35,32 @@ class TerminalApp::ColorScheme
|
||||
{
|
||||
public:
|
||||
ColorScheme();
|
||||
ColorScheme(std::wstring name, til::color defaultFg, til::color defaultBg, til::color cursorColor);
|
||||
ColorScheme(std::wstring name, COLORREF defaultFg, COLORREF defaultBg, COLORREF cursorColor);
|
||||
~ColorScheme();
|
||||
|
||||
void ApplyScheme(winrt::Microsoft::Terminal::Settings::TerminalSettings terminalSettings) const;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
static ColorScheme FromJson(const Json::Value& json);
|
||||
bool ShouldBeLayered(const Json::Value& json) const;
|
||||
void LayerJson(const Json::Value& json);
|
||||
|
||||
std::wstring_view GetName() const noexcept;
|
||||
std::array<til::color, COLOR_TABLE_SIZE>& GetTable() noexcept;
|
||||
til::color GetForeground() const noexcept;
|
||||
til::color GetBackground() const noexcept;
|
||||
til::color GetSelectionBackground() const noexcept;
|
||||
til::color GetCursorColor() const noexcept;
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE>& GetTable() noexcept;
|
||||
COLORREF GetForeground() const noexcept;
|
||||
COLORREF GetBackground() const noexcept;
|
||||
COLORREF GetSelectionBackground() const noexcept;
|
||||
COLORREF GetCursorColor() const noexcept;
|
||||
|
||||
static std::optional<std::wstring> GetNameFromJson(const Json::Value& json);
|
||||
|
||||
private:
|
||||
std::wstring _schemeName;
|
||||
std::array<til::color, COLOR_TABLE_SIZE> _table;
|
||||
til::color _defaultForeground;
|
||||
til::color _defaultBackground;
|
||||
til::color _selectionBackground;
|
||||
til::color _cursorColor;
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE> _table;
|
||||
COLORREF _defaultForeground;
|
||||
COLORREF _defaultBackground;
|
||||
COLORREF _selectionBackground;
|
||||
COLORREF _cursorColor;
|
||||
|
||||
friend class TerminalAppLocalTests::SettingsTests;
|
||||
friend class TerminalAppLocalTests::ColorSchemeTests;
|
||||
|
||||
@@ -249,6 +249,40 @@ void GlobalAppSettings::ApplyToSettings(TerminalSettings& settings) const noexce
|
||||
settings.SoftwareRendering(_softwareRendering);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value GlobalAppSettings::ToJson() const
|
||||
{
|
||||
Json::Value jsonObject;
|
||||
|
||||
jsonObject[JsonKey(DefaultProfileKey)] = winrt::to_string(Utils::GuidToString(_defaultProfile));
|
||||
jsonObject[JsonKey(InitialRowsKey)] = _initialRows;
|
||||
jsonObject[JsonKey(InitialColsKey)] = _initialCols;
|
||||
jsonObject[JsonKey(RowsToScrollKey)] = _rowsToScroll;
|
||||
jsonObject[JsonKey(InitialPositionKey)] = _SerializeInitialPosition(_initialX, _initialY);
|
||||
jsonObject[JsonKey(AlwaysShowTabsKey)] = _alwaysShowTabs;
|
||||
jsonObject[JsonKey(ShowTitleInTitlebarKey)] = _showTitleInTitlebar;
|
||||
jsonObject[JsonKey(ShowTabsInTitlebarKey)] = _showTabsInTitlebar;
|
||||
jsonObject[JsonKey(WordDelimitersKey)] = winrt::to_string(_wordDelimiters);
|
||||
jsonObject[JsonKey(CopyOnSelectKey)] = _copyOnSelect;
|
||||
jsonObject[JsonKey(CopyFormattingKey)] = _copyFormatting;
|
||||
jsonObject[JsonKey(LaunchModeKey)] = winrt::to_string(_SerializeLaunchMode(_launchMode));
|
||||
jsonObject[JsonKey(ThemeKey)] = winrt::to_string(_SerializeTheme(_theme));
|
||||
jsonObject[JsonKey(TabWidthModeKey)] = winrt::to_string(_SerializeTabWidthMode(_tabWidthMode));
|
||||
jsonObject[JsonKey(KeybindingsKey)] = _keybindings->ToJson();
|
||||
jsonObject[JsonKey(ConfirmCloseAllKey)] = _confirmCloseAllTabs;
|
||||
jsonObject[JsonKey(SnapToGridOnResizeKey)] = _SnapToGridOnResize;
|
||||
jsonObject[JsonKey(ForceFullRepaintRenderingKey)] = _forceFullRepaintRendering;
|
||||
jsonObject[JsonKey(SoftwareRenderingKey)] = _softwareRendering;
|
||||
jsonObject[JsonKey(DebugFeaturesKey)] = _debugFeatures;
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Create a new instance of this class from a serialized JsonObject.
|
||||
// Arguments:
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
|
||||
bool DebugFeaturesEnabled() const noexcept;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
static GlobalAppSettings FromJson(const Json::Value& json);
|
||||
void LayerJson(const Json::Value& json);
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
void TerminalApp::JsonUtils::GetOptionalColor(const Json::Value& json,
|
||||
std::string_view key,
|
||||
std::optional<til::color>& target)
|
||||
std::optional<uint32_t>& target)
|
||||
{
|
||||
const auto conversionFn = [](const Json::Value& value) -> til::color {
|
||||
const auto conversionFn = [](const Json::Value& value) -> uint32_t {
|
||||
return ::Microsoft::Console::Utils::ColorFromHexString(value.asString());
|
||||
};
|
||||
GetOptionalValue(json,
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace TerminalApp::JsonUtils
|
||||
{
|
||||
void GetOptionalColor(const Json::Value& json,
|
||||
std::string_view key,
|
||||
std::optional<til::color>& target);
|
||||
std::optional<uint32_t>& target);
|
||||
|
||||
void GetOptionalString(const Json::Value& json,
|
||||
std::string_view key,
|
||||
|
||||
@@ -40,53 +40,15 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void MinMaxCloseControl::SetWindowVisualState(WindowVisualState visualState)
|
||||
{
|
||||
// Look up the heights we should use for the caption buttons from our
|
||||
// XAML resources. "CaptionButtonHeightWindowed" and
|
||||
// "CaptionButtonHeightMaximized" define the size we should use for the
|
||||
// caption buttons height for the windowed and maximized states,
|
||||
// respectively.
|
||||
//
|
||||
// use C++11 magic statics to make sure we only do this once.
|
||||
static auto heights = [this]() {
|
||||
const auto res = Resources();
|
||||
const auto windowedHeightKey = winrt::box_value(L"CaptionButtonHeightWindowed");
|
||||
const auto maximizedHeightKey = winrt::box_value(L"CaptionButtonHeightMaximized");
|
||||
|
||||
auto windowedHeight = 0.0;
|
||||
auto maximizedHeight = 0.0;
|
||||
if (res.HasKey(windowedHeightKey))
|
||||
{
|
||||
const auto valFromResources = res.Lookup(windowedHeightKey);
|
||||
windowedHeight = winrt::unbox_value_or<double>(valFromResources, 0.0);
|
||||
}
|
||||
if (res.HasKey(maximizedHeightKey))
|
||||
{
|
||||
const auto valFromResources = res.Lookup(maximizedHeightKey);
|
||||
maximizedHeight = winrt::unbox_value_or<double>(valFromResources, 0.0);
|
||||
}
|
||||
return std::tuple<double, double>{ windowedHeight, maximizedHeight };
|
||||
}();
|
||||
static const auto windowedHeight = std::get<0>(heights);
|
||||
static const auto maximizedHeight = std::get<1>(heights);
|
||||
|
||||
switch (visualState)
|
||||
{
|
||||
case WindowVisualState::WindowVisualStateMaximized:
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"WindowStateMaximized", false);
|
||||
|
||||
MinimizeButton().Height(maximizedHeight);
|
||||
MaximizeButton().Height(maximizedHeight);
|
||||
CloseButton().Height(maximizedHeight);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(MaximizeButton(), L"WindowStateMaximized", false);
|
||||
break;
|
||||
|
||||
case WindowVisualState::WindowVisualStateNormal:
|
||||
case WindowVisualState::WindowVisualStateIconified:
|
||||
default:
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"WindowStateNormal", false);
|
||||
|
||||
MinimizeButton().Height(windowedHeight);
|
||||
MaximizeButton().Height(windowedHeight);
|
||||
CloseButton().Height(windowedHeight);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(MaximizeButton(), L"WindowStateNormal", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,18 +62,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
<x:String x:Key="CaptionButtonPath"></x:String>
|
||||
<x:String x:Key="CaptionButtonPathWindowMaximized"></x:String>
|
||||
|
||||
<!-- "CaptionButtonHeightWindowed" and
|
||||
"CaptionButtonHeightMaximized" define the size we should use
|
||||
for the caption buttons height for the windowed and maximized
|
||||
states, respectively.
|
||||
|
||||
32 was chosen for the Maximized height to match the height of
|
||||
the TabRowControl. This way, when the window is maximized, the
|
||||
tabs will be flush with the top of the window. See GH#2541 for
|
||||
details.-->
|
||||
<x:Double x:Key="CaptionButtonHeightWindowed">36.0</x:Double>
|
||||
<x:Double x:Key="CaptionButtonHeightMaximized">32.0</x:Double>
|
||||
|
||||
<Style x:Key="CaptionButton" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Background" Value="{ThemeResource CaptionButtonBackground}" />
|
||||
@@ -81,7 +69,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
||||
<Border x:Name="ButtonBaseElement"
|
||||
Background="{TemplateBinding Background}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
@@ -136,7 +123,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeStartLineCap="Square" />
|
||||
</Border>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@@ -145,7 +131,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</StackPanel.Resources>
|
||||
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="MinimizeButton"
|
||||
x:Uid="WindowMinimizeButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
@@ -157,7 +143,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="MaximizeButton"
|
||||
x:Uid="WindowMaximizeButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
@@ -170,7 +156,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="CloseButton"
|
||||
x:Uid="WindowCloseButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
|
||||
@@ -36,7 +36,6 @@ static constexpr std::string_view ConnectionTypeKey{ "connectionType" };
|
||||
static constexpr std::string_view CommandlineKey{ "commandline" };
|
||||
static constexpr std::string_view FontFaceKey{ "fontFace" };
|
||||
static constexpr std::string_view FontSizeKey{ "fontSize" };
|
||||
static constexpr std::string_view FontWeightKey{ "fontWeight" };
|
||||
static constexpr std::string_view AcrylicTransparencyKey{ "acrylicOpacity" };
|
||||
static constexpr std::string_view UseAcrylicKey{ "useAcrylic" };
|
||||
static constexpr std::string_view ScrollbarStateKey{ "scrollbarState" };
|
||||
@@ -67,19 +66,6 @@ static constexpr std::wstring_view CursorShapeUnderscore{ L"underscore" };
|
||||
static constexpr std::wstring_view CursorShapeFilledbox{ L"filledBox" };
|
||||
static constexpr std::wstring_view CursorShapeEmptybox{ L"emptyBox" };
|
||||
|
||||
// Possible values for Font Weight
|
||||
static constexpr std::string_view FontWeightThin{ "thin" };
|
||||
static constexpr std::string_view FontWeightExtraLight{ "extra-light" };
|
||||
static constexpr std::string_view FontWeightLight{ "light" };
|
||||
static constexpr std::string_view FontWeightSemiLight{ "semi-light" };
|
||||
static constexpr std::string_view FontWeightNormal{ "normal" };
|
||||
static constexpr std::string_view FontWeightMedium{ "medium" };
|
||||
static constexpr std::string_view FontWeightSemiBold{ "semi-bold" };
|
||||
static constexpr std::string_view FontWeightBold{ "bold" };
|
||||
static constexpr std::string_view FontWeightExtraBold{ "extra-bold" };
|
||||
static constexpr std::string_view FontWeightBlack{ "black" };
|
||||
static constexpr std::string_view FontWeightExtraBlack{ "extra-black" };
|
||||
|
||||
// Possible values for Image Stretch Mode
|
||||
static constexpr std::string_view ImageStretchModeNone{ "none" };
|
||||
static constexpr std::string_view ImageStretchModeFill{ "fill" };
|
||||
@@ -129,7 +115,6 @@ Profile::Profile(const std::optional<GUID>& guid) :
|
||||
_startingDirectory{},
|
||||
_fontFace{ DEFAULT_FONT_FACE },
|
||||
_fontSize{ DEFAULT_FONT_SIZE },
|
||||
/* _fontWeight is initialized below because the structure won't accept a uint16_t directly */
|
||||
_acrylicTransparency{ 0.5 },
|
||||
_useAcrylic{ false },
|
||||
_scrollbarState{},
|
||||
@@ -143,9 +128,6 @@ Profile::Profile(const std::optional<GUID>& guid) :
|
||||
_retroTerminalEffect{},
|
||||
_antialiasingMode{ TextAntialiasingMode::Grayscale }
|
||||
{
|
||||
winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = DEFAULT_FONT_WEIGHT;
|
||||
_fontWeight = weight;
|
||||
}
|
||||
|
||||
Profile::~Profile()
|
||||
@@ -198,7 +180,6 @@ TerminalSettings Profile::CreateTerminalSettings(const std::unordered_map<std::w
|
||||
|
||||
terminalSettings.FontFace(_fontFace);
|
||||
terminalSettings.FontSize(_fontSize);
|
||||
terminalSettings.FontWeight(_fontWeight);
|
||||
terminalSettings.Padding(_padding);
|
||||
|
||||
terminalSettings.Commandline(_commandline);
|
||||
@@ -282,6 +263,183 @@ TerminalSettings Profile::CreateTerminalSettings(const std::unordered_map<std::w
|
||||
return terminalSettings;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value Profile::ToJson() const
|
||||
{
|
||||
Json::Value root = GenerateStub();
|
||||
|
||||
///// Profile-specific settings /////
|
||||
// As of #2795, all profile-specific settings were moved to GenerateStub. If
|
||||
// any new profiles-specific settings are added, they should probably be
|
||||
// added here instead of in that method.
|
||||
|
||||
///// Core Settings /////
|
||||
if (_defaultForeground)
|
||||
{
|
||||
root[JsonKey(ForegroundKey)] = Utils::ColorToHexString(_defaultForeground.value());
|
||||
}
|
||||
if (_defaultBackground)
|
||||
{
|
||||
root[JsonKey(BackgroundKey)] = Utils::ColorToHexString(_defaultBackground.value());
|
||||
}
|
||||
if (_selectionBackground)
|
||||
{
|
||||
root[JsonKey(SelectionBackgroundKey)] = Utils::ColorToHexString(_selectionBackground.value());
|
||||
}
|
||||
if (_cursorColor)
|
||||
{
|
||||
root[JsonKey(CursorColorKey)] = Utils::ColorToHexString(_cursorColor.value());
|
||||
}
|
||||
if (_schemeName)
|
||||
{
|
||||
const auto scheme = winrt::to_string(_schemeName.value());
|
||||
root[JsonKey(ColorSchemeKey)] = scheme;
|
||||
}
|
||||
root[JsonKey(HistorySizeKey)] = _historySize;
|
||||
root[JsonKey(SnapOnInputKey)] = _snapOnInput;
|
||||
// Only add the cursor height property if we're a legacy-style cursor.
|
||||
if (_cursorShape == CursorStyle::Vintage)
|
||||
{
|
||||
root[JsonKey(CursorHeightKey)] = _cursorHeight;
|
||||
}
|
||||
root[JsonKey(CursorShapeKey)] = winrt::to_string(_SerializeCursorStyle(_cursorShape));
|
||||
|
||||
root[JsonKey(CommandlineKey)] = winrt::to_string(_commandline);
|
||||
root[JsonKey(FontFaceKey)] = winrt::to_string(_fontFace);
|
||||
root[JsonKey(FontSizeKey)] = _fontSize;
|
||||
root[JsonKey(AcrylicTransparencyKey)] = _acrylicTransparency;
|
||||
root[JsonKey(UseAcrylicKey)] = _useAcrylic;
|
||||
root[JsonKey(PaddingKey)] = winrt::to_string(_padding);
|
||||
|
||||
if (_connectionType)
|
||||
{
|
||||
root[JsonKey(ConnectionTypeKey)] = winrt::to_string(Utils::GuidToString(_connectionType.value()));
|
||||
}
|
||||
if (_scrollbarState)
|
||||
{
|
||||
const auto scrollbarState = winrt::to_string(_scrollbarState.value());
|
||||
root[JsonKey(ScrollbarStateKey)] = scrollbarState;
|
||||
}
|
||||
|
||||
if (_icon)
|
||||
{
|
||||
const auto icon = winrt::to_string(_icon.value());
|
||||
root[JsonKey(IconKey)] = icon;
|
||||
}
|
||||
|
||||
if (_tabTitle)
|
||||
{
|
||||
root[JsonKey(TabTitleKey)] = winrt::to_string(_tabTitle.value());
|
||||
}
|
||||
|
||||
if (_suppressApplicationTitle)
|
||||
{
|
||||
root[JsonKey(SuppressApplicationTitleKey)] = _suppressApplicationTitle;
|
||||
}
|
||||
|
||||
if (_startingDirectory)
|
||||
{
|
||||
root[JsonKey(StartingDirectoryKey)] = winrt::to_string(_startingDirectory.value());
|
||||
}
|
||||
|
||||
if (_backgroundImage)
|
||||
{
|
||||
root[JsonKey(BackgroundImageKey)] = winrt::to_string(_backgroundImage.value());
|
||||
}
|
||||
|
||||
if (_backgroundImageOpacity)
|
||||
{
|
||||
root[JsonKey(BackgroundImageOpacityKey)] = _backgroundImageOpacity.value();
|
||||
}
|
||||
|
||||
if (_backgroundImageStretchMode)
|
||||
{
|
||||
root[JsonKey(BackgroundImageStretchModeKey)] = SerializeImageStretchMode(_backgroundImageStretchMode.value()).data();
|
||||
}
|
||||
|
||||
if (_backgroundImageAlignment)
|
||||
{
|
||||
root[JsonKey(BackgroundImageAlignmentKey)] = SerializeImageAlignment(_backgroundImageAlignment.value()).data();
|
||||
}
|
||||
|
||||
root[JsonKey(CloseOnExitKey)] = _SerializeCloseOnExitMode(_closeOnExitMode).data();
|
||||
|
||||
if (_retroTerminalEffect)
|
||||
{
|
||||
root[JsonKey(RetroTerminalEffectKey)] = _retroTerminalEffect.value();
|
||||
}
|
||||
|
||||
root[JsonKey(AntialiasingModeKey)] = SerializeTextAntialiasingMode(_antialiasingMode).data();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - This generates a json object `diff` s.t.
|
||||
// this = other.LayerJson(diff)
|
||||
// So if:
|
||||
// - this has a nullopt for an optional, diff will have null for that member
|
||||
// - this has a value for an optional, diff will have our value. If the other
|
||||
// did _not_ have a value, and we did, diff will have our value.
|
||||
// Arguments:
|
||||
// - other: the other profile object to use as the "base" for this diff. The
|
||||
// result could be layered upon that json object to re-create this object's
|
||||
// serialization.
|
||||
// Return Value:
|
||||
// - a diff between this and the other object, such that this could be recreated
|
||||
// from the diff and the other object.
|
||||
Json::Value Profile::DiffToJson(const Profile& other) const
|
||||
{
|
||||
auto otherJson = other.ToJson();
|
||||
auto myJson = ToJson();
|
||||
Json::Value diff;
|
||||
|
||||
// Iterate in two steps:
|
||||
// - first over all the keys in the 'other' object's serialization.
|
||||
// - then over all the keys in our serialization.
|
||||
// In this way, we ensure all keys from both objects are present in the
|
||||
// final object.
|
||||
for (const auto& key : otherJson.getMemberNames())
|
||||
{
|
||||
if (myJson.isMember(key))
|
||||
{
|
||||
// Both objects have the key
|
||||
auto otherVal = otherJson[key];
|
||||
auto myVal = myJson[key];
|
||||
if (otherVal != myVal)
|
||||
{
|
||||
diff[key] = myVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// key is not in this json object. Set to null, so that when the
|
||||
// diff is layered upon the original object, we'll properly set
|
||||
// nullopt for any optionals that weren't present in this object.
|
||||
diff[key] = Json::Value::null;
|
||||
}
|
||||
}
|
||||
for (const auto& key : myJson.getMemberNames())
|
||||
{
|
||||
if (otherJson.isMember(key))
|
||||
{
|
||||
// both objects have this key. Do nothing, this is handled above
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a key the other object did not. Add our value.
|
||||
diff[key] = myJson[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Generates a Json::Value which is a "stub" of this profile. This stub will
|
||||
// have enough information that it could be layered with this profile.
|
||||
@@ -493,12 +651,6 @@ void Profile::LayerJson(const Json::Value& json)
|
||||
|
||||
JsonUtils::GetInt(json, FontSizeKey, _fontSize);
|
||||
|
||||
if (json.isMember(JsonKey(FontWeightKey)))
|
||||
{
|
||||
auto fontWeight{ json[JsonKey(FontWeightKey)] };
|
||||
_fontWeight = _ParseFontWeight(fontWeight);
|
||||
}
|
||||
|
||||
JsonUtils::GetDouble(json, AcrylicTransparencyKey, _acrylicTransparency);
|
||||
|
||||
JsonUtils::GetBool(json, UseAcrylicKey, _useAcrylic);
|
||||
@@ -576,17 +728,17 @@ void Profile::SetUseAcrylic(bool useAcrylic) noexcept
|
||||
_useAcrylic = useAcrylic;
|
||||
}
|
||||
|
||||
void Profile::SetDefaultForeground(til::color defaultForeground) noexcept
|
||||
void Profile::SetDefaultForeground(COLORREF defaultForeground) noexcept
|
||||
{
|
||||
_defaultForeground = defaultForeground;
|
||||
}
|
||||
|
||||
void Profile::SetDefaultBackground(til::color defaultBackground) noexcept
|
||||
void Profile::SetDefaultBackground(COLORREF defaultBackground) noexcept
|
||||
{
|
||||
_defaultBackground = defaultBackground;
|
||||
}
|
||||
|
||||
void Profile::SetSelectionBackground(til::color selectionBackground) noexcept
|
||||
void Profile::SetSelectionBackground(COLORREF selectionBackground) noexcept
|
||||
{
|
||||
_selectionBackground = selectionBackground;
|
||||
}
|
||||
@@ -765,78 +917,6 @@ std::wstring Profile::EvaluateStartingDirectory(const std::wstring& directory)
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper function for converting a user-specified font weight value to its corresponding enum
|
||||
// Arguments:
|
||||
// - The value from the settings.json file
|
||||
// Return Value:
|
||||
// - The corresponding value which maps to the string provided by the user
|
||||
winrt::Windows::UI::Text::FontWeight Profile::_ParseFontWeight(const Json::Value& json)
|
||||
{
|
||||
if (json.isUInt())
|
||||
{
|
||||
winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = static_cast<uint16_t>(json.asUInt());
|
||||
|
||||
// We're only accepting variable values between 100 and 990 so we don't go too crazy.
|
||||
if (weight.Weight >= 100 && weight.Weight <= 990)
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
}
|
||||
|
||||
if (json.isString())
|
||||
{
|
||||
auto fontWeight = json.asString();
|
||||
if (fontWeight == FontWeightThin)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Thin();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraLight();
|
||||
}
|
||||
else if (fontWeight == FontWeightLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Light();
|
||||
}
|
||||
else if (fontWeight == FontWeightSemiLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::SemiLight();
|
||||
}
|
||||
else if (fontWeight == FontWeightNormal)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Normal();
|
||||
}
|
||||
else if (fontWeight == FontWeightMedium)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Medium();
|
||||
}
|
||||
else if (fontWeight == FontWeightSemiBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::SemiBold();
|
||||
}
|
||||
else if (fontWeight == FontWeightBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Bold();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraBold();
|
||||
}
|
||||
else if (fontWeight == FontWeightBlack)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Black();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraBlack)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraBlack();
|
||||
}
|
||||
}
|
||||
|
||||
return winrt::Windows::UI::Text::FontWeights::Normal();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper function for converting a user-specified closeOnExit value to its corresponding enum
|
||||
// Arguments:
|
||||
|
||||
@@ -54,6 +54,8 @@ public:
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::TerminalSettings CreateTerminalSettings(const std::unordered_map<std::wstring, ColorScheme>& schemes) const;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
Json::Value DiffToJson(const Profile& other) const;
|
||||
Json::Value GenerateStub() const;
|
||||
static Profile FromJson(const Json::Value& json);
|
||||
bool ShouldBeLayered(const Json::Value& json) const;
|
||||
@@ -79,9 +81,9 @@ public:
|
||||
void SetStartingDirectory(std::wstring startingDirectory) noexcept;
|
||||
void SetName(const std::wstring_view name) noexcept;
|
||||
void SetUseAcrylic(bool useAcrylic) noexcept;
|
||||
void SetDefaultForeground(til::color defaultForeground) noexcept;
|
||||
void SetDefaultBackground(til::color defaultBackground) noexcept;
|
||||
void SetSelectionBackground(til::color selectionBackground) noexcept;
|
||||
void SetDefaultForeground(COLORREF defaultForeground) noexcept;
|
||||
void SetDefaultBackground(COLORREF defaultBackground) noexcept;
|
||||
void SetSelectionBackground(COLORREF selectionBackground) noexcept;
|
||||
void SetCloseOnExitMode(CloseOnExitMode mode) noexcept;
|
||||
void SetConnectionType(GUID connectionType) noexcept;
|
||||
|
||||
@@ -114,8 +116,6 @@ private:
|
||||
static std::tuple<winrt::Windows::UI::Xaml::HorizontalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment> ParseImageAlignment(const std::string_view imageAlignment);
|
||||
static std::tuple<winrt::Windows::UI::Xaml::HorizontalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment> _ConvertJsonToAlignment(const Json::Value& json);
|
||||
|
||||
static winrt::Windows::UI::Text::FontWeight _ParseFontWeight(const Json::Value& json);
|
||||
|
||||
static CloseOnExitMode ParseCloseOnExitMode(const Json::Value& json);
|
||||
static std::string_view _SerializeCloseOnExitMode(const CloseOnExitMode closeOnExitMode);
|
||||
|
||||
@@ -139,10 +139,10 @@ private:
|
||||
// If this is set, then our colors should come from the associated color scheme
|
||||
std::optional<std::wstring> _schemeName;
|
||||
|
||||
std::optional<til::color> _defaultForeground;
|
||||
std::optional<til::color> _defaultBackground;
|
||||
std::optional<til::color> _selectionBackground;
|
||||
std::optional<til::color> _cursorColor;
|
||||
std::optional<uint32_t> _defaultForeground;
|
||||
std::optional<uint32_t> _defaultBackground;
|
||||
std::optional<uint32_t> _selectionBackground;
|
||||
std::optional<uint32_t> _cursorColor;
|
||||
std::optional<std::wstring> _tabTitle;
|
||||
bool _suppressApplicationTitle;
|
||||
int32_t _historySize;
|
||||
@@ -154,7 +154,6 @@ private:
|
||||
std::wstring _fontFace;
|
||||
std::optional<std::wstring> _startingDirectory;
|
||||
int32_t _fontSize;
|
||||
winrt::Windows::UI::Text::FontWeight _fontWeight;
|
||||
double _acrylicTransparency;
|
||||
bool _useAcrylic;
|
||||
|
||||
|
||||
@@ -168,27 +168,6 @@
|
||||
<data name="SettingsMenuItem" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="CloseAll" xml:space="preserve">
|
||||
<value>Close all</value>
|
||||
</data>
|
||||
<data name="CloseWindowWarningTitle" xml:space="preserve">
|
||||
<value>Do you want to close all tabs?</value>
|
||||
</data>
|
||||
<data name="TabClose" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
</data>
|
||||
<data name="TabColorChoose" xml:space="preserve">
|
||||
<value>Color...</value>
|
||||
</data>
|
||||
<data name="TabColorCustomButton.Content" xml:space="preserve">
|
||||
<value>Custom...</value>
|
||||
</data>
|
||||
<data name="TabColorClearButton.Content" xml:space="preserve">
|
||||
<value>Reset</value>
|
||||
</data>
|
||||
<data name="InvalidBackgroundImage" xml:space="preserve">
|
||||
<value>Found a profile with an invalid "backgroundImage". Defaulting that profile to have no background image. Make sure that when setting a "backgroundImage", the value is a valid file path to an image.</value>
|
||||
<comment>{Locked="\"backgroundImage\""}</comment>
|
||||
@@ -253,9 +232,6 @@
|
||||
<value>Open in the given directory instead of the profile's set "startingDirectory"</value>
|
||||
<comment>{Locked="\"startingDirectory\""}</comment>
|
||||
</data>
|
||||
<data name="CmdVersionDesc" xml:space="preserve">
|
||||
<value>Display the application version</value>
|
||||
</data>
|
||||
<data name="NewTabSplitButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.HelpText" xml:space="preserve">
|
||||
<value>Press the button to open a new terminal tab with your default profile. Open the flyout to select which profile you want to open.</value>
|
||||
</data>
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "Tab.h"
|
||||
#include "Tab.g.cpp"
|
||||
#include "Utils.h"
|
||||
#include "ColorHelper.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
@@ -84,20 +81,6 @@ namespace winrt::TerminalApp::implementation
|
||||
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
|
||||
// Arguments:
|
||||
// - control: reference to the TermControl object to bind event to
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::Initialize(const TermControl& control)
|
||||
{
|
||||
_BindEventHandlers(control);
|
||||
_CreateContextMenu();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns true if this is the currently focused tab. For any set of tabs,
|
||||
// there should only be one tab that is marked as focused, though each tab has
|
||||
@@ -150,7 +133,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 Tab::BindEventHandlers(const TermControl& control) noexcept
|
||||
{
|
||||
_AttachEventHandlersToPane(_rootPane);
|
||||
_AttachEventHandlersToControl(control);
|
||||
@@ -457,208 +440,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a context menu attached to the tab.
|
||||
// Currently contains elements allowing to select or
|
||||
// to close the current tab
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_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->_rootPane->Close();
|
||||
}
|
||||
});
|
||||
closeTabMenuItem.Text(RS_(L"TabClose"));
|
||||
closeTabMenuItem.Icon(closeSymbol);
|
||||
|
||||
// "Color..."
|
||||
Controls::MenuFlyoutItem chooseColorMenuItem;
|
||||
Controls::FontIcon colorPickSymbol;
|
||||
colorPickSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
colorPickSymbol.Glyph(L"\xE790");
|
||||
|
||||
chooseColorMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_tabColorPickup.ShowAt(tab->_tabViewItem);
|
||||
}
|
||||
});
|
||||
chooseColorMenuItem.Text(RS_(L"TabColorChoose"));
|
||||
chooseColorMenuItem.Icon(colorPickSymbol);
|
||||
|
||||
// Color Picker (it's convenient to have it here)
|
||||
_tabColorPickup.ColorSelected([weakThis](auto newTabColor) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_SetTabColor(newTabColor);
|
||||
}
|
||||
});
|
||||
|
||||
_tabColorPickup.ColorCleared([weakThis]() {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_ResetTabColor();
|
||||
}
|
||||
});
|
||||
|
||||
// Build the menu
|
||||
Controls::MenuFlyout newTabFlyout;
|
||||
Controls::MenuFlyoutSeparator menuSeparator;
|
||||
newTabFlyout.Items().Append(chooseColorMenuItem);
|
||||
newTabFlyout.Items().Append(menuSeparator);
|
||||
newTabFlyout.Items().Append(closeTabMenuItem);
|
||||
_tabViewItem.ContextFlyout(newTabFlyout);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Returns the tab color, if any
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The tab's color, if any
|
||||
std::optional<winrt::Windows::UI::Color> Tab::GetTabColor()
|
||||
{
|
||||
return _tabColor;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the tab background color to the color chosen by the user
|
||||
// - Sets the tab foreground color depending on the luminance of
|
||||
// the background color
|
||||
// Arguments:
|
||||
// - color: the shiny color the user picked for their tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_SetTabColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
_tabViewItem.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis, color]() {
|
||||
auto ptrTab = weakThis.get();
|
||||
if (!ptrTab)
|
||||
return;
|
||||
|
||||
auto tab{ ptrTab };
|
||||
Media::SolidColorBrush selectedTabBrush{};
|
||||
Media::SolidColorBrush deselectedTabBrush{};
|
||||
Media::SolidColorBrush fontBrush{};
|
||||
Media::SolidColorBrush hoverTabBrush{};
|
||||
// calculate the luminance of the current color and select a font
|
||||
// color based on that
|
||||
// see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
||||
if (TerminalApp::ColorHelper::IsBrightColor(color))
|
||||
{
|
||||
fontBrush.Color(winrt::Windows::UI::Colors::Black());
|
||||
}
|
||||
else
|
||||
{
|
||||
fontBrush.Color(winrt::Windows::UI::Colors::White());
|
||||
}
|
||||
|
||||
hoverTabBrush.Color(TerminalApp::ColorHelper::GetAccentColor(color));
|
||||
selectedTabBrush.Color(color);
|
||||
|
||||
// currently if a tab has a custom color, a deselected state is
|
||||
// signified by using the same color with a bit ot transparency
|
||||
auto deselectedTabColor = color;
|
||||
deselectedTabColor.A = 64;
|
||||
deselectedTabBrush.Color(deselectedTabColor);
|
||||
|
||||
// currently if a tab has a custom color, a deselected state is
|
||||
// signified by using the same color with a bit ot transparency
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
tab->_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
|
||||
tab->_RefreshVisualState();
|
||||
|
||||
tab->_tabColor.emplace(color);
|
||||
tab->_colorSelected(color);
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Clear the custom color of the tab, if any
|
||||
// the background color
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_ResetTabColor()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
_tabViewItem.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis]() {
|
||||
auto ptrTab = weakThis.get();
|
||||
if (!ptrTab)
|
||||
return;
|
||||
|
||||
auto tab{ ptrTab };
|
||||
winrt::hstring keys[] = {
|
||||
L"TabViewItemHeaderBackground",
|
||||
L"TabViewItemHeaderBackgroundSelected",
|
||||
L"TabViewItemHeaderBackgroundPointerOver",
|
||||
L"TabViewItemHeaderForeground",
|
||||
L"TabViewItemHeaderForegroundSelected",
|
||||
L"TabViewItemHeaderForegroundPointerOver",
|
||||
L"TabViewItemHeaderBackgroundPressed",
|
||||
L"TabViewItemHeaderForegroundPressed"
|
||||
};
|
||||
|
||||
// simply clear any of the colors in the tab's dict
|
||||
for (auto keyString : keys)
|
||||
{
|
||||
auto key = winrt::box_value(keyString);
|
||||
if (tab->_tabViewItem.Resources().HasKey(key))
|
||||
{
|
||||
tab->_tabViewItem.Resources().Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
tab->_RefreshVisualState();
|
||||
tab->_tabColor.reset();
|
||||
tab->_colorCleared();
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// Toggles the visual state of the tab view item,
|
||||
// so that changes to the tab color are reflected immediately
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_RefreshVisualState()
|
||||
{
|
||||
if (_focused)
|
||||
{
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
}
|
||||
}
|
||||
|
||||
// - Get the total number of leaf panes in this tab. This will be the number
|
||||
// of actual controls hosted by this tab.
|
||||
// Arguments:
|
||||
@@ -686,6 +467,4 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
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<>);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
#include "Pane.h"
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "Tab.g.h"
|
||||
|
||||
// fwdecl unittest classes
|
||||
@@ -20,8 +19,8 @@ namespace winrt::TerminalApp::implementation
|
||||
Tab() = delete;
|
||||
Tab(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);
|
||||
// Called after construction to setup events with weak_ptr
|
||||
void BindEventHandlers(const winrt::Microsoft::Terminal::TerminalControl::TermControl& control) noexcept;
|
||||
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem GetTabViewItem();
|
||||
winrt::Windows::UI::Xaml::UIElement GetRootElement();
|
||||
@@ -52,13 +51,9 @@ namespace winrt::TerminalApp::implementation
|
||||
void Shutdown();
|
||||
void ClosePane();
|
||||
|
||||
std::optional<winrt::Windows::UI::Color> GetTabColor();
|
||||
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
DECLARE_EVENT(ActivePaneChanged, _ActivePaneChangedHandlers, winrt::delegate<>);
|
||||
DECLARE_EVENT(ColorSelected, _colorSelected, winrt::delegate<winrt::Windows::UI::Color>);
|
||||
DECLARE_EVENT(ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, IconPath, _PropertyChangedHandlers);
|
||||
@@ -67,8 +62,6 @@ namespace winrt::TerminalApp::implementation
|
||||
std::shared_ptr<Pane> _rootPane{ nullptr };
|
||||
std::shared_ptr<Pane> _activePane{ nullptr };
|
||||
winrt::hstring _lastIconPath{};
|
||||
winrt::TerminalApp::ColorPickupFlyout _tabColorPickup{};
|
||||
std::optional<winrt::Windows::UI::Color> _tabColor{};
|
||||
|
||||
bool _focused{ false };
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem _tabViewItem{ nullptr };
|
||||
@@ -76,13 +69,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void _MakeTabViewItem();
|
||||
void _Focus();
|
||||
|
||||
void _CreateContextMenu();
|
||||
void _SetTabColor(const winrt::Windows::UI::Color& color);
|
||||
void _ResetTabColor();
|
||||
void _RefreshVisualState();
|
||||
|
||||
void _BindEventHandlers(const winrt::Microsoft::Terminal::TerminalControl::TermControl& control) noexcept;
|
||||
|
||||
void _AttachEventHandlersToControl(const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
void _AttachEventHandlersToPane(std::shared_ptr<Pane> pane);
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
somehow. So make sure to only include top-level dependencies here (don't
|
||||
include Settings and Connection, since Control will include them for us) -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as
|
||||
|
||||
@@ -11,17 +11,13 @@
|
||||
#include <LibraryResources.h>
|
||||
|
||||
#include "TerminalPage.g.cpp"
|
||||
#include <winrt/Windows.Storage.h>
|
||||
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
|
||||
|
||||
#include "AzureCloudShellGenerator.h" // For AzureConnectionType
|
||||
#include "TelnetGenerator.h" // For TelnetConnectionType
|
||||
#include "TabRowControl.h"
|
||||
#include "ColorHelper.h"
|
||||
#include "DebugTapConnection.h"
|
||||
|
||||
#include <winrt/Microsoft.Terminal.Settings.Control.h>
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
@@ -857,17 +853,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
_lastTabClosedHandlers(*this, nullptr);
|
||||
}
|
||||
else if (_isFullscreen || _rearranging)
|
||||
else if (_isFullscreen)
|
||||
{
|
||||
// GH#5799 - If we're fullscreen, the TabView isn't visible. If it's
|
||||
// not Visible, it's _not_ going to raise a SelectionChanged event,
|
||||
// which is what we usually use to focus another tab. Instead, we'll
|
||||
// have to do it manually here.
|
||||
//
|
||||
// GH#5559 Similarly, we suppress _OnTabItemsChanged events during a
|
||||
// rearrange, so if a tab is closed while we're rearranging tabs, do
|
||||
// this manually.
|
||||
//
|
||||
// We can't use
|
||||
// auto selectedIndex = _tabView.SelectedIndex();
|
||||
// Because this will always return -1 in this scenario unfortunately.
|
||||
@@ -892,15 +884,6 @@ namespace winrt::TerminalApp::implementation
|
||||
auto newSelectedTab{ _GetStrongTabImpl(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab->GetTabViewItem());
|
||||
}
|
||||
|
||||
// GH#5559 - If we were in the middle of a drag/drop, end it by clearing
|
||||
// out our state.
|
||||
if (_rearranging)
|
||||
{
|
||||
_rearranging = false;
|
||||
_rearrangeFrom = std::nullopt;
|
||||
_rearrangeTo = std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -922,7 +905,7 @@ namespace winrt::TerminalApp::implementation
|
||||
term.PasteFromClipboard({ this, &TerminalPage::_PasteFromClipboardHandler });
|
||||
|
||||
// Bind Tab events to the TermControl and the Tab's Pane
|
||||
hostingTab.Initialize(term);
|
||||
hostingTab.BindEventHandlers(term);
|
||||
|
||||
// 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.
|
||||
@@ -938,34 +921,6 @@ namespace winrt::TerminalApp::implementation
|
||||
page->_UpdateTitle(*tab);
|
||||
}
|
||||
});
|
||||
|
||||
// react on color changed events
|
||||
hostingTab.ColorSelected([weakTab{ hostingTab.get_weak() }, weakThis{ get_weak() }](auto&& color) {
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && tab->IsFocused())
|
||||
{
|
||||
page->_SetNonClientAreaColors(color);
|
||||
}
|
||||
});
|
||||
|
||||
hostingTab.ColorCleared([weakTab{ hostingTab.get_weak() }, weakThis{ get_weak() }]() {
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && tab->IsFocused())
|
||||
{
|
||||
page->_ClearNonClientAreaColors();
|
||||
}
|
||||
});
|
||||
|
||||
// TODO GH#3327: Once we support colorizing the NewTab button based on
|
||||
// the color of the tab, we'll want to make sure to call
|
||||
// _ClearNewTabButtonColor here, to reset it to the default (for the
|
||||
// newly created tab).
|
||||
// remove any colors left by other colored tabs
|
||||
// _ClearNewTabButtonColor();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1471,16 +1426,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
text = co_await data.GetTextAsync();
|
||||
}
|
||||
// Windows Explorer's "Copy address" menu item stores a StorageItem in the clipboard, and no text.
|
||||
else if (data.Contains(StandardDataFormats::StorageItems()))
|
||||
{
|
||||
Windows::Foundation::Collections::IVectorView<Windows::Storage::IStorageItem> items = co_await data.GetStorageItemsAsync();
|
||||
if (items.Size() > 0)
|
||||
{
|
||||
Windows::Storage::IStorageItem item = items.GetAt(0);
|
||||
text = item.Path();
|
||||
}
|
||||
}
|
||||
eventArgs.HandleClipboardData(text);
|
||||
}
|
||||
CATCH_LOG();
|
||||
@@ -1512,29 +1457,20 @@ namespace winrt::TerminalApp::implementation
|
||||
// a background thread, as to not hang/crash the UI thread.
|
||||
fire_and_forget TerminalPage::_LaunchSettings(const bool openDefaults)
|
||||
{
|
||||
openDefaults;
|
||||
// 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 settingsPage = winrt::make_self<::winrt::Microsoft::Terminal::Settings::Control::MainPage>();
|
||||
auto tabViewItem = ::winrt::MUX::Controls::TabViewItem{};
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
_tabView.SelectedItem(settingsPage);
|
||||
const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
|
||||
CascadiaSettings::GetSettingsPath();
|
||||
|
||||
|
||||
|
||||
//// 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();
|
||||
|
||||
//const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
|
||||
// CascadiaSettings::GetSettingsPath();
|
||||
|
||||
//HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
//if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
//{
|
||||
// ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
|
||||
//}
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1575,10 +1511,6 @@ namespace winrt::TerminalApp::implementation
|
||||
_RemoveTabViewItem(sender.as<MUX::Controls::TabViewItem>());
|
||||
eventArgs.Handled(true);
|
||||
}
|
||||
else if (eventArgs.GetCurrentPoint(*this).Properties().IsRightButtonPressed())
|
||||
{
|
||||
eventArgs.Handled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalPage::_UpdatedSelectedTab(const int32_t index)
|
||||
@@ -1600,20 +1532,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_tabContent.Children().Append(tab->GetRootElement());
|
||||
|
||||
tab->SetFocused(true);
|
||||
|
||||
// Raise an event that our title changed
|
||||
_titleChangeHandlers(*this, Title());
|
||||
|
||||
// Raise an event that our titlebar color changed
|
||||
std::optional<Windows::UI::Color> color = tab->GetTabColor();
|
||||
if (color.has_value())
|
||||
{
|
||||
_SetNonClientAreaColors(color.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
_ClearNonClientAreaColors();
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -1857,31 +1776,16 @@ namespace winrt::TerminalApp::implementation
|
||||
// message. If there were no errors, this message will be blank.
|
||||
// - If the user requested help on any command (using --help), this will
|
||||
// contain the help message.
|
||||
// - If the user requested the version number (using --version), this will
|
||||
// contain the version string.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the help text or error message for the provided commandline, if one
|
||||
// exists, otherwise the empty string.
|
||||
winrt::hstring TerminalPage::ParseCommandlineMessage()
|
||||
winrt::hstring TerminalPage::EarlyExitMessage()
|
||||
{
|
||||
return winrt::to_hstring(_appArgs.GetExitMessage());
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns true if we should exit the application before even starting the
|
||||
// window. We might want to do this if we're displaying an error message or
|
||||
// the version string, or if we want to open the settings file.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - true iff we should exit the application before even starting the window
|
||||
bool TerminalPage::ShouldExitEarly()
|
||||
{
|
||||
return _appArgs.ShouldExitEarly();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the tab at the given index
|
||||
// Arguments:
|
||||
@@ -1908,158 +1812,6 @@ namespace winrt::TerminalApp::implementation
|
||||
return tabImpl;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the tab split button color when a new tab color is selected
|
||||
// Arguments:
|
||||
// - color: The color of the newly selected tab, used to properly calculate
|
||||
// the foreground color of the split button (to match the font
|
||||
// color of the tab)
|
||||
// - accentColor: the actual color we are going to use to paint the tab row and
|
||||
// split button, so that there is some contrast between the tab
|
||||
// and the non-client are behind it
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_SetNewTabButtonColor(const Windows::UI::Color& color, const Windows::UI::Color& accentColor)
|
||||
{
|
||||
// TODO GH#3327: Look at what to do with the tab button when we have XAML theming
|
||||
bool IsBrightColor = ColorHelper::IsBrightColor(color);
|
||||
bool isLightAccentColor = ColorHelper::IsBrightColor(accentColor);
|
||||
winrt::Windows::UI::Color pressedColor{};
|
||||
winrt::Windows::UI::Color hoverColor{};
|
||||
winrt::Windows::UI::Color foregroundColor{};
|
||||
const float hoverColorAdjustment = 5.f;
|
||||
const float pressedColorAdjustment = 7.f;
|
||||
|
||||
if (IsBrightColor)
|
||||
{
|
||||
foregroundColor = winrt::Windows::UI::Colors::Black();
|
||||
}
|
||||
else
|
||||
{
|
||||
foregroundColor = winrt::Windows::UI::Colors::White();
|
||||
}
|
||||
|
||||
if (isLightAccentColor)
|
||||
{
|
||||
hoverColor = ColorHelper::Darken(accentColor, hoverColorAdjustment);
|
||||
pressedColor = ColorHelper::Darken(accentColor, pressedColorAdjustment);
|
||||
}
|
||||
else
|
||||
{
|
||||
hoverColor = ColorHelper::Lighten(accentColor, hoverColorAdjustment);
|
||||
pressedColor = ColorHelper::Lighten(accentColor, pressedColorAdjustment);
|
||||
}
|
||||
|
||||
Media::SolidColorBrush backgroundBrush{ accentColor };
|
||||
Media::SolidColorBrush backgroundHoverBrush{ hoverColor };
|
||||
Media::SolidColorBrush backgroundPressedBrush{ pressedColor };
|
||||
Media::SolidColorBrush foregroundBrush{ foregroundColor };
|
||||
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonBackground"), backgroundBrush);
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonBackgroundPointerOver"), backgroundHoverBrush);
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonBackgroundPressed"), backgroundPressedBrush);
|
||||
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonForeground"), foregroundBrush);
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonForegroundPointerOver"), foregroundBrush);
|
||||
_newTabButton.Resources().Insert(winrt::box_value(L"SplitButtonForegroundPressed"), foregroundBrush);
|
||||
|
||||
_newTabButton.Background(backgroundBrush);
|
||||
_newTabButton.Foreground(foregroundBrush);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Clears the tab split button color to a system color
|
||||
// (or white if none is found) when the tab's color is cleared
|
||||
// - Clears the tab row color to a system color
|
||||
// (or white if none is found) when the tab's color is cleared
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_ClearNewTabButtonColor()
|
||||
{
|
||||
// TODO GH#3327: Look at what to do with the tab button when we have XAML theming
|
||||
winrt::hstring keys[] = {
|
||||
L"SplitButtonBackground",
|
||||
L"SplitButtonBackgroundPointerOver",
|
||||
L"SplitButtonBackgroundPressed",
|
||||
L"SplitButtonForeground",
|
||||
L"SplitButtonForegroundPointerOver",
|
||||
L"SplitButtonForegroundPressed"
|
||||
};
|
||||
|
||||
// simply clear any of the colors in the split button's dict
|
||||
for (auto keyString : keys)
|
||||
{
|
||||
auto key = winrt::box_value(keyString);
|
||||
if (_newTabButton.Resources().HasKey(key))
|
||||
{
|
||||
_newTabButton.Resources().Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
const auto res = Application::Current().Resources();
|
||||
|
||||
const auto defaultBackgroundKey = winrt::box_value(L"TabViewItemHeaderBackground");
|
||||
const auto defaultForegroundKey = winrt::box_value(L"SystemControlForegroundBaseHighBrush");
|
||||
winrt::Windows::UI::Xaml::Media::SolidColorBrush backgroundBrush;
|
||||
winrt::Windows::UI::Xaml::Media::SolidColorBrush foregroundBrush;
|
||||
|
||||
// TODO: Related to GH#3917 - I think if the system is set to "Dark"
|
||||
// theme, but the app is set to light theme, then this lookup still
|
||||
// returns to us the dark theme brushes. There's gotta be a way to get
|
||||
// the right brushes...
|
||||
// See also GH#5741
|
||||
if (res.HasKey(defaultBackgroundKey))
|
||||
{
|
||||
winrt::Windows::Foundation::IInspectable obj = res.Lookup(defaultBackgroundKey);
|
||||
backgroundBrush = obj.try_as<winrt::Windows::UI::Xaml::Media::SolidColorBrush>();
|
||||
}
|
||||
else
|
||||
{
|
||||
backgroundBrush = winrt::Windows::UI::Xaml::Media::SolidColorBrush{ winrt::Windows::UI::Colors::Black() };
|
||||
}
|
||||
|
||||
if (res.HasKey(defaultForegroundKey))
|
||||
{
|
||||
winrt::Windows::Foundation::IInspectable obj = res.Lookup(defaultForegroundKey);
|
||||
foregroundBrush = obj.try_as<winrt::Windows::UI::Xaml::Media::SolidColorBrush>();
|
||||
}
|
||||
else
|
||||
{
|
||||
foregroundBrush = winrt::Windows::UI::Xaml::Media::SolidColorBrush{ winrt::Windows::UI::Colors::White() };
|
||||
}
|
||||
|
||||
_newTabButton.Background(backgroundBrush);
|
||||
_newTabButton.Foreground(foregroundBrush);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the tab split button color when a new tab color is selected
|
||||
// - This method could also set the color of the title bar and tab row
|
||||
// in the future
|
||||
// Arguments:
|
||||
// - selectedTabColor: The color of the newly selected tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_SetNonClientAreaColors(const Windows::UI::Color& /*selectedTabColor*/)
|
||||
{
|
||||
// TODO GH#3327: Look at what to do with the NC area when we have XAML theming
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Clears the tab split button color when the tab's color is cleared
|
||||
// - This method could also clear the color of the title bar and tab row
|
||||
// in the future
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_ClearNonClientAreaColors()
|
||||
{
|
||||
// TODO GH#3327: Look at what to do with the NC area when we have XAML theming
|
||||
}
|
||||
|
||||
// -------------------------------- WinRT Events ---------------------------------
|
||||
// Winrt events need a method for adding a callback to the event and removing the callback.
|
||||
// These macros will define them both for you.
|
||||
|
||||
@@ -50,8 +50,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void CloseWindow();
|
||||
|
||||
int32_t SetStartupCommandline(winrt::array_view<const hstring> args);
|
||||
winrt::hstring ParseCommandlineMessage();
|
||||
bool ShouldExitEarly();
|
||||
winrt::hstring EarlyExitMessage();
|
||||
|
||||
// -------------------------------- WinRT Events ---------------------------------
|
||||
DECLARE_EVENT_WITH_TYPED_EVENT_HANDLER(TitleChanged, _titleChangeHandlers, winrt::Windows::Foundation::IInspectable, winrt::hstring);
|
||||
@@ -168,11 +167,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _ToggleFullscreen();
|
||||
|
||||
void _SetNonClientAreaColors(const Windows::UI::Color& selectedTabColor);
|
||||
void _ClearNonClientAreaColors();
|
||||
void _SetNewTabButtonColor(const Windows::UI::Color& color, const Windows::UI::Color& accentColor);
|
||||
void _ClearNewTabButtonColor();
|
||||
|
||||
#pragma region ActionHandlers
|
||||
// These are all defined in AppActionHandlers.cpp
|
||||
void _HandleOpenNewTabDropdown(const IInspectable& sender, const TerminalApp::ActionEventArgs& args);
|
||||
|
||||
@@ -11,8 +11,7 @@ namespace TerminalApp
|
||||
TerminalPage();
|
||||
|
||||
Int32 SetStartupCommandline(String[] commands);
|
||||
String ParseCommandlineMessage { get; };
|
||||
Boolean ShouldExitEarly { get; };
|
||||
String EarlyExitMessage { get; };
|
||||
|
||||
// XAML bound properties
|
||||
String ApplicationDisplayName { get; };
|
||||
|
||||
@@ -93,4 +93,5 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
MinMaxCloseControl().SetWindowVisualState(visualState);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void Content(IInspectable content);
|
||||
|
||||
void SetWindowVisualState(WindowVisualState visualState);
|
||||
|
||||
void Root_SizeChanged(const IInspectable& sender, Windows::UI::Xaml::SizeChangedEventArgs const& e);
|
||||
|
||||
void Minimize_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
|
||||
@@ -60,9 +60,6 @@
|
||||
<Page Include="../TabRowControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="../ColorPickupFlyout.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<!-- ========================= Headers ======================== -->
|
||||
<ItemGroup>
|
||||
@@ -82,9 +79,6 @@
|
||||
<ClInclude Include="../TabRowControl.h">
|
||||
<DependentUpon>../TabRowControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="../ColorPickupFlyout.h">
|
||||
<DependentUpon>../ColorPickupFlyout.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="../Tab.h">
|
||||
<DependentUpon>../Tab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
@@ -103,7 +97,6 @@
|
||||
<ClInclude Include="../WslDistroGenerator.h" />
|
||||
<ClInclude Include="../AzureCloudShellGenerator.h" />
|
||||
<ClInclude Include="../TelnetGenerator.h" />
|
||||
<ClInclude Include="..\ColorHelper.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="../ShortcutActionDispatch.h">
|
||||
<DependentUpon>../ShortcutActionDispatch.idl</DependentUpon>
|
||||
@@ -143,9 +136,6 @@
|
||||
<ClCompile Include="../TabRowControl.cpp">
|
||||
<DependentUpon>../TabRowControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="../ColorPickupFlyout.cpp">
|
||||
<DependentUpon>../ColorPickupFlyout.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="../Tab.cpp">
|
||||
<DependentUpon>../Tab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
@@ -164,7 +154,6 @@
|
||||
<ClCompile Include="../WslDistroGenerator.cpp" />
|
||||
<ClCompile Include="../AzureCloudShellGenerator.cpp" />
|
||||
<ClCompile Include="../Pane.LayoutSizeNode.cpp" />
|
||||
<ClCompile Include="../ColorHelper.cpp" />
|
||||
<ClCompile Include="../DebugTapConnection.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
@@ -225,10 +214,6 @@
|
||||
<DependentUpon>../TabRowControl.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="../ColorPickupFlyout.idl">
|
||||
<DependentUpon>../ColorPickupFlyout.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="../Tab.idl"/>
|
||||
</ItemGroup>
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
@@ -274,12 +259,6 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Control">
|
||||
<HintPath>$(_BinRoot)TerminalSettingsControl\Microsoft.Terminal.Settings.Control.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(_BinRoot)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
<ClCompile Include="../Pane.LayoutSizeNode.cpp">
|
||||
<Filter>pane</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\ColorHelper.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="../Utils.h" />
|
||||
@@ -108,7 +107,6 @@
|
||||
<Filter>tab</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="../TelnetGenerator.h" />
|
||||
<ClInclude Include="..\ColorHelper.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="../AppLogic.idl">
|
||||
@@ -143,9 +141,6 @@
|
||||
<Page Include="../TitlebarControl.xaml">
|
||||
<Filter>controls</Filter>
|
||||
</Page>
|
||||
<Page Include="../ColorPickupFlyout.xaml">
|
||||
<Filter>controls</Filter>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="app">
|
||||
|
||||
@@ -63,7 +63,6 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalAppProvider);
|
||||
#include <shellapi.h>
|
||||
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Windows.UI.Popups.h>
|
||||
|
||||
#include <CLI11/CLI11.hpp>
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
@@ -138,13 +138,9 @@
|
||||
<comment>The placeholder text in the search box control.</comment>
|
||||
</data>
|
||||
<data name="DragFileCaption" xml:space="preserve">
|
||||
<value>Paste path to file</value>
|
||||
<value>Copy path to file</value>
|
||||
<comment>The displayed caption for dragging a file onto a terminal.</comment>
|
||||
</data>
|
||||
<data name="DragTextCaption" xml:space="preserve">
|
||||
<value>Paste text</value>
|
||||
<comment>The displayed caption for dragging text onto a terminal.</comment>
|
||||
</data>
|
||||
<data name="SearchBox_CaseSensitivity.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Case Sensitivity</value>
|
||||
<comment>The name of the case sensitivity button on the search box control for accessibility.</comment>
|
||||
|
||||
@@ -201,7 +201,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// things in DIPs, and the fontSize is in pixels.
|
||||
TextBlock().FontSize(unscaledFontSizePx);
|
||||
TextBlock().FontFamily(Media::FontFamily(fontArgs->FontFace()));
|
||||
TextBlock().FontWeight(fontArgs->FontWeight());
|
||||
|
||||
// TextBlock's actual dimensions right after initialization is 0w x 0h. So,
|
||||
// if an IME is displayed before TextBlock has text (like showing the emoji picker
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
GETSET_PROPERTY(Windows::Foundation::Size, FontSize);
|
||||
|
||||
GETSET_PROPERTY(winrt::hstring, FontFace);
|
||||
|
||||
GETSET_PROPERTY(Windows::UI::Text::FontWeight, FontWeight);
|
||||
};
|
||||
|
||||
struct TSFInputControl : TSFInputControlT<TSFInputControl>
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace Microsoft.Terminal.TerminalControl
|
||||
{
|
||||
String FontFace { get; set; };
|
||||
Windows.Foundation.Size FontSize { get; set; };
|
||||
Windows.UI.Text.FontWeight FontWeight { get; set; };
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
_autoScrollingPointerPoint{ std::nullopt },
|
||||
_autoScrollTimer{},
|
||||
_lastAutoScrollUpdateTime{ std::nullopt },
|
||||
_desiredFont{ DEFAULT_FONT_FACE, 0, DEFAULT_FONT_WEIGHT, { 0, DEFAULT_FONT_SIZE }, CP_UTF8 },
|
||||
_actualFont{ DEFAULT_FONT_FACE, 0, DEFAULT_FONT_WEIGHT, { 0, DEFAULT_FONT_SIZE }, CP_UTF8, false },
|
||||
_desiredFont{ DEFAULT_FONT_FACE, 0, 10, { 0, DEFAULT_FONT_SIZE }, CP_UTF8 },
|
||||
_actualFont{ DEFAULT_FONT_FACE, 0, 10, { 0, DEFAULT_FONT_SIZE }, CP_UTF8, false },
|
||||
_touchAnchor{ std::nullopt },
|
||||
_cursorTimer{},
|
||||
_lastMouseClickTimestamp{},
|
||||
@@ -253,7 +253,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
_InitializeBackgroundBrush();
|
||||
|
||||
COLORREF bg = _settings.DefaultBackground();
|
||||
uint32_t bg = _settings.DefaultBackground();
|
||||
_BackgroundColorChanged(bg);
|
||||
|
||||
// Apply padding as swapChainPanel's margin
|
||||
@@ -263,19 +263,18 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Initialize our font information.
|
||||
const auto fontFace = _settings.FontFace();
|
||||
const short fontHeight = gsl::narrow_cast<short>(_settings.FontSize());
|
||||
const auto fontWeight = _settings.FontWeight();
|
||||
// The font width doesn't terribly matter, we'll only be using the
|
||||
// height to look it up
|
||||
// The other params here also largely don't matter.
|
||||
// The family is only used to determine if the font is truetype or
|
||||
// not, but DX doesn't use that info at all.
|
||||
// The Codepage is additionally not actually used by the DX engine at all.
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, fontHeight }, CP_UTF8, false };
|
||||
_actualFont = { fontFace, 0, 10, { 0, fontHeight }, CP_UTF8, false };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
// set TSF Foreground
|
||||
Media::SolidColorBrush foregroundBrush{};
|
||||
foregroundBrush.Color(static_cast<til::color>(_settings.DefaultForeground()));
|
||||
foregroundBrush.Color(ColorRefToColor(_settings.DefaultForeground()));
|
||||
TSFInputControl().Foreground(foregroundBrush);
|
||||
TSFInputControl().Margin(newMargin);
|
||||
|
||||
@@ -406,29 +405,37 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - color: The background color to use as a uint32 (aka DWORD COLORREF)
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TermControl::_BackgroundColorChanged(const COLORREF color)
|
||||
winrt::fire_and_forget TermControl::_BackgroundColorChanged(const uint32_t color)
|
||||
{
|
||||
til::color newBgColor{ color };
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
if (auto control{ weakThis.get() })
|
||||
{
|
||||
const auto R = GetRValue(color);
|
||||
const auto G = GetGValue(color);
|
||||
const auto B = GetBValue(color);
|
||||
|
||||
winrt::Windows::UI::Color bgColor{};
|
||||
bgColor.R = R;
|
||||
bgColor.G = G;
|
||||
bgColor.B = B;
|
||||
bgColor.A = 255;
|
||||
|
||||
if (auto acrylic = RootGrid().Background().try_as<Media::AcrylicBrush>())
|
||||
{
|
||||
acrylic.FallbackColor(newBgColor);
|
||||
acrylic.TintColor(newBgColor);
|
||||
acrylic.FallbackColor(bgColor);
|
||||
acrylic.TintColor(bgColor);
|
||||
}
|
||||
else if (auto solidColor = RootGrid().Background().try_as<Media::SolidColorBrush>())
|
||||
{
|
||||
solidColor.Color(newBgColor);
|
||||
solidColor.Color(bgColor);
|
||||
}
|
||||
|
||||
// Set the default background as transparent to prevent the
|
||||
// DX layer from overwriting the background image or acrylic effect
|
||||
_settings.DefaultBackground(static_cast<COLORREF>(newBgColor.with_alpha(0)));
|
||||
_settings.DefaultBackground(ARGB(0, R, G, B));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1302,7 +1309,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
_settings.UseAcrylic(false);
|
||||
_InitializeBackgroundBrush();
|
||||
COLORREF bg = _settings.DefaultBackground();
|
||||
uint32_t bg = _settings.DefaultBackground();
|
||||
_BackgroundColorChanged(bg);
|
||||
}
|
||||
else
|
||||
@@ -1679,8 +1686,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Make sure we have a non-zero font size
|
||||
const auto newSize = std::max<short>(gsl::narrow_cast<short>(fontSize), 1);
|
||||
const auto fontFace = _settings.FontFace();
|
||||
const auto fontWeight = _settings.FontWeight();
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, newSize }, CP_UTF8, false };
|
||||
_actualFont = { fontFace, 0, 10, { 0, newSize }, CP_UTF8, false };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
auto lock = _terminal->LockForWriting();
|
||||
@@ -2199,14 +2205,13 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Initialize our font information.
|
||||
const auto fontFace = settings.FontFace();
|
||||
const short fontHeight = gsl::narrow_cast<short>(settings.FontSize());
|
||||
const auto fontWeight = settings.FontWeight();
|
||||
// The font width doesn't terribly matter, we'll only be using the
|
||||
// height to look it up
|
||||
// The other params here also largely don't matter.
|
||||
// The family is only used to determine if the font is truetype or
|
||||
// not, but DX doesn't use that info at all.
|
||||
// The Codepage is additionally not actually used by the DX engine at all.
|
||||
FontInfo actualFont = { fontFace, 0, fontWeight.Weight, { 0, fontHeight }, CP_UTF8, false };
|
||||
FontInfo actualFont = { fontFace, 0, 10, { 0, fontHeight }, CP_UTF8, false };
|
||||
FontInfoDesired desiredFont = { actualFont };
|
||||
|
||||
// If the settings have negative or zero row or column counts, ignore those counts.
|
||||
@@ -2500,9 +2505,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
eventArgs.FontSize(CharacterDimensions());
|
||||
eventArgs.FontFace(_actualFont.GetFaceName());
|
||||
::winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = static_cast<uint16_t>(_actualFont.GetWeight());
|
||||
eventArgs.FontWeight(weight);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -2596,15 +2598,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
_SendInputToConnection(allPaths);
|
||||
}
|
||||
}
|
||||
else if (e.DataView().Contains(StandardDataFormats::Text()))
|
||||
{
|
||||
try
|
||||
{
|
||||
std::wstring text{ co_await e.DataView().GetTextAsync() };
|
||||
_SendPastedTextToConnection(text);
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -2625,12 +2618,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
// We can only handle drag/dropping StorageItems (files) and plain Text
|
||||
// currently. If the format on the clipboard is anything else, returning
|
||||
// early here will prevent the drag/drop from doing anything.
|
||||
if (!(e.DataView().Contains(StandardDataFormats::StorageItems()) ||
|
||||
e.DataView().Contains(StandardDataFormats::Text())))
|
||||
if (!e.DataView().Contains(StandardDataFormats::StorageItems()))
|
||||
{
|
||||
// We can't do anything for non-storageitems right now.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2638,15 +2628,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
e.AcceptedOperation(DataPackageOperation::Copy);
|
||||
|
||||
// Sets custom UI text
|
||||
if (e.DataView().Contains(StandardDataFormats::StorageItems()))
|
||||
{
|
||||
e.DragUIOverride().Caption(RS_(L"DragFileCaption"));
|
||||
}
|
||||
else if (e.DataView().Contains(StandardDataFormats::Text()))
|
||||
{
|
||||
e.DragUIOverride().Caption(RS_(L"DragTextCaption"));
|
||||
}
|
||||
|
||||
e.DragUIOverride().Caption(RS_(L"DragFileCaption"));
|
||||
// Sets if the caption is visible
|
||||
e.DragUIOverride().IsCaptionVisible(true);
|
||||
// Sets if the dragged content is visible
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
|
||||
void _ApplyUISettings();
|
||||
void _InitializeBackgroundBrush();
|
||||
winrt::fire_and_forget _BackgroundColorChanged(const COLORREF color);
|
||||
winrt::fire_and_forget _BackgroundColorChanged(const uint32_t color);
|
||||
bool _InitializeTerminal();
|
||||
void _UpdateFont(const bool initialUpdate = false);
|
||||
void _SetFontSize(int fontSize);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
Microsoft namespace. This is, obviously, not great. None of our other
|
||||
projects compile properly when they depend on this "Microsoft.winmd."
|
||||
-->
|
||||
<CppWinRTNamespaceMergeDepth>4</CppWinRTNamespaceMergeDepth>
|
||||
<CppWinRTNamespaceMergeDepth>3</CppWinRTNamespaceMergeDepth>
|
||||
|
||||
<!--
|
||||
DON'T REDIRECT OUR OUTPUT.
|
||||
|
||||
@@ -875,7 +875,7 @@ void Terminal::SetCursorPositionChangedCallback(std::function<void()> pfn) noexc
|
||||
// - Allows setting a callback for when the background color is changed
|
||||
// Arguments:
|
||||
// - pfn: a function callback that takes a uint32 (DWORD COLORREF) color in the format 0x00BBGGRR
|
||||
void Terminal::SetBackgroundCallback(std::function<void(const COLORREF)> pfn) noexcept
|
||||
void Terminal::SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept
|
||||
{
|
||||
_pfnBackgroundColorChanged.swap(pfn);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
void SetTitleChangedCallback(std::function<void(const std::wstring_view&)> pfn) noexcept;
|
||||
void SetScrollPositionChangedCallback(std::function<void(const int, const int, const int)> pfn) noexcept;
|
||||
void SetCursorPositionChangedCallback(std::function<void()> pfn) noexcept;
|
||||
void SetBackgroundCallback(std::function<void(const COLORREF)> pfn) noexcept;
|
||||
void SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept;
|
||||
|
||||
void SetCursorOn(const bool isOn);
|
||||
bool IsCursorBlinkingAllowed() const noexcept;
|
||||
@@ -196,7 +196,7 @@ private:
|
||||
std::function<void(std::wstring&)> _pfnWriteInput;
|
||||
std::function<void(const std::wstring_view&)> _pfnTitleChanged;
|
||||
std::function<void(const int, const int, const int)> _pfnScrollPositionChanged;
|
||||
std::function<void(const COLORREF)> _pfnBackgroundColorChanged;
|
||||
std::function<void(const uint32_t)> _pfnBackgroundColorChanged;
|
||||
std::function<void()> _pfnCursorPositionChanged;
|
||||
|
||||
std::unique_ptr<::Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
|
||||
|
||||
@@ -44,7 +44,7 @@ bool Terminal::SetTextToDefaults(bool foreground, bool background) noexcept
|
||||
bool Terminal::SetTextForegroundIndex(BYTE colorIndex) noexcept
|
||||
{
|
||||
TextAttribute attrs = _buffer->GetCurrentAttributes();
|
||||
attrs.SetIndexedForeground(colorIndex);
|
||||
attrs.SetIndexedAttributes({ colorIndex }, {});
|
||||
_buffer->SetCurrentAttributes(attrs);
|
||||
return true;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ bool Terminal::SetTextForegroundIndex(BYTE colorIndex) noexcept
|
||||
bool Terminal::SetTextBackgroundIndex(BYTE colorIndex) noexcept
|
||||
{
|
||||
TextAttribute attrs = _buffer->GetCurrentAttributes();
|
||||
attrs.SetIndexedBackground(colorIndex);
|
||||
attrs.SetIndexedAttributes({}, { colorIndex });
|
||||
_buffer->SetCurrentAttributes(attrs);
|
||||
return true;
|
||||
}
|
||||
@@ -68,7 +68,14 @@ bool Terminal::SetTextRgbColor(COLORREF color, bool foreground) noexcept
|
||||
bool Terminal::BoldText(bool boldOn) noexcept
|
||||
{
|
||||
TextAttribute attrs = _buffer->GetCurrentAttributes();
|
||||
attrs.SetBold(boldOn);
|
||||
if (boldOn)
|
||||
{
|
||||
attrs.Embolden();
|
||||
}
|
||||
else
|
||||
{
|
||||
attrs.Debolden();
|
||||
}
|
||||
_buffer->SetCurrentAttributes(attrs);
|
||||
return true;
|
||||
}
|
||||
@@ -76,7 +83,11 @@ bool Terminal::BoldText(bool boldOn) noexcept
|
||||
bool Terminal::UnderlineText(bool underlineOn) noexcept
|
||||
{
|
||||
TextAttribute attrs = _buffer->GetCurrentAttributes();
|
||||
attrs.SetUnderline(underlineOn);
|
||||
WORD metaAttrs = attrs.GetMetaAttributes();
|
||||
|
||||
WI_UpdateFlag(metaAttrs, COMMON_LVB_UNDERSCORE, underlineOn);
|
||||
|
||||
attrs.SetMetaAttributes(metaAttrs);
|
||||
_buffer->SetCurrentAttributes(attrs);
|
||||
return true;
|
||||
}
|
||||
@@ -84,7 +95,11 @@ bool Terminal::UnderlineText(bool underlineOn) noexcept
|
||||
bool Terminal::ReverseText(bool reversed) noexcept
|
||||
{
|
||||
TextAttribute attrs = _buffer->GetCurrentAttributes();
|
||||
attrs.SetReverseVideo(reversed);
|
||||
WORD metaAttrs = attrs.GetMetaAttributes();
|
||||
|
||||
WI_UpdateFlag(metaAttrs, COMMON_LVB_REVERSE_VIDEO, reversed);
|
||||
|
||||
attrs.SetMetaAttributes(metaAttrs);
|
||||
_buffer->SetCurrentAttributes(attrs);
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user