mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-21 06:18:34 +00:00
Compare commits
24 Commits
dev/migrie
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f26774296 | ||
|
|
7855b804e9 | ||
|
|
327ddd7023 | ||
|
|
ff846d15a2 | ||
|
|
d4614bf041 | ||
|
|
847d878c5e | ||
|
|
4204d2535c | ||
|
|
e46ba65665 | ||
|
|
9767abd3f3 | ||
|
|
e1421ced89 | ||
|
|
361d4f559a | ||
|
|
9d34507a67 | ||
|
|
74feda108f | ||
|
|
ba91ae4eb8 | ||
|
|
420d7142fb | ||
|
|
267bb289a7 | ||
|
|
a064931f37 | ||
|
|
f77d47648b | ||
|
|
1a7d934ec9 | ||
|
|
6c869ebb26 | ||
|
|
88e843d474 | ||
|
|
7886f16714 | ||
|
|
7967e1740c | ||
|
|
744bc2190c |
@@ -1,17 +1,19 @@
|
|||||||
|
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: Align
|
AlignAfterOpenBracket: Align
|
||||||
#AllowAllArgumentsOnNextLine: false
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AlignConsecutiveMacros: false
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
AlignConsecutiveDeclarations: false
|
AlignConsecutiveDeclarations: false
|
||||||
#AllowAllConstructorInitializersOnNextLine: false
|
AllowAllConstructorInitializersOnNextLine: true
|
||||||
AlignEscapedNewlines: Left
|
AlignEscapedNewlines: Left
|
||||||
AlignOperands: true
|
AlignOperands: true
|
||||||
AlignTrailingComments: false
|
AlignTrailingComments: false
|
||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortFunctionsOnASingleLine: Inline
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
AllowShortIfStatementsOnASingleLine: false
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
#AllowShortLambdasOnASingleLine: Inline
|
#AllowShortLambdasOnASingleLine: Inline
|
||||||
AllowShortLoopsOnASingleLine: false
|
AllowShortLoopsOnASingleLine: false
|
||||||
AlwaysBreakAfterReturnType: None
|
AlwaysBreakAfterReturnType: None
|
||||||
@@ -20,6 +22,7 @@ AlwaysBreakTemplateDeclarations: Yes
|
|||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
BraceWrapping:
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: true
|
||||||
AfterClass: true
|
AfterClass: true
|
||||||
AfterControlStatement: true
|
AfterControlStatement: true
|
||||||
AfterEnum: true
|
AfterEnum: true
|
||||||
@@ -47,6 +50,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|||||||
ConstructorInitializerIndentWidth: 4
|
ConstructorInitializerIndentWidth: 4
|
||||||
ContinuationIndentWidth: 4
|
ContinuationIndentWidth: 4
|
||||||
Cpp11BracedListStyle: false
|
Cpp11BracedListStyle: false
|
||||||
|
DeriveLineEnding: true
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
FixNamespaceComments: false
|
FixNamespaceComments: false
|
||||||
IncludeBlocks: Regroup
|
IncludeBlocks: Regroup
|
||||||
@@ -73,7 +77,7 @@ ReflowComments: false
|
|||||||
SortIncludes: false
|
SortIncludes: false
|
||||||
SortUsingDeclarations: true
|
SortUsingDeclarations: true
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
#SpaceAfterLogicalNot: false
|
SpaceAfterLogicalNot: false
|
||||||
SpaceAfterTemplateKeyword: false
|
SpaceAfterTemplateKeyword: false
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
SpaceBeforeCpp11BracedList: false
|
SpaceBeforeCpp11BracedList: false
|
||||||
@@ -88,6 +92,6 @@ SpacesInCStyleCastParentheses: false
|
|||||||
SpacesInContainerLiterals: false
|
SpacesInContainerLiterals: false
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: Latest
|
||||||
TabWidth: 4
|
TabWidth: 4
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
|
|||||||
25
.github/actions/spell-check/advice.txt
vendored
25
.github/actions/spell-check/advice.txt
vendored
@@ -1,25 +0,0 @@
|
|||||||
<details>
|
|
||||||
<summary>
|
|
||||||
:pencil2: Contributor please read this
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
|
|
||||||
|
|
||||||
:warning: The command is written for posix shells. You can copy the contents of each `perl` command excluding the outer `'` marks and dropping any `'"`/`"'` quotation mark pairs into a file and then run `perl file.pl` from the root of the repository to run the code. Alternatively, you can manually insert the items...
|
|
||||||
|
|
||||||
If the listed items are:
|
|
||||||
* ... **misspelled**, then please *correct* them instead of using the command.
|
|
||||||
* ... *names*, please add them to `.github/actions/spell-check/dictionary/names.txt`.
|
|
||||||
* ... APIs, you can add them to a file in `.github/actions/spell-check/dictionary/`.
|
|
||||||
* ... just things you're using, please add them to an appropriate file in `.github/actions/spell-check/expect/`.
|
|
||||||
* ... tokens you only need in one place and shouldn't *generally be used*, you can add an item in an appropriate file in `.github/actions/spell-check/patterns/`.
|
|
||||||
|
|
||||||
See the `README.md` in each directory for more information.
|
|
||||||
|
|
||||||
:microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [:check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
#### :warning: Reviewers
|
|
||||||
At present, the action that triggered this message will not show its :x: in this PR unless the branch is within this repository.
|
|
||||||
Thus, you **should** make sure that this comment has been addressed before encouraging the merge bot to merge this PR.
|
|
||||||
54
.github/actions/spell-check/dictionary/apis.txt
vendored
54
.github/actions/spell-check/dictionary/apis.txt
vendored
@@ -1,54 +0,0 @@
|
|||||||
ACCEPTFILES
|
|
||||||
ACCESSDENIED
|
|
||||||
alignof
|
|
||||||
bitfield
|
|
||||||
bitfields
|
|
||||||
CLASSNOTAVAILABLE
|
|
||||||
environstrings
|
|
||||||
EXPCMDFLAGS
|
|
||||||
EXPCMDSTATE
|
|
||||||
fullkbd
|
|
||||||
futex
|
|
||||||
Hashtable
|
|
||||||
href
|
|
||||||
IAsync
|
|
||||||
IBind
|
|
||||||
IBox
|
|
||||||
IClass
|
|
||||||
IComparable
|
|
||||||
ICustom
|
|
||||||
IDialog
|
|
||||||
IDirect
|
|
||||||
IExplorer
|
|
||||||
IMap
|
|
||||||
IObject
|
|
||||||
IStorage
|
|
||||||
llabs
|
|
||||||
LCID
|
|
||||||
lround
|
|
||||||
LSHIFT
|
|
||||||
NCHITTEST
|
|
||||||
NCLBUTTONDBLCLK
|
|
||||||
NCRBUTTONDBLCLK
|
|
||||||
NOAGGREGATION
|
|
||||||
NOREDIRECTIONBITMAP
|
|
||||||
oaidl
|
|
||||||
ocidl
|
|
||||||
otms
|
|
||||||
OUTLINETEXTMETRICW
|
|
||||||
PAGESCROLL
|
|
||||||
RETURNCMD
|
|
||||||
rfind
|
|
||||||
roundf
|
|
||||||
RSHIFT
|
|
||||||
rx
|
|
||||||
serializer
|
|
||||||
SIZENS
|
|
||||||
spsc
|
|
||||||
STDCPP
|
|
||||||
syscall
|
|
||||||
tmp
|
|
||||||
tx
|
|
||||||
userenv
|
|
||||||
XDocument
|
|
||||||
XElement
|
|
||||||
479831
.github/actions/spell-check/dictionary/dictionary.txt
vendored
479831
.github/actions/spell-check/dictionary/dictionary.txt
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
|||||||
powf
|
|
||||||
sqrtf
|
|
||||||
isnan
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
ACLs
|
|
||||||
altform
|
|
||||||
appendwttlogging
|
|
||||||
backplating
|
|
||||||
DACL
|
|
||||||
DACLs
|
|
||||||
dotnetfeed
|
|
||||||
DWINRT
|
|
||||||
enablewttlogging
|
|
||||||
LKG
|
|
||||||
mfcribbon
|
|
||||||
microsoft
|
|
||||||
microsoftonline
|
|
||||||
netcore
|
|
||||||
osgvsowi
|
|
||||||
pgc
|
|
||||||
pgo
|
|
||||||
pgosweep
|
|
||||||
powerrename
|
|
||||||
powershell
|
|
||||||
pscustomobject
|
|
||||||
robocopy
|
|
||||||
SACLs
|
|
||||||
Shobjidl
|
|
||||||
Skype
|
|
||||||
sysnative
|
|
||||||
systemroot
|
|
||||||
taskkill
|
|
||||||
tasklist
|
|
||||||
tdbuildteamid
|
|
||||||
vcruntime
|
|
||||||
visualstudio
|
|
||||||
wlk
|
|
||||||
wslpath
|
|
||||||
wtl
|
|
||||||
wtt
|
|
||||||
wttlog
|
|
||||||
63
.github/actions/spell-check/excludes.txt
vendored
63
.github/actions/spell-check/excludes.txt
vendored
@@ -1,63 +0,0 @@
|
|||||||
(?:^|/)dirs$
|
|
||||||
(?:^|/)go\.mod$
|
|
||||||
(?:^|/)go\.sum$
|
|
||||||
(?:^|/)package-lock\.json$
|
|
||||||
(?:^|/)sources(?:|\.dep)$
|
|
||||||
SUMS$
|
|
||||||
\.ai$
|
|
||||||
\.bmp$
|
|
||||||
\.cer$
|
|
||||||
\.class$
|
|
||||||
\.crl$
|
|
||||||
\.crt$
|
|
||||||
\.csr$
|
|
||||||
\.dll$
|
|
||||||
\.DS_Store$
|
|
||||||
\.eot$
|
|
||||||
\.eps$
|
|
||||||
\.exe$
|
|
||||||
\.gif$
|
|
||||||
\.graffle$
|
|
||||||
\.gz$
|
|
||||||
\.icns$
|
|
||||||
\.ico$
|
|
||||||
\.jar$
|
|
||||||
\.jpeg$
|
|
||||||
\.jpg$
|
|
||||||
\.key$
|
|
||||||
\.lib$
|
|
||||||
\.lock$
|
|
||||||
\.map$
|
|
||||||
\.min\..
|
|
||||||
\.mp3$
|
|
||||||
\.mp4$
|
|
||||||
\.otf$
|
|
||||||
\.pbxproj$
|
|
||||||
\.pdf$
|
|
||||||
\.pem$
|
|
||||||
\.png$
|
|
||||||
\.psd$
|
|
||||||
\.runsettings$
|
|
||||||
\.sig$
|
|
||||||
\.so$
|
|
||||||
\.svg$
|
|
||||||
\.svgz$
|
|
||||||
\.tar$
|
|
||||||
\.tgz$
|
|
||||||
\.ttf$
|
|
||||||
\.woff
|
|
||||||
\.xcf$
|
|
||||||
\.xls
|
|
||||||
\.xpm$
|
|
||||||
\.yml$
|
|
||||||
\.zip$
|
|
||||||
^consolegit2gitfilters\.json$
|
|
||||||
^dep/
|
|
||||||
^oss/
|
|
||||||
^doc/reference/UTF8-torture-test\.txt$
|
|
||||||
^src/interactivity/onecore/BgfxEngine\.
|
|
||||||
^src/renderer/wddmcon/WddmConRenderer\.
|
|
||||||
^src/terminal/parser/ft_fuzzer/VTCommandFuzzer\.cpp$
|
|
||||||
^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$
|
|
||||||
^\.github/actions/spell-check/
|
|
||||||
^\.gitignore$
|
|
||||||
15
.github/actions/spell-check/expect/web.txt
vendored
15
.github/actions/spell-check/expect/web.txt
vendored
@@ -1,15 +0,0 @@
|
|||||||
http
|
|
||||||
td
|
|
||||||
www
|
|
||||||
ecma
|
|
||||||
rapidtables
|
|
||||||
WCAG
|
|
||||||
freedesktop
|
|
||||||
ycombinator
|
|
||||||
robertelder
|
|
||||||
kovidgoyal
|
|
||||||
leonerd
|
|
||||||
fixterms
|
|
||||||
uk
|
|
||||||
winui
|
|
||||||
appshellintegration
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]*
|
|
||||||
https://aka\.ms/[-a-zA-Z0-9?&=\/_]*
|
|
||||||
https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf
|
|
||||||
https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]*
|
|
||||||
https://www.w3.org/[-a-zA-Z0-9?&=\/_#]*
|
|
||||||
https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
|
||||||
https://[a-z-]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
|
||||||
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
|
||||||
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
|
||||||
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
|
||||||
microsoft/cascadia-code\@[0-9a-fA-F]{40}
|
|
||||||
\d+x\d+Logo
|
|
||||||
Scro\&ll
|
|
||||||
# selectionInput.cpp
|
|
||||||
:\\windows\\syste\b
|
|
||||||
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
|
|
||||||
(?:hostSm|mach)\.ProcessString\(L"[^"]+"
|
|
||||||
\b([A-Za-z])\1{3,}\b
|
|
||||||
Base64::s_(?:En|De)code\(L"[^"]+"
|
|
||||||
VERIFY_ARE_EQUAL\(L"[^"]+"
|
|
||||||
L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
|
|
||||||
std::memory_order_[\w]+
|
|
||||||
15
.github/actions/spelling/README.md
vendored
Normal file
15
.github/actions/spelling/README.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# check-spelling/check-spelling configuration
|
||||||
|
|
||||||
|
File | Purpose | Format | Info
|
||||||
|
-|-|-|-
|
||||||
|
[allow/*.txt](allow/) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow)
|
||||||
|
[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject)
|
||||||
|
[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
|
||||||
|
[patterns/*.txt](patterns/) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
|
||||||
|
[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns)
|
||||||
|
[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
|
||||||
|
[expect/*.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect)
|
||||||
|
[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)
|
||||||
|
|
||||||
|
Note: you can replace any of these files with a directory by the same name (minus the suffix)
|
||||||
|
and then include multiple files inside that directory (with that suffix) to merge multiple files together.
|
||||||
48
.github/actions/spelling/advice.md
vendored
Normal file
48
.github/actions/spelling/advice.md
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
:pencil2: Contributor please read this
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
|
||||||
|
|
||||||
|
:warning: The command is written for posix shells. If it doesn't work for you, you can manually _add_ (one word per line) / _remove_ items to `expect.txt` and the `excludes.txt` files.
|
||||||
|
|
||||||
|
If the listed items are:
|
||||||
|
|
||||||
|
* ... **misspelled**, then please *correct* them instead of using the command.
|
||||||
|
* ... *names*, please add them to `.github/actions/spelling/allow/names.txt`.
|
||||||
|
* ... APIs, you can add them to a file in `.github/actions/spelling/allow/`.
|
||||||
|
* ... just things you're using, please add them to an appropriate file in `.github/actions/spelling/expect/`.
|
||||||
|
* ... tokens you only need in one place and shouldn't *generally be used*, you can add an item in an appropriate file in `.github/actions/spelling/patterns/`.
|
||||||
|
|
||||||
|
See the `README.md` in each directory for more information.
|
||||||
|
|
||||||
|
:microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink:
|
||||||
|
|
||||||
|
|
||||||
|
<details><summary>If the flagged items are :exploding_head: false positives</summary>
|
||||||
|
|
||||||
|
If items relate to a ...
|
||||||
|
* binary file (or some other file you wouldn't want to check at all).
|
||||||
|
|
||||||
|
Please add a file path to the `excludes.txt` file matching the containing file.
|
||||||
|
|
||||||
|
File paths are Perl 5 Regular Expressions - you can [test](
|
||||||
|
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
|
||||||
|
|
||||||
|
`^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
|
||||||
|
../tree/HEAD/README.md) (on whichever branch you're using).
|
||||||
|
|
||||||
|
* well-formed pattern.
|
||||||
|
|
||||||
|
If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
|
||||||
|
try adding it to the `patterns.txt` file.
|
||||||
|
|
||||||
|
Patterns are Perl 5 Regular Expressions - you can [test](
|
||||||
|
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines.
|
||||||
|
|
||||||
|
Note that patterns can't match multiline strings.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
</details>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Dictionaries are lists of words to accept unconditionally
|
# Allow files are lists of words to accept unconditionally
|
||||||
|
|
||||||
While check spelling will complain about a whitelisted word
|
While check spelling will complain about an expected word
|
||||||
which is no longer present, you can include things here even if
|
which is no longer present, you can include things here even if
|
||||||
they are not otherwise present in the repository.
|
they are not otherwise present in the repository.
|
||||||
|
|
||||||
@@ -8,13 +8,14 @@ E.g., you could include a list of system APIs here, or potential
|
|||||||
contributors (so that if a future commit includes their name,
|
contributors (so that if a future commit includes their name,
|
||||||
it'll be accepted).
|
it'll be accepted).
|
||||||
|
|
||||||
### Files
|
## Files
|
||||||
|
|
||||||
| File | Description |
|
| File | Description |
|
||||||
| ---- | ----------- |
|
| ---- | ----------- |
|
||||||
| [Dictionary](dictionary.txt) | Primary US English dictionary |
|
| [Allow](allow.txt) | Supplements to the dictionary |
|
||||||
| [Chinese](chinese.txt) | Chinese words |
|
| [Chinese](chinese.txt) | Chinese words |
|
||||||
| [Japanese](japanese.txt) | Japanese words |
|
| [Japanese](japanese.txt) | Japanese words |
|
||||||
| [Microsoft](microsoft.txt) | Microsoft brand items |
|
| [Microsoft](microsoft.txt) | Microsoft brand items |
|
||||||
| [Fonts](fonts.txt) | Font names |
|
| [Fonts](fonts.txt) | Font names |
|
||||||
| [Names](names.txt) | Names of people |
|
| [Names](names.txt) | Names of people |
|
||||||
|
| [Colors](colors.txt) | Names of color |
|
||||||
108
.github/actions/spelling/allow/allow.txt
vendored
Normal file
108
.github/actions/spelling/allow/allow.txt
vendored
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
admins
|
||||||
|
allcolors
|
||||||
|
Apc
|
||||||
|
apc
|
||||||
|
breadcrumb
|
||||||
|
breadcrumbs
|
||||||
|
bsd
|
||||||
|
calt
|
||||||
|
ccmp
|
||||||
|
changelog
|
||||||
|
clickable
|
||||||
|
clig
|
||||||
|
CMMI
|
||||||
|
copyable
|
||||||
|
cybersecurity
|
||||||
|
dalet
|
||||||
|
Dcs
|
||||||
|
dcs
|
||||||
|
dialytika
|
||||||
|
dje
|
||||||
|
downside
|
||||||
|
downsides
|
||||||
|
dze
|
||||||
|
dzhe
|
||||||
|
EDDB
|
||||||
|
EDDC
|
||||||
|
Enum'd
|
||||||
|
Fitt
|
||||||
|
formattings
|
||||||
|
FTCS
|
||||||
|
ftp
|
||||||
|
fvar
|
||||||
|
gantt
|
||||||
|
gcc
|
||||||
|
geeksforgeeks
|
||||||
|
ghe
|
||||||
|
github
|
||||||
|
gje
|
||||||
|
godbolt
|
||||||
|
hostname
|
||||||
|
hostnames
|
||||||
|
https
|
||||||
|
hyperlink
|
||||||
|
hyperlinking
|
||||||
|
hyperlinks
|
||||||
|
iconify
|
||||||
|
img
|
||||||
|
inlined
|
||||||
|
It'd
|
||||||
|
kje
|
||||||
|
libfuzzer
|
||||||
|
libuv
|
||||||
|
liga
|
||||||
|
lje
|
||||||
|
Llast
|
||||||
|
llvm
|
||||||
|
Lmid
|
||||||
|
locl
|
||||||
|
lol
|
||||||
|
lorem
|
||||||
|
Lorigin
|
||||||
|
maxed
|
||||||
|
minimalistic
|
||||||
|
mkmk
|
||||||
|
mnt
|
||||||
|
mru
|
||||||
|
nje
|
||||||
|
noreply
|
||||||
|
ogonek
|
||||||
|
ok'd
|
||||||
|
overlined
|
||||||
|
pipeline
|
||||||
|
postmodern
|
||||||
|
ptys
|
||||||
|
qof
|
||||||
|
qps
|
||||||
|
rclt
|
||||||
|
reimplementation
|
||||||
|
reserialization
|
||||||
|
reserialize
|
||||||
|
reserializes
|
||||||
|
rlig
|
||||||
|
runtimes
|
||||||
|
shcha
|
||||||
|
slnt
|
||||||
|
Sos
|
||||||
|
ssh
|
||||||
|
timeline
|
||||||
|
timelines
|
||||||
|
timestamped
|
||||||
|
TLDR
|
||||||
|
tokenizes
|
||||||
|
tonos
|
||||||
|
toolset
|
||||||
|
tshe
|
||||||
|
ubuntu
|
||||||
|
uiatextrange
|
||||||
|
UIs
|
||||||
|
und
|
||||||
|
unregister
|
||||||
|
versioned
|
||||||
|
vsdevcmd
|
||||||
|
We'd
|
||||||
|
wildcards
|
||||||
|
XBox
|
||||||
|
YBox
|
||||||
|
yeru
|
||||||
|
zhe
|
||||||
248
.github/actions/spelling/allow/apis.txt
vendored
Normal file
248
.github/actions/spelling/allow/apis.txt
vendored
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
ACCEPTFILES
|
||||||
|
ACCESSDENIED
|
||||||
|
acl
|
||||||
|
aclapi
|
||||||
|
alignas
|
||||||
|
alignof
|
||||||
|
APPLYTOSUBMENUS
|
||||||
|
appxrecipe
|
||||||
|
bitfield
|
||||||
|
bitfields
|
||||||
|
BUILDBRANCH
|
||||||
|
BUILDMSG
|
||||||
|
BUILDNUMBER
|
||||||
|
BYCOMMAND
|
||||||
|
BYPOSITION
|
||||||
|
charconv
|
||||||
|
CLASSNOTAVAILABLE
|
||||||
|
CLOSEAPP
|
||||||
|
cmdletbinding
|
||||||
|
COLORPROPERTY
|
||||||
|
colspan
|
||||||
|
COMDLG
|
||||||
|
commandlinetoargv
|
||||||
|
comparand
|
||||||
|
cstdint
|
||||||
|
CXICON
|
||||||
|
CYICON
|
||||||
|
Dacl
|
||||||
|
dataobject
|
||||||
|
dcomp
|
||||||
|
DERR
|
||||||
|
dlldata
|
||||||
|
DNE
|
||||||
|
DONTADDTORECENT
|
||||||
|
DWMSBT
|
||||||
|
DWMWA
|
||||||
|
DWMWA
|
||||||
|
DWORDLONG
|
||||||
|
endfor
|
||||||
|
ENDSESSION
|
||||||
|
enumset
|
||||||
|
environstrings
|
||||||
|
EXPCMDFLAGS
|
||||||
|
EXPCMDSTATE
|
||||||
|
filetime
|
||||||
|
FILTERSPEC
|
||||||
|
FORCEFILESYSTEM
|
||||||
|
FORCEMINIMIZE
|
||||||
|
frac
|
||||||
|
fullkbd
|
||||||
|
futex
|
||||||
|
GETDESKWALLPAPER
|
||||||
|
GETHIGHCONTRAST
|
||||||
|
GETMOUSEHOVERTIME
|
||||||
|
Hashtable
|
||||||
|
HIGHCONTRASTON
|
||||||
|
HIGHCONTRASTW
|
||||||
|
hotkeys
|
||||||
|
href
|
||||||
|
hrgn
|
||||||
|
HTCLOSE
|
||||||
|
hwinsta
|
||||||
|
HWINSTA
|
||||||
|
IActivation
|
||||||
|
IApp
|
||||||
|
IAppearance
|
||||||
|
IAsync
|
||||||
|
IBind
|
||||||
|
IBox
|
||||||
|
IClass
|
||||||
|
IComparable
|
||||||
|
IComparer
|
||||||
|
IConnection
|
||||||
|
ICustom
|
||||||
|
IDialog
|
||||||
|
IDirect
|
||||||
|
IExplorer
|
||||||
|
IFACEMETHOD
|
||||||
|
IFile
|
||||||
|
IGraphics
|
||||||
|
IInheritable
|
||||||
|
IMap
|
||||||
|
IMonarch
|
||||||
|
IObject
|
||||||
|
iosfwd
|
||||||
|
IPackage
|
||||||
|
IPeasant
|
||||||
|
ISetup
|
||||||
|
isspace
|
||||||
|
IStorage
|
||||||
|
istream
|
||||||
|
IStringable
|
||||||
|
ITab
|
||||||
|
ITaskbar
|
||||||
|
itow
|
||||||
|
IUri
|
||||||
|
IVirtual
|
||||||
|
KEYSELECT
|
||||||
|
LCID
|
||||||
|
llabs
|
||||||
|
llu
|
||||||
|
localtime
|
||||||
|
lround
|
||||||
|
Lsa
|
||||||
|
lsass
|
||||||
|
LSHIFT
|
||||||
|
LTGRAY
|
||||||
|
MAINWINDOW
|
||||||
|
memchr
|
||||||
|
memicmp
|
||||||
|
MENUCOMMAND
|
||||||
|
MENUDATA
|
||||||
|
MENUINFO
|
||||||
|
MENUITEMINFOW
|
||||||
|
mmeapi
|
||||||
|
MOUSELEAVE
|
||||||
|
mov
|
||||||
|
mptt
|
||||||
|
msappx
|
||||||
|
MULTIPLEUSE
|
||||||
|
NCHITTEST
|
||||||
|
NCLBUTTONDBLCLK
|
||||||
|
NCMOUSELEAVE
|
||||||
|
NCMOUSEMOVE
|
||||||
|
NCRBUTTONDBLCLK
|
||||||
|
NIF
|
||||||
|
NIN
|
||||||
|
NOAGGREGATION
|
||||||
|
NOASYNC
|
||||||
|
NOCHANGEDIR
|
||||||
|
NOPROGRESS
|
||||||
|
NOREDIRECTIONBITMAP
|
||||||
|
NOREPEAT
|
||||||
|
NOTIFYBYPOS
|
||||||
|
NOTIFYICON
|
||||||
|
NOTIFYICONDATA
|
||||||
|
ntprivapi
|
||||||
|
oaidl
|
||||||
|
ocidl
|
||||||
|
ODR
|
||||||
|
offsetof
|
||||||
|
ofstream
|
||||||
|
onefuzz
|
||||||
|
osver
|
||||||
|
OSVERSIONINFOEXW
|
||||||
|
otms
|
||||||
|
OUTLINETEXTMETRICW
|
||||||
|
overridable
|
||||||
|
PACL
|
||||||
|
PAGESCROLL
|
||||||
|
PATINVERT
|
||||||
|
PEXPLICIT
|
||||||
|
PICKFOLDERS
|
||||||
|
pmr
|
||||||
|
ptstr
|
||||||
|
QUERYENDSESSION
|
||||||
|
rcx
|
||||||
|
REGCLS
|
||||||
|
RETURNCMD
|
||||||
|
rfind
|
||||||
|
ROOTOWNER
|
||||||
|
roundf
|
||||||
|
RSHIFT
|
||||||
|
SACL
|
||||||
|
schandle
|
||||||
|
semver
|
||||||
|
serializer
|
||||||
|
SETVERSION
|
||||||
|
SHELLEXECUTEINFOW
|
||||||
|
shobjidl
|
||||||
|
SHOWHIDE
|
||||||
|
SHOWMINIMIZED
|
||||||
|
SHOWTIP
|
||||||
|
SINGLEUSE
|
||||||
|
SIZENS
|
||||||
|
smoothstep
|
||||||
|
snprintf
|
||||||
|
spsc
|
||||||
|
sregex
|
||||||
|
SRWLOC
|
||||||
|
SRWLOCK
|
||||||
|
STDCPP
|
||||||
|
STDMETHOD
|
||||||
|
strchr
|
||||||
|
strcpy
|
||||||
|
streambuf
|
||||||
|
strtoul
|
||||||
|
Stubless
|
||||||
|
Subheader
|
||||||
|
Subpage
|
||||||
|
syscall
|
||||||
|
SYSTEMBACKDROP
|
||||||
|
TABROW
|
||||||
|
TASKBARCREATED
|
||||||
|
TBPF
|
||||||
|
THEMECHANGED
|
||||||
|
tlg
|
||||||
|
TME
|
||||||
|
tmp
|
||||||
|
tmpdir
|
||||||
|
tolower
|
||||||
|
toupper
|
||||||
|
TRACKMOUSEEVENT
|
||||||
|
TTask
|
||||||
|
TVal
|
||||||
|
UChar
|
||||||
|
UFIELD
|
||||||
|
ULARGE
|
||||||
|
UOI
|
||||||
|
UPDATEINIFILE
|
||||||
|
userenv
|
||||||
|
USEROBJECTFLAGS
|
||||||
|
Viewbox
|
||||||
|
virtualalloc
|
||||||
|
wcsstr
|
||||||
|
wcstoui
|
||||||
|
winmain
|
||||||
|
winsta
|
||||||
|
winstamin
|
||||||
|
wmemcmp
|
||||||
|
wpc
|
||||||
|
WSF
|
||||||
|
wsregex
|
||||||
|
wwinmain
|
||||||
|
xchg
|
||||||
|
XDocument
|
||||||
|
XElement
|
||||||
|
xfacet
|
||||||
|
xhash
|
||||||
|
XIcon
|
||||||
|
xiosbase
|
||||||
|
xlocale
|
||||||
|
xlocbuf
|
||||||
|
xlocinfo
|
||||||
|
xlocmes
|
||||||
|
xlocmon
|
||||||
|
xlocnum
|
||||||
|
xloctime
|
||||||
|
XMax
|
||||||
|
xmemory
|
||||||
|
XParse
|
||||||
|
xpath
|
||||||
|
xstddef
|
||||||
|
xstring
|
||||||
|
xtree
|
||||||
|
xutility
|
||||||
|
YIcon
|
||||||
|
YMax
|
||||||
117
.github/actions/spelling/allow/colors.txt
vendored
Normal file
117
.github/actions/spelling/allow/colors.txt
vendored
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
alice
|
||||||
|
aliceblue
|
||||||
|
antiquewhite
|
||||||
|
blanchedalmond
|
||||||
|
blueviolet
|
||||||
|
burlywood
|
||||||
|
cadetblue
|
||||||
|
cornflowerblue
|
||||||
|
cornsilk
|
||||||
|
cyan
|
||||||
|
darkblue
|
||||||
|
darkcyan
|
||||||
|
darkgoldenrod
|
||||||
|
darkgray
|
||||||
|
darkgreen
|
||||||
|
darkgrey
|
||||||
|
darkkhaki
|
||||||
|
darkmagenta
|
||||||
|
darkolivegreen
|
||||||
|
darkorange
|
||||||
|
darkorchid
|
||||||
|
darkred
|
||||||
|
darksalmon
|
||||||
|
darkseagreen
|
||||||
|
darkslateblue
|
||||||
|
darkslategray
|
||||||
|
darkslategrey
|
||||||
|
darkturquoise
|
||||||
|
darkviolet
|
||||||
|
deeppink
|
||||||
|
deepskyblue
|
||||||
|
dimgray
|
||||||
|
dimgrey
|
||||||
|
dodgerblue
|
||||||
|
firebrick
|
||||||
|
floralwhite
|
||||||
|
forestgreen
|
||||||
|
gainsboro
|
||||||
|
ghostwhite
|
||||||
|
greenyellow
|
||||||
|
hotpink
|
||||||
|
indian
|
||||||
|
indianred
|
||||||
|
lavenderblush
|
||||||
|
lawngreen
|
||||||
|
lemonchiffon
|
||||||
|
lightblue
|
||||||
|
lightcoral
|
||||||
|
lightcyan
|
||||||
|
lightgoldenrod
|
||||||
|
lightgoldenrodyellow
|
||||||
|
lightgray
|
||||||
|
lightgreen
|
||||||
|
lightgrey
|
||||||
|
lightpink
|
||||||
|
lightsalmon
|
||||||
|
lightseagreen
|
||||||
|
lightskyblue
|
||||||
|
lightslateblue
|
||||||
|
lightslategray
|
||||||
|
lightslategrey
|
||||||
|
lightsteelblue
|
||||||
|
lightyellow
|
||||||
|
limegreen
|
||||||
|
mediumaquamarine
|
||||||
|
mediumblue
|
||||||
|
mediumorchid
|
||||||
|
mediumpurple
|
||||||
|
mediumseagreen
|
||||||
|
mediumslateblue
|
||||||
|
mediumspringgreen
|
||||||
|
mediumturquoise
|
||||||
|
mediumvioletred
|
||||||
|
midnightblue
|
||||||
|
mintcream
|
||||||
|
mistyrose
|
||||||
|
navajo
|
||||||
|
navajowhite
|
||||||
|
navyblue
|
||||||
|
oldlace
|
||||||
|
olivedrab
|
||||||
|
orangered
|
||||||
|
palegoldenrod
|
||||||
|
palegreen
|
||||||
|
paleturquoise
|
||||||
|
palevioletred
|
||||||
|
papayawhip
|
||||||
|
peachpuff
|
||||||
|
peru
|
||||||
|
powderblue
|
||||||
|
rebecca
|
||||||
|
rebeccapurple
|
||||||
|
rosybrown
|
||||||
|
royalblue
|
||||||
|
saddlebrown
|
||||||
|
sandybrown
|
||||||
|
seagreen
|
||||||
|
sienna
|
||||||
|
skyblue
|
||||||
|
slateblue
|
||||||
|
slategray
|
||||||
|
slategrey
|
||||||
|
springgreen
|
||||||
|
steelblue
|
||||||
|
violetred
|
||||||
|
webgray
|
||||||
|
webgreen
|
||||||
|
webgrey
|
||||||
|
webmaroon
|
||||||
|
webpurple
|
||||||
|
whitesmoke
|
||||||
|
xaroon
|
||||||
|
xray
|
||||||
|
xreen
|
||||||
|
xrey
|
||||||
|
xurple
|
||||||
|
yellowgreen
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
Consolas
|
Consolas
|
||||||
emoji
|
emoji
|
||||||
|
emojis
|
||||||
Extralight
|
Extralight
|
||||||
Gabriola
|
Gabriola
|
||||||
Iosevka
|
Iosevka
|
||||||
MDL
|
MDL
|
||||||
Monofur
|
Monofur
|
||||||
Segoe
|
Segoe
|
||||||
|
wght
|
||||||
11
.github/actions/spelling/allow/math.txt
vendored
Normal file
11
.github/actions/spelling/allow/math.txt
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
atan
|
||||||
|
CPrime
|
||||||
|
HBar
|
||||||
|
HPrime
|
||||||
|
isnan
|
||||||
|
LPrime
|
||||||
|
LStep
|
||||||
|
powf
|
||||||
|
RSub
|
||||||
|
sqrtf
|
||||||
|
ULP
|
||||||
85
.github/actions/spelling/allow/microsoft.txt
vendored
Normal file
85
.github/actions/spelling/allow/microsoft.txt
vendored
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
ACLs
|
||||||
|
ADMINS
|
||||||
|
advapi
|
||||||
|
altform
|
||||||
|
altforms
|
||||||
|
appendwttlogging
|
||||||
|
appx
|
||||||
|
appxbundle
|
||||||
|
appxerror
|
||||||
|
appxmanifest
|
||||||
|
ATL
|
||||||
|
backplating
|
||||||
|
bitmaps
|
||||||
|
BOMs
|
||||||
|
CPLs
|
||||||
|
cpptools
|
||||||
|
cppvsdbg
|
||||||
|
CPRs
|
||||||
|
cryptbase
|
||||||
|
DACL
|
||||||
|
DACLs
|
||||||
|
defaultlib
|
||||||
|
diffs
|
||||||
|
disposables
|
||||||
|
dotnetfeed
|
||||||
|
DTDs
|
||||||
|
DWINRT
|
||||||
|
enablewttlogging
|
||||||
|
Intelli
|
||||||
|
IVisual
|
||||||
|
libucrt
|
||||||
|
libucrtd
|
||||||
|
LKG
|
||||||
|
LOCKFILE
|
||||||
|
Lxss
|
||||||
|
mfcribbon
|
||||||
|
microsoft
|
||||||
|
microsoftonline
|
||||||
|
MSAA
|
||||||
|
msixbundle
|
||||||
|
MSVC
|
||||||
|
MSVCP
|
||||||
|
muxc
|
||||||
|
netcore
|
||||||
|
Onefuzz
|
||||||
|
osgvsowi
|
||||||
|
PFILETIME
|
||||||
|
pgc
|
||||||
|
pgo
|
||||||
|
pgosweep
|
||||||
|
powerrename
|
||||||
|
powershell
|
||||||
|
propkey
|
||||||
|
pscustomobject
|
||||||
|
QWORD
|
||||||
|
regedit
|
||||||
|
robocopy
|
||||||
|
SACLs
|
||||||
|
sdkddkver
|
||||||
|
Shobjidl
|
||||||
|
Skype
|
||||||
|
SRW
|
||||||
|
sxs
|
||||||
|
Sysinternals
|
||||||
|
sysnative
|
||||||
|
systemroot
|
||||||
|
taskkill
|
||||||
|
tasklist
|
||||||
|
tdbuildteamid
|
||||||
|
ucrt
|
||||||
|
ucrtd
|
||||||
|
unvirtualized
|
||||||
|
VCRT
|
||||||
|
vcruntime
|
||||||
|
Virtualization
|
||||||
|
visualstudio
|
||||||
|
vscode
|
||||||
|
VSTHRD
|
||||||
|
winsdkver
|
||||||
|
wlk
|
||||||
|
wslpath
|
||||||
|
wtl
|
||||||
|
wtt
|
||||||
|
wttlog
|
||||||
|
Xamarin
|
||||||
@@ -1,44 +1,66 @@
|
|||||||
Anup
|
Anup
|
||||||
austdi
|
austdi
|
||||||
|
arkthur
|
||||||
Ballmer
|
Ballmer
|
||||||
bhoj
|
bhoj
|
||||||
Bhojwani
|
Bhojwani
|
||||||
|
Bluloco
|
||||||
carlos
|
carlos
|
||||||
dhowett
|
dhowett
|
||||||
Diviness
|
Diviness
|
||||||
dsafa
|
dsafa
|
||||||
duhowett
|
duhowett
|
||||||
|
DXP
|
||||||
|
ekg
|
||||||
|
eryksun
|
||||||
ethanschoonover
|
ethanschoonover
|
||||||
Firefox
|
Firefox
|
||||||
Gatta
|
Gatta
|
||||||
|
glsl
|
||||||
|
Gravell
|
||||||
Grie
|
Grie
|
||||||
Griese
|
Griese
|
||||||
Hernan
|
Hernan
|
||||||
Howett
|
Howett
|
||||||
Illhardt
|
Illhardt
|
||||||
|
iquilezles
|
||||||
|
italo
|
||||||
jantari
|
jantari
|
||||||
jerrysh
|
jerrysh
|
||||||
Kaiyu
|
Kaiyu
|
||||||
kimwalisch
|
kimwalisch
|
||||||
KMehrain
|
KMehrain
|
||||||
|
KODELIFE
|
||||||
|
Kodelife
|
||||||
Kourosh
|
Kourosh
|
||||||
kowalczyk
|
kowalczyk
|
||||||
leonmsft
|
leonmsft
|
||||||
Lepilleur
|
Lepilleur
|
||||||
|
lhecker
|
||||||
lukesampson
|
lukesampson
|
||||||
|
Macbook
|
||||||
Manandhar
|
Manandhar
|
||||||
|
masserano
|
||||||
mbadolato
|
mbadolato
|
||||||
Mehrain
|
Mehrain
|
||||||
|
menger
|
||||||
mgravell
|
mgravell
|
||||||
michaelniksa
|
michaelniksa
|
||||||
|
michkap
|
||||||
migrie
|
migrie
|
||||||
mikegr
|
mikegr
|
||||||
mikemaccana
|
mikemaccana
|
||||||
|
miloush
|
||||||
miniksa
|
miniksa
|
||||||
niksa
|
niksa
|
||||||
|
nvaccess
|
||||||
|
nvda
|
||||||
oising
|
oising
|
||||||
oldnewthing
|
oldnewthing
|
||||||
|
opengl
|
||||||
osgwiki
|
osgwiki
|
||||||
|
pabhojwa
|
||||||
|
panos
|
||||||
paulcam
|
paulcam
|
||||||
pauldotknopf
|
pauldotknopf
|
||||||
PGP
|
PGP
|
||||||
@@ -46,11 +68,18 @@ Pham
|
|||||||
Rincewind
|
Rincewind
|
||||||
rprichard
|
rprichard
|
||||||
Schoonover
|
Schoonover
|
||||||
|
shadertoy
|
||||||
|
Shomnipotence
|
||||||
|
simioni
|
||||||
Somuah
|
Somuah
|
||||||
sonph
|
sonph
|
||||||
sonpham
|
sonpham
|
||||||
stakx
|
stakx
|
||||||
|
talo
|
||||||
|
thereses
|
||||||
Walisch
|
Walisch
|
||||||
|
WDX
|
||||||
|
Wellons
|
||||||
Wirt
|
Wirt
|
||||||
Wojciech
|
Wojciech
|
||||||
zadjii
|
zadjii
|
||||||
523
.github/actions/spelling/candidate.patterns
vendored
Normal file
523
.github/actions/spelling/candidate.patterns
vendored
Normal file
@@ -0,0 +1,523 @@
|
|||||||
|
# marker to ignore all code on line
|
||||||
|
^.*/\* #no-spell-check-line \*/.*$
|
||||||
|
# marker for ignoring a comment to the end of the line
|
||||||
|
// #no-spell-check.*$
|
||||||
|
|
||||||
|
# patch hunk comments
|
||||||
|
^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .*
|
||||||
|
# git index header
|
||||||
|
index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
|
||||||
|
|
||||||
|
# cid urls
|
||||||
|
(['"])cid:.*?\g{-1}
|
||||||
|
|
||||||
|
# data url in parens
|
||||||
|
\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\)
|
||||||
|
# data url in quotes
|
||||||
|
([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1}
|
||||||
|
# data url
|
||||||
|
data:[-a-zA-Z=;:/0-9+]*,\S*
|
||||||
|
|
||||||
|
# mailto urls
|
||||||
|
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
|
||||||
|
|
||||||
|
# magnet urls
|
||||||
|
magnet:[?=:\w]+
|
||||||
|
|
||||||
|
# magnet urls
|
||||||
|
"magnet:[^"]+"
|
||||||
|
|
||||||
|
# obs:
|
||||||
|
"obs:[^"]*"
|
||||||
|
|
||||||
|
# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read
|
||||||
|
# In this examples content, I'm using a number of different ways to match things to show various approaches
|
||||||
|
# asciinema
|
||||||
|
\basciinema\.org/a/[0-9a-zA-Z]+
|
||||||
|
|
||||||
|
# apple
|
||||||
|
\bdeveloper\.apple\.com/[-\w?=/]+
|
||||||
|
# Apple music
|
||||||
|
\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+
|
||||||
|
|
||||||
|
# appveyor api
|
||||||
|
\bci\.appveyor\.com/api/projects/status/[0-9a-z]+
|
||||||
|
# appveyor project
|
||||||
|
\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+
|
||||||
|
|
||||||
|
# Amazon
|
||||||
|
|
||||||
|
# Amazon
|
||||||
|
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
|
||||||
|
# AWS S3
|
||||||
|
\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]*
|
||||||
|
# AWS execute-api
|
||||||
|
\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b
|
||||||
|
# AWS ELB
|
||||||
|
\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b
|
||||||
|
# AWS SNS
|
||||||
|
\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]*
|
||||||
|
# AWS VPC
|
||||||
|
vpc-\w+
|
||||||
|
|
||||||
|
# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there
|
||||||
|
# YouTube url
|
||||||
|
\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]*
|
||||||
|
# YouTube music
|
||||||
|
\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*)
|
||||||
|
# YouTube tag
|
||||||
|
<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"]
|
||||||
|
# YouTube image
|
||||||
|
\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]*
|
||||||
|
# Google Accounts
|
||||||
|
\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]*
|
||||||
|
# Google Analytics
|
||||||
|
\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]*
|
||||||
|
# Google APIs
|
||||||
|
\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+
|
||||||
|
# Google Storage
|
||||||
|
\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|)
|
||||||
|
# Google Calendar
|
||||||
|
\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+
|
||||||
|
\w+\@group\.calendar\.google\.com\b
|
||||||
|
# Google DataStudio
|
||||||
|
\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|)
|
||||||
|
# The leading `/` here is as opposed to the `\b` above
|
||||||
|
# ... a short way to match `https://` or `http://` since most urls have one of those prefixes
|
||||||
|
# Google Docs
|
||||||
|
/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|))
|
||||||
|
# Google Drive
|
||||||
|
\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]*
|
||||||
|
# Google Groups
|
||||||
|
\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)*
|
||||||
|
# Google Maps
|
||||||
|
\bmaps\.google\.com/maps\?[\w&;=]*
|
||||||
|
# Google themes
|
||||||
|
themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+.
|
||||||
|
# Google CDN
|
||||||
|
\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]*
|
||||||
|
# Goo.gl
|
||||||
|
/goo\.gl/[a-zA-Z0-9]+
|
||||||
|
# Google Chrome Store
|
||||||
|
\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|)
|
||||||
|
# Google Books
|
||||||
|
\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]*
|
||||||
|
# Google Fonts
|
||||||
|
\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]*
|
||||||
|
# Google Forms
|
||||||
|
\bforms\.gle/\w+
|
||||||
|
# Google Scholar
|
||||||
|
\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+
|
||||||
|
# Google Colab Research Drive
|
||||||
|
\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]*
|
||||||
|
|
||||||
|
# GitHub SHAs (api)
|
||||||
|
\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b
|
||||||
|
# GitHub SHAs (markdown)
|
||||||
|
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)
|
||||||
|
# GitHub SHAs
|
||||||
|
\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b
|
||||||
|
# GitHub wiki
|
||||||
|
\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b
|
||||||
|
# githubusercontent
|
||||||
|
/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
||||||
|
# githubassets
|
||||||
|
\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+)
|
||||||
|
# gist github
|
||||||
|
\bgist\.github\.com/[^/\s"]+/[0-9a-f]+
|
||||||
|
# git.io
|
||||||
|
\bgit\.io/[0-9a-zA-Z]+
|
||||||
|
# GitHub JSON
|
||||||
|
"node_id": "[-a-zA-Z=;:/0-9+]*"
|
||||||
|
# Contributor
|
||||||
|
\[[^\]]+\]\(https://github\.com/[^/\s"]+\)
|
||||||
|
# GHSA
|
||||||
|
GHSA(?:-[0-9a-z]{4}){3}
|
||||||
|
|
||||||
|
# GitLab commit
|
||||||
|
\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b
|
||||||
|
# GitLab merge requests
|
||||||
|
\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b
|
||||||
|
# GitLab uploads
|
||||||
|
\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]*
|
||||||
|
# GitLab commits
|
||||||
|
\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b
|
||||||
|
|
||||||
|
# binanace
|
||||||
|
accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
|
||||||
|
|
||||||
|
# bitbucket diff
|
||||||
|
\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+
|
||||||
|
# bitbucket repositories commits
|
||||||
|
\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+
|
||||||
|
# bitbucket commits
|
||||||
|
\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+
|
||||||
|
|
||||||
|
# bit.ly
|
||||||
|
\bbit\.ly/\w+
|
||||||
|
|
||||||
|
# bitrise
|
||||||
|
\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]*
|
||||||
|
|
||||||
|
# bootstrapcdn.com
|
||||||
|
\bbootstrapcdn\.com/[-./\w]+
|
||||||
|
|
||||||
|
# cdn.cloudflare.com
|
||||||
|
\bcdnjs\.cloudflare\.com/[./\w]+
|
||||||
|
|
||||||
|
# circleci
|
||||||
|
\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+
|
||||||
|
|
||||||
|
# gitter
|
||||||
|
\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+
|
||||||
|
|
||||||
|
# gravatar
|
||||||
|
\bgravatar\.com/avatar/[0-9a-f]+
|
||||||
|
|
||||||
|
# ibm
|
||||||
|
[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]*
|
||||||
|
|
||||||
|
# imgur
|
||||||
|
\bimgur\.com/[^.]+
|
||||||
|
|
||||||
|
# Internet Archive
|
||||||
|
\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*)
|
||||||
|
|
||||||
|
# discord
|
||||||
|
/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,}
|
||||||
|
|
||||||
|
# Disqus
|
||||||
|
\bdisqus\.com/[-\w/%.()!?&=_]*
|
||||||
|
|
||||||
|
# medium link
|
||||||
|
\blink\.medium\.com/[a-zA-Z0-9]+
|
||||||
|
# medium
|
||||||
|
\bmedium\.com/\@?[^/\s"]+/[-\w]+
|
||||||
|
|
||||||
|
# microsoft
|
||||||
|
\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]*
|
||||||
|
# powerbi
|
||||||
|
\bapp\.powerbi\.com/reportEmbed/[^"' ]*
|
||||||
|
# vs devops
|
||||||
|
\bvisualstudio.com(?::443|)/[-\w/?=%&.]*
|
||||||
|
# microsoft store
|
||||||
|
\bmicrosoft\.com/store/apps/\w+
|
||||||
|
|
||||||
|
# mvnrepository.com
|
||||||
|
\bmvnrepository\.com/[-0-9a-z./]+
|
||||||
|
|
||||||
|
# now.sh
|
||||||
|
/[0-9a-z-.]+\.now\.sh\b
|
||||||
|
|
||||||
|
# oracle
|
||||||
|
\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]*
|
||||||
|
|
||||||
|
# chromatic.com
|
||||||
|
/\S+.chromatic.com\S*[")]
|
||||||
|
|
||||||
|
# codacy
|
||||||
|
\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+
|
||||||
|
|
||||||
|
# compai
|
||||||
|
\bcompai\.pub/v1/png/[0-9a-f]+
|
||||||
|
|
||||||
|
# mailgun api
|
||||||
|
\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]*
|
||||||
|
# mailgun
|
||||||
|
\b[0-9a-z]+.mailgun.org
|
||||||
|
|
||||||
|
# /message-id/
|
||||||
|
/message-id/[-\w@./%]+
|
||||||
|
|
||||||
|
# Reddit
|
||||||
|
\breddit\.com/r/[/\w_]*
|
||||||
|
|
||||||
|
# requestb.in
|
||||||
|
\brequestb\.in/[0-9a-z]+
|
||||||
|
|
||||||
|
# sched
|
||||||
|
\b[a-z0-9]+\.sched\.com\b
|
||||||
|
|
||||||
|
# Slack url
|
||||||
|
slack://[a-zA-Z0-9?&=]+
|
||||||
|
# Slack
|
||||||
|
\bslack\.com/[-0-9a-zA-Z/_~?&=.]*
|
||||||
|
# Slack edge
|
||||||
|
\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+
|
||||||
|
# Slack images
|
||||||
|
\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+
|
||||||
|
|
||||||
|
# shields.io
|
||||||
|
\bshields\.io/[-\w/%?=&.:+;,]*
|
||||||
|
|
||||||
|
# stackexchange -- https://stackexchange.com/feeds/sites
|
||||||
|
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/)
|
||||||
|
|
||||||
|
# Sentry
|
||||||
|
[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b
|
||||||
|
|
||||||
|
# Twitter markdown
|
||||||
|
\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\)
|
||||||
|
# Twitter hashtag
|
||||||
|
\btwitter\.com/hashtag/[\w?_=&]*
|
||||||
|
# Twitter status
|
||||||
|
\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)
|
||||||
|
# Twitter profile images
|
||||||
|
\btwimg\.com/profile_images/[_\w./]*
|
||||||
|
# Twitter media
|
||||||
|
\btwimg\.com/media/[-_\w./?=]*
|
||||||
|
# Twitter link shortened
|
||||||
|
\bt\.co/\w+
|
||||||
|
|
||||||
|
# facebook
|
||||||
|
\bfburl\.com/[0-9a-z_]+
|
||||||
|
# facebook CDN
|
||||||
|
\bfbcdn\.net/[\w/.,]*
|
||||||
|
# facebook watch
|
||||||
|
\bfb\.watch/[0-9A-Za-z]+
|
||||||
|
|
||||||
|
# dropbox
|
||||||
|
\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+
|
||||||
|
|
||||||
|
# ipfs protocol
|
||||||
|
ipfs://[0-9a-z]*
|
||||||
|
# ipfs url
|
||||||
|
/ipfs/[0-9a-z]*
|
||||||
|
|
||||||
|
# w3
|
||||||
|
\bw3\.org/[-0-9a-zA-Z/#.]+
|
||||||
|
|
||||||
|
# loom
|
||||||
|
\bloom\.com/embed/[0-9a-f]+
|
||||||
|
|
||||||
|
# regex101
|
||||||
|
\bregex101\.com/r/[^/\s"]+/\d+
|
||||||
|
|
||||||
|
# figma
|
||||||
|
\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+
|
||||||
|
|
||||||
|
# freecodecamp.org
|
||||||
|
\bfreecodecamp\.org/[-\w/.]+
|
||||||
|
|
||||||
|
# image.tmdb.org
|
||||||
|
\bimage\.tmdb\.org/[/\w.]+
|
||||||
|
|
||||||
|
# mermaid
|
||||||
|
\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+
|
||||||
|
|
||||||
|
# Wikipedia
|
||||||
|
\ben\.wikipedia\.org/wiki/[-\w%.#]+
|
||||||
|
|
||||||
|
# gitweb
|
||||||
|
[^"\s]+/gitweb/\S+;h=[0-9a-f]+
|
||||||
|
|
||||||
|
# HyperKitty lists
|
||||||
|
/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/
|
||||||
|
|
||||||
|
# lists
|
||||||
|
/thread\.html/[^"\s]+
|
||||||
|
|
||||||
|
# list-management
|
||||||
|
\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+
|
||||||
|
|
||||||
|
# kubectl.kubernetes.io/last-applied-configuration
|
||||||
|
"kubectl.kubernetes.io/last-applied-configuration": ".*"
|
||||||
|
|
||||||
|
# pgp
|
||||||
|
\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]*
|
||||||
|
|
||||||
|
# Spotify
|
||||||
|
\bopen\.spotify\.com/embed/playlist/\w+
|
||||||
|
|
||||||
|
# Mastodon
|
||||||
|
\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]*
|
||||||
|
|
||||||
|
# scastie
|
||||||
|
\bscastie\.scala-lang\.org/[^/]+/\w+
|
||||||
|
|
||||||
|
# images.unsplash.com
|
||||||
|
\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+
|
||||||
|
|
||||||
|
# pastebin
|
||||||
|
\bpastebin\.com/[\w/]+
|
||||||
|
|
||||||
|
# heroku
|
||||||
|
\b\w+\.heroku\.com/source/archive/\w+
|
||||||
|
|
||||||
|
# quip
|
||||||
|
\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)?
|
||||||
|
|
||||||
|
# badgen.net
|
||||||
|
\bbadgen\.net/badge/[^")\]'\s]+
|
||||||
|
|
||||||
|
# statuspage.io
|
||||||
|
\w+\.statuspage\.io\b
|
||||||
|
|
||||||
|
# media.giphy.com
|
||||||
|
\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+
|
||||||
|
|
||||||
|
# tinyurl
|
||||||
|
\btinyurl\.com/\w+
|
||||||
|
|
||||||
|
# getopts
|
||||||
|
\bgetopts\s+(?:"[^"]+"|'[^']+')
|
||||||
|
|
||||||
|
# ANSI color codes
|
||||||
|
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
|
||||||
|
|
||||||
|
# URL escaped characters
|
||||||
|
\%[0-9A-F][A-F]
|
||||||
|
# IPv6
|
||||||
|
\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b
|
||||||
|
# c99 hex digits (not the full format, just one I've seen)
|
||||||
|
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
|
||||||
|
# Punycode
|
||||||
|
\bxn--[-0-9a-z]+
|
||||||
|
# sha
|
||||||
|
sha\d+:[0-9]*[a-f]{3,}[0-9a-f]*
|
||||||
|
# sha-... -- uses a fancy capture
|
||||||
|
(['"]|")[0-9a-f]{40,}\g{-1}
|
||||||
|
# hex runs
|
||||||
|
\b[0-9a-fA-F]{16,}\b
|
||||||
|
# hex in url queries
|
||||||
|
=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?&
|
||||||
|
# ssh
|
||||||
|
(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,}
|
||||||
|
|
||||||
|
# PGP
|
||||||
|
\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b
|
||||||
|
# GPG keys
|
||||||
|
\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b
|
||||||
|
# Well known gpg keys
|
||||||
|
.well-known/openpgpkey/[\w./]+
|
||||||
|
|
||||||
|
# uuid:
|
||||||
|
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
|
||||||
|
# hex digits including css/html color classes:
|
||||||
|
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
|
||||||
|
# integrity
|
||||||
|
integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}"
|
||||||
|
|
||||||
|
# https://www.gnu.org/software/groff/manual/groff.html
|
||||||
|
# man troff content
|
||||||
|
\\f[BCIPR]
|
||||||
|
# '
|
||||||
|
\\\(aq
|
||||||
|
|
||||||
|
# .desktop mime types
|
||||||
|
^MimeTypes?=.*$
|
||||||
|
# .desktop localized entries
|
||||||
|
^[A-Z][a-z]+\[[a-z]+\]=.*$
|
||||||
|
# Localized .desktop content
|
||||||
|
Name\[[^\]]+\]=.*
|
||||||
|
|
||||||
|
# IServiceProvider
|
||||||
|
\bI(?=(?:[A-Z][a-z]{2,})+\b)
|
||||||
|
|
||||||
|
# crypt
|
||||||
|
"\$2[ayb]\$.{56}"
|
||||||
|
|
||||||
|
# scrypt / argon
|
||||||
|
\$(?:scrypt|argon\d+[di]*)\$\S+
|
||||||
|
|
||||||
|
# Input to GitHub JSON
|
||||||
|
content: "[-a-zA-Z=;:/0-9+]*="
|
||||||
|
|
||||||
|
# Python stringprefix / binaryprefix
|
||||||
|
# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings
|
||||||
|
(?<!')\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})
|
||||||
|
|
||||||
|
# Regular expressions for (P|p)assword
|
||||||
|
\([A-Z]\|[a-z]\)[a-z]+
|
||||||
|
|
||||||
|
# JavaScript regular expressions
|
||||||
|
# javascript test regex
|
||||||
|
/.*/[gim]*\.test\(
|
||||||
|
# javascript match regex
|
||||||
|
\.match\(/[^/\s"]*/[gim]*\s*
|
||||||
|
# javascript match regex
|
||||||
|
\.match\(/\\[b].*?/[gim]*\s*\)(?:;|$)
|
||||||
|
# javascript regex
|
||||||
|
^\s*/\\[b].*/[gim]*\s*(?:\)(?:;|$)|,$)
|
||||||
|
# javascript replace regex
|
||||||
|
\.replace\(/[^/\s"]*/[gim]*\s*,
|
||||||
|
|
||||||
|
# Go regular expressions
|
||||||
|
regexp?\.MustCompile\(`[^`]*`\)
|
||||||
|
|
||||||
|
# sed regular expressions
|
||||||
|
sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2}
|
||||||
|
|
||||||
|
# go install
|
||||||
|
go install(?:\s+[a-z]+\.[-@\w/.]+)+
|
||||||
|
|
||||||
|
# kubernetes pod status lists
|
||||||
|
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
|
||||||
|
\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+
|
||||||
|
|
||||||
|
# kubectl - pods in CrashLoopBackOff
|
||||||
|
\w+-[0-9a-f]+-\w+\s+\d+/\d+\s+CrashLoopBackOff\s+
|
||||||
|
|
||||||
|
# kubernetes object suffix
|
||||||
|
-[0-9a-f]{10}-\w{5}\s
|
||||||
|
|
||||||
|
# posthog secrets
|
||||||
|
posthog\.init\((['"])phc_[^"',]+\g{-1},
|
||||||
|
|
||||||
|
# xcode
|
||||||
|
|
||||||
|
# xcodeproject scenes
|
||||||
|
(?:Controller|ID|id)="\w{3}-\w{2}-\w{3}"
|
||||||
|
|
||||||
|
# xcode api botches
|
||||||
|
customObjectInstantitationMethod
|
||||||
|
|
||||||
|
# font awesome classes
|
||||||
|
\.fa-[-a-z0-9]+
|
||||||
|
|
||||||
|
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
|
||||||
|
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
|
||||||
|
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
|
||||||
|
## Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary).
|
||||||
|
## You could manually change `(?i)X...` to use `[Xx]...`
|
||||||
|
## or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path)
|
||||||
|
# Lorem
|
||||||
|
(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*
|
||||||
|
|
||||||
|
# Non-English
|
||||||
|
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
|
||||||
|
|
||||||
|
# French
|
||||||
|
# This corpus only had capital letters, but you probably want lowercase ones as well.
|
||||||
|
\b[LN]'+[a-z]{2,}\b
|
||||||
|
|
||||||
|
# latex
|
||||||
|
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
|
||||||
|
|
||||||
|
# the negative lookahead here is to allow catching 'templatesz' as a misspelling
|
||||||
|
# but to otherwise recognize a Windows path with \templates\foo.template or similar:
|
||||||
|
\\(?:necessary|r(?:eport|esolve[dr]?|esult)|t(?:arget|emplates?))(?![a-z])
|
||||||
|
# ignore long runs of a single character:
|
||||||
|
\b([A-Za-z])\g{-1}{3,}\b
|
||||||
|
# Note that the next example is no longer necessary if you are using
|
||||||
|
# to match a string starting with a `#`, use a character-class:
|
||||||
|
[#]backwards
|
||||||
|
# version suffix <word>v#
|
||||||
|
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
||||||
|
# Compiler flags (Scala)
|
||||||
|
(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||||
|
# Compiler flags
|
||||||
|
#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||||
|
|
||||||
|
# Compiler flags (linker)
|
||||||
|
,-B
|
||||||
|
# curl arguments
|
||||||
|
\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
|
||||||
|
# set arguments
|
||||||
|
\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)*
|
||||||
|
# tar arguments
|
||||||
|
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
|
||||||
|
# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long...
|
||||||
|
\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b
|
||||||
|
# macOS temp folders
|
||||||
|
/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/
|
||||||
117
.github/actions/spelling/excludes.txt
vendored
Normal file
117
.github/actions/spelling/excludes.txt
vendored
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
|
||||||
|
(?:(?i)\.png$)
|
||||||
|
(?:^|/)(?i)COPYRIGHT
|
||||||
|
(?:^|/)(?i)LICEN[CS]E
|
||||||
|
(?:^|/)3rdparty/
|
||||||
|
(?:^|/)dirs$
|
||||||
|
(?:^|/)go\.mod$
|
||||||
|
(?:^|/)go\.sum$
|
||||||
|
(?:^|/)package(?:-lock|)\.json$
|
||||||
|
(?:^|/)sources(?:|\.dep)$
|
||||||
|
(?:^|/)vendor/
|
||||||
|
\.a$
|
||||||
|
\.ai$
|
||||||
|
\.avi$
|
||||||
|
\.bmp$
|
||||||
|
\.bz2$
|
||||||
|
\.cer$
|
||||||
|
\.class$
|
||||||
|
\.crl$
|
||||||
|
\.crt$
|
||||||
|
\.csr$
|
||||||
|
\.dll$
|
||||||
|
\.docx?$
|
||||||
|
\.drawio$
|
||||||
|
\.DS_Store$
|
||||||
|
\.eot$
|
||||||
|
\.eps$
|
||||||
|
\.exe$
|
||||||
|
\.gif$
|
||||||
|
\.gitattributes$
|
||||||
|
\.graffle$
|
||||||
|
\.gz$
|
||||||
|
\.icns$
|
||||||
|
\.ico$
|
||||||
|
\.jar$
|
||||||
|
\.jks$
|
||||||
|
\.jpeg$
|
||||||
|
\.jpg$
|
||||||
|
\.key$
|
||||||
|
\.lib$
|
||||||
|
\.lock$
|
||||||
|
\.map$
|
||||||
|
\.min\..
|
||||||
|
\.mod$
|
||||||
|
\.mp3$
|
||||||
|
\.mp4$
|
||||||
|
\.o$
|
||||||
|
\.ocf$
|
||||||
|
\.otf$
|
||||||
|
\.pbxproj$
|
||||||
|
\.pdf$
|
||||||
|
\.pem$
|
||||||
|
\.png$
|
||||||
|
\.psd$
|
||||||
|
\.pyc$
|
||||||
|
\.runsettings$
|
||||||
|
\.s$
|
||||||
|
\.sig$
|
||||||
|
\.so$
|
||||||
|
\.svg$
|
||||||
|
\.svgz$
|
||||||
|
\.svgz?$
|
||||||
|
\.tar$
|
||||||
|
\.tgz$
|
||||||
|
\.tiff?$
|
||||||
|
\.ttf$
|
||||||
|
\.vsdx$
|
||||||
|
\.wav$
|
||||||
|
\.webm$
|
||||||
|
\.webp$
|
||||||
|
\.woff
|
||||||
|
\.woff2?$
|
||||||
|
\.xcf$
|
||||||
|
\.xls
|
||||||
|
\.xlsx?$
|
||||||
|
\.xpm$
|
||||||
|
\.yml$
|
||||||
|
\.zip$
|
||||||
|
^\.github/actions/spelling/
|
||||||
|
^\.github/fabricbot.json$
|
||||||
|
^\.gitignore$
|
||||||
|
^\Q.git-blame-ignore-revs\E$
|
||||||
|
^\Q.github/workflows/spelling.yml\E$
|
||||||
|
^\Qdoc/reference/windows-terminal-logo.ans\E$
|
||||||
|
^\Qsamples/ConPTY/EchoCon/EchoCon/EchoCon.vcxproj.filters\E$
|
||||||
|
^\Qsrc/host/exe/Host.EXE.vcxproj.filters\E$
|
||||||
|
^\Qsrc/host/ft_host/chafa.txt\E$
|
||||||
|
^\Qsrc/tools/closetest/CloseTest.vcxproj.filters\E$
|
||||||
|
^\XamlStyler.json$
|
||||||
|
^build/config/
|
||||||
|
^consolegit2gitfilters\.json$
|
||||||
|
^dep/
|
||||||
|
^doc/reference/master-sequence-list.csv$
|
||||||
|
^doc/reference/UTF8-torture-test\.txt$
|
||||||
|
^oss/
|
||||||
|
^src/host/ft_uia/run\.bat$
|
||||||
|
^src/host/runft\.bat$
|
||||||
|
^src/host/runut\.bat$
|
||||||
|
^src/interactivity/onecore/BgfxEngine\.
|
||||||
|
^src/renderer/atlas/
|
||||||
|
^src/renderer/wddmcon/WddmConRenderer\.
|
||||||
|
^src/terminal/adapter/ut_adapter/run\.bat$
|
||||||
|
^src/terminal/parser/delfuzzpayload\.bat$
|
||||||
|
^src/terminal/parser/ft_fuzzer/run\.bat$
|
||||||
|
^src/terminal/parser/ft_fuzzer/VTCommandFuzzer\.cpp$
|
||||||
|
^src/terminal/parser/ft_fuzzwrapper/run\.bat$
|
||||||
|
^src/terminal/parser/ut_parser/Base64Test.cpp$
|
||||||
|
^src/terminal/parser/ut_parser/run\.bat$
|
||||||
|
^src/tools/integrity/packageuwp/ConsoleUWP\.appxSources$
|
||||||
|
^src/tools/lnkd/lnkd\.bat$
|
||||||
|
^src/tools/pixels/pixels\.bat$
|
||||||
|
^src/tools/texttests/fira\.txt$
|
||||||
|
^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$
|
||||||
|
^src/types/ut_types/UtilsTests.cpp$
|
||||||
|
^tools/ReleaseEngineering/ServicingPipeline.ps1$
|
||||||
|
ignore$
|
||||||
|
SUMS$
|
||||||
@@ -1,16 +1,23 @@
|
|||||||
|
AAAa
|
||||||
|
AAAAA
|
||||||
|
AAAAAAAAAAAAA
|
||||||
|
AAAAAABBBBBBCCC
|
||||||
|
AAAAABBBBBBCCC
|
||||||
|
abcd
|
||||||
abcd
|
abcd
|
||||||
abcde
|
|
||||||
abcdef
|
|
||||||
ABCDEFG
|
|
||||||
ABCDEFGH
|
|
||||||
ABCDEFGHIJ
|
ABCDEFGHIJ
|
||||||
abcdefghijk
|
abcdefghijk
|
||||||
|
ABCDEFGHIJKLMNO
|
||||||
abcdefghijklmnop
|
abcdefghijklmnop
|
||||||
ABCDEFGHIJKLMNOPQRST
|
ABCDEFGHIJKLMNOPQRST
|
||||||
abcdefghijklmnopqrstuvwxyz
|
ABCG
|
||||||
ABE
|
ABE
|
||||||
|
abf
|
||||||
|
BBBBB
|
||||||
|
BBBBBBBB
|
||||||
|
BBBBBCCC
|
||||||
|
BBBBCCCCC
|
||||||
BBGGRR
|
BBGGRR
|
||||||
BBBBBBBBBBBBBBDDDD
|
|
||||||
EFG
|
EFG
|
||||||
EFGh
|
EFGh
|
||||||
QQQQQQQQQQABCDEFGHIJ
|
QQQQQQQQQQABCDEFGHIJ
|
||||||
@@ -19,7 +26,6 @@ QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ
|
|||||||
QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ
|
QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ
|
||||||
qrstuvwxyz
|
qrstuvwxyz
|
||||||
qwerty
|
qwerty
|
||||||
QWERTYUIOP
|
|
||||||
qwertyuiopasdfg
|
qwertyuiopasdfg
|
||||||
YYYYYYYDDDDDDDDDDD
|
YYYYYYYDDDDDDDDDDD
|
||||||
ZAAZZ
|
ZAAZZ
|
||||||
@@ -31,3 +37,4 @@ ZYXWVUT
|
|||||||
ZZBBZ
|
ZZBBZ
|
||||||
ZZZBB
|
ZZZBB
|
||||||
ZZZBZ
|
ZZZBZ
|
||||||
|
ZZZZZ
|
||||||
File diff suppressed because it is too large
Load Diff
6
.github/actions/spelling/expect/web.txt
vendored
Normal file
6
.github/actions/spelling/expect/web.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
WCAG
|
||||||
|
winui
|
||||||
|
appshellintegration
|
||||||
|
mdtauk
|
||||||
|
gfycat
|
||||||
|
Guake
|
||||||
62
.github/actions/spelling/line_forbidden.patterns
vendored
Normal file
62
.github/actions/spelling/line_forbidden.patterns
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
|
||||||
|
# \bm_data\b
|
||||||
|
|
||||||
|
# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test,
|
||||||
|
# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want
|
||||||
|
# to use this:
|
||||||
|
#\bfit\(
|
||||||
|
|
||||||
|
# s.b. GitHub
|
||||||
|
\bGithub\b
|
||||||
|
|
||||||
|
# s.b. GitLab
|
||||||
|
\bGitlab\b
|
||||||
|
|
||||||
|
# s.b. JavaScript
|
||||||
|
\bJavascript\b
|
||||||
|
|
||||||
|
# s.b. Microsoft
|
||||||
|
\bMicroSoft\b
|
||||||
|
|
||||||
|
# s.b. another
|
||||||
|
\ban[- ]other\b
|
||||||
|
|
||||||
|
# s.b. greater than
|
||||||
|
\bgreater then\b
|
||||||
|
|
||||||
|
# s.b. into
|
||||||
|
#\sin to\s
|
||||||
|
|
||||||
|
# s.b. opt-in
|
||||||
|
\sopt in\s
|
||||||
|
|
||||||
|
# s.b. less than
|
||||||
|
\bless then\b
|
||||||
|
|
||||||
|
# s.b. otherwise
|
||||||
|
\bother[- ]wise\b
|
||||||
|
|
||||||
|
# s.b. nonexistent
|
||||||
|
\bnon existing\b
|
||||||
|
\b[Nn]o[nt][- ]existent\b
|
||||||
|
|
||||||
|
# s.b. preexisting
|
||||||
|
[Pp]re[- ]existing
|
||||||
|
|
||||||
|
# s.b. preempt
|
||||||
|
[Pp]re[- ]empt\b
|
||||||
|
|
||||||
|
# s.b. preemptively
|
||||||
|
[Pp]re[- ]emptively
|
||||||
|
|
||||||
|
# s.b. reentrancy
|
||||||
|
[Rr]e[- ]entrancy
|
||||||
|
|
||||||
|
# s.b. reentrant
|
||||||
|
[Rr]e[- ]entrant
|
||||||
|
|
||||||
|
# s.b. workaround(s)
|
||||||
|
#\bwork[- ]arounds?\b
|
||||||
|
|
||||||
|
# Reject duplicate words
|
||||||
|
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
|
||||||
96
.github/actions/spelling/patterns/patterns.txt
vendored
Normal file
96
.github/actions/spelling/patterns/patterns.txt
vendored
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
|
||||||
|
|
||||||
|
https?://\S+
|
||||||
|
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
||||||
|
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
||||||
|
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
||||||
|
microsoft/cascadia-code\@[0-9a-fA-F]{40}
|
||||||
|
\d+x\d+Logo
|
||||||
|
Scro\&ll
|
||||||
|
# selectionInput.cpp
|
||||||
|
:\\windows\\syste\b
|
||||||
|
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
|
||||||
|
(?:hostSm|mach)\.ProcessString\(L"[^"]+"
|
||||||
|
\b([A-Za-z])\g{-1}{3,}\b
|
||||||
|
0x[0-9A-Za-z]+
|
||||||
|
Base64::s_(?:En|De)code\(L"[^"]+"
|
||||||
|
VERIFY_ARE_EQUAL\(L"[^"]+"
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
|
||||||
|
std::memory_order_[\w]+
|
||||||
|
D2DERR_SHADER_COMPILE_FAILED
|
||||||
|
TIL_FEATURE_[0-9A-Z_]+
|
||||||
|
vcvars\w*
|
||||||
|
ROY\sG\.\sBIV
|
||||||
|
!(?:(?i)ESC)!\[
|
||||||
|
!(?:(?i)CSI)!(?:\d+(?:;\d+|)m|[ABCDF])
|
||||||
|
|
||||||
|
# Python stringprefix / binaryprefix
|
||||||
|
\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'
|
||||||
|
|
||||||
|
# Automatically suggested patterns
|
||||||
|
# hit-count: 3831 file-count: 582
|
||||||
|
# IServiceProvider
|
||||||
|
\bI(?=(?:[A-Z][a-z]{2,})+\b)
|
||||||
|
|
||||||
|
# hit-count: 71 file-count: 35
|
||||||
|
# Compiler flags
|
||||||
|
(?:^|[\t ,"'`=(])-[D](?=[A-Z]{2,}|[A-Z][a-z])
|
||||||
|
(?:^|[\t ,"'`=(])-[X](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||||
|
|
||||||
|
# hit-count: 41 file-count: 28
|
||||||
|
# version suffix <word>v#
|
||||||
|
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
||||||
|
|
||||||
|
# hit-count: 20 file-count: 9
|
||||||
|
# hex runs
|
||||||
|
\b[0-9a-fA-F]{16,}\b
|
||||||
|
|
||||||
|
# hit-count: 10 file-count: 7
|
||||||
|
# uuid:
|
||||||
|
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
|
||||||
|
|
||||||
|
# hit-count: 4 file-count: 4
|
||||||
|
# mailto urls
|
||||||
|
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
|
||||||
|
|
||||||
|
# hit-count: 4 file-count: 1
|
||||||
|
# ANSI color codes
|
||||||
|
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
|
||||||
|
|
||||||
|
# hit-count: 2 file-count: 1
|
||||||
|
# latex
|
||||||
|
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
|
||||||
|
|
||||||
|
# hit-count: 1 file-count: 1
|
||||||
|
# hex digits including css/html color classes:
|
||||||
|
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
|
||||||
|
|
||||||
|
# hit-count: 1 file-count: 1
|
||||||
|
# Non-English
|
||||||
|
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
|
||||||
|
|
||||||
|
# hit-count: 1 file-count: 1
|
||||||
|
# French
|
||||||
|
# This corpus only had capital letters, but you probably want lowercase ones as well.
|
||||||
|
\b[LN]'+[a-z]{2,}\b
|
||||||
|
|
||||||
|
# acceptable duplicates
|
||||||
|
# ls directory listings
|
||||||
|
[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
|
||||||
|
# C/idl types + English ...
|
||||||
|
\s(Guid|long|LONG|that) \g{-1}\s
|
||||||
|
|
||||||
|
# javadoc / .net
|
||||||
|
(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
|
||||||
|
|
||||||
|
# Commit message -- Signed-off-by and friends
|
||||||
|
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$
|
||||||
|
|
||||||
|
# Autogenerated revert commit message
|
||||||
|
^This reverts commit [0-9a-f]{40}\.$
|
||||||
|
|
||||||
|
# vtmode
|
||||||
|
--vtmode\s+(\w+)\s+\g{-1}\s
|
||||||
|
|
||||||
|
# ignore long runs of a single character:
|
||||||
|
\b([A-Za-z])\g{-1}{3,}\b
|
||||||
12
.github/actions/spelling/reject.txt
vendored
Normal file
12
.github/actions/spelling/reject.txt
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
^attache$
|
||||||
|
^attacher$
|
||||||
|
^attachers$
|
||||||
|
benefitting
|
||||||
|
occurences?
|
||||||
|
^dependan.*
|
||||||
|
^oer$
|
||||||
|
Sorce
|
||||||
|
^[Ss]pae.*
|
||||||
|
^untill$
|
||||||
|
^untilling$
|
||||||
|
^wether.*
|
||||||
20
.github/workflows/spelling.yml
vendored
20
.github/workflows/spelling.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Spell checking
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
schedule:
|
|
||||||
# * is a special character in YAML so you have to quote this string
|
|
||||||
- cron: '15 * * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Spell checking
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.0.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 5
|
|
||||||
- uses: check-spelling/check-spelling@0.0.16-alpha
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
bucket: .github/actions
|
|
||||||
project: spell-check
|
|
||||||
134
.github/workflows/spelling2.yml
vendored
Normal file
134
.github/workflows/spelling2.yml
vendored
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
|
||||||
|
name: Spell checking
|
||||||
|
|
||||||
|
# Comment management is handled through a secondary job, for details see:
|
||||||
|
# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
|
||||||
|
#
|
||||||
|
# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
|
||||||
|
# (in odd cases, it might actually run just to collapse a commment, but that's fairly rare)
|
||||||
|
# it needs `contents: write` in order to add a comment.
|
||||||
|
#
|
||||||
|
# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
|
||||||
|
# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment)
|
||||||
|
# it needs `pull-requests: write` in order to manipulate those comments.
|
||||||
|
|
||||||
|
# Updating pull request branches is managed via comment handling.
|
||||||
|
# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list
|
||||||
|
#
|
||||||
|
# These elements work together to make it happen:
|
||||||
|
#
|
||||||
|
# `on.issue_comment`
|
||||||
|
# This event listens to comments by users asking to update the metadata.
|
||||||
|
#
|
||||||
|
# `jobs.update`
|
||||||
|
# This job runs in response to an issue_comment and will push a new commit
|
||||||
|
# to update the spelling metadata.
|
||||||
|
#
|
||||||
|
# `with.experimental_apply_changes_via_bot`
|
||||||
|
# Tells the action to support and generate messages that enable it
|
||||||
|
# to make a commit to update the spelling metadata.
|
||||||
|
#
|
||||||
|
# `with.ssh_key`
|
||||||
|
# In order to trigger workflows when the commit is made, you can provide a
|
||||||
|
# secret (typically, a write-enabled github deploy key).
|
||||||
|
#
|
||||||
|
# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
tags-ignore:
|
||||||
|
- "**"
|
||||||
|
pull_request_target:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
tags-ignore:
|
||||||
|
- "**"
|
||||||
|
types:
|
||||||
|
- 'opened'
|
||||||
|
- 'reopened'
|
||||||
|
- 'synchronize'
|
||||||
|
issue_comment:
|
||||||
|
types:
|
||||||
|
- 'created'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
spelling:
|
||||||
|
name: Spell checking
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
actions: read
|
||||||
|
outputs:
|
||||||
|
followup: ${{ steps.spelling.outputs.followup }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
|
||||||
|
concurrency:
|
||||||
|
group: spelling-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
# note: If you use only_check_changed_files, you do not want cancel-in-progress
|
||||||
|
cancel-in-progress: true
|
||||||
|
steps:
|
||||||
|
- name: check-spelling
|
||||||
|
id: spelling
|
||||||
|
uses: check-spelling/check-spelling@v0.0.21
|
||||||
|
with:
|
||||||
|
suppress_push_for_open_pull_request: 1
|
||||||
|
checkout: true
|
||||||
|
check_file_names: 1
|
||||||
|
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||||
|
post_comment: 0
|
||||||
|
use_magic_file: 1
|
||||||
|
extra_dictionary_limit: 10
|
||||||
|
extra_dictionaries:
|
||||||
|
cspell:software-terms/src/software-terms.txt
|
||||||
|
cspell:python/src/python/python-lib.txt
|
||||||
|
cspell:node/node.txt
|
||||||
|
cspell:cpp/src/stdlib-c.txt
|
||||||
|
cspell:cpp/src/stdlib-cpp.txt
|
||||||
|
cspell:fullstack/fullstack.txt
|
||||||
|
cspell:filetypes/filetypes.txt
|
||||||
|
cspell:html/html.txt
|
||||||
|
cspell:cpp/src/compiler-msvc.txt
|
||||||
|
cspell:python/src/common/extra.txt
|
||||||
|
cspell:powershell/powershell.txt
|
||||||
|
cspell:aws/aws.txt
|
||||||
|
cspell:cpp/src/lang-keywords.txt
|
||||||
|
cspell:npm/npm.txt
|
||||||
|
cspell:dotnet/dotnet.txt
|
||||||
|
cspell:python/src/python/python.txt
|
||||||
|
cspell:css/css.txt
|
||||||
|
cspell:cpp/src/stdlib-cmath.txt
|
||||||
|
check_extra_dictionaries: ''
|
||||||
|
|
||||||
|
comment-push:
|
||||||
|
name: Report (Push)
|
||||||
|
# If your workflow isn't running on push, you can remove this job
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: spelling
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
|
||||||
|
steps:
|
||||||
|
- name: comment
|
||||||
|
uses: check-spelling/check-spelling@v0.0.21
|
||||||
|
with:
|
||||||
|
checkout: true
|
||||||
|
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||||
|
task: ${{ needs.spelling.outputs.followup }}
|
||||||
|
|
||||||
|
comment-pr:
|
||||||
|
name: Report (PR)
|
||||||
|
# If you workflow isn't running on pull_request*, you can remove this job
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: spelling
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
|
||||||
|
steps:
|
||||||
|
- name: comment
|
||||||
|
uses: check-spelling/check-spelling@v0.0.21
|
||||||
|
with:
|
||||||
|
checkout: true
|
||||||
|
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||||
|
task: ${{ needs.spelling.outputs.followup }}
|
||||||
Binary file not shown.
@@ -67,7 +67,6 @@
|
|||||||
"toggleAlwaysOnTop",
|
"toggleAlwaysOnTop",
|
||||||
"toggleFocusMode",
|
"toggleFocusMode",
|
||||||
"toggleFullscreen",
|
"toggleFullscreen",
|
||||||
"togglePaneZoom",
|
|
||||||
"toggleRetroEffect",
|
"toggleRetroEffect",
|
||||||
"wt",
|
"wt",
|
||||||
"unbound"
|
"unbound"
|
||||||
@@ -370,7 +369,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"required": [ "name" ]
|
"required": [ "colorScheme" ]
|
||||||
},
|
},
|
||||||
"WtAction": {
|
"WtAction": {
|
||||||
"description": "Arguments corresponding to a wt Action",
|
"description": "Arguments corresponding to a wt Action",
|
||||||
@@ -397,14 +396,16 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"action": { "type": "string", "pattern": "closeOtherTabs" },
|
"action": { "type": "string", "pattern": "closeOtherTabs" },
|
||||||
"index": {
|
"index": {
|
||||||
"type": "integer",
|
"oneOf": [
|
||||||
|
{ "type": "integer" },
|
||||||
|
{ "type": null }
|
||||||
|
],
|
||||||
"default": "",
|
"default": "",
|
||||||
"description": "close the tabs following the tab at this index"
|
"description": "Close the tabs other than the one at this index. If no index is provided, use the focused tab's index."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"required": [ "index" ]
|
|
||||||
},
|
},
|
||||||
"CloseTabsAfterAction": {
|
"CloseTabsAfterAction": {
|
||||||
"description": "Arguments for a closeTabsAfter action",
|
"description": "Arguments for a closeTabsAfter action",
|
||||||
@@ -414,14 +415,16 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"action": { "type": "string", "pattern": "closeTabsAfter" },
|
"action": { "type": "string", "pattern": "closeTabsAfter" },
|
||||||
"index": {
|
"index": {
|
||||||
"type": "integer",
|
"oneOf": [
|
||||||
|
{ "type": "integer" },
|
||||||
|
{ "type": null }
|
||||||
|
],
|
||||||
"default": "",
|
"default": "",
|
||||||
"description": "close the tabs other than the one at this index"
|
"description": "Close the tabs following the tab at this index. If no index is provided, use the focused tab's index."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"required": [ "index" ]
|
|
||||||
},
|
},
|
||||||
"Keybinding": {
|
"Keybinding": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|||||||
BIN
res/Cascadia.ttf
BIN
res/Cascadia.ttf
Binary file not shown.
Binary file not shown.
@@ -17,5 +17,5 @@ Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadi
|
|||||||
|
|
||||||
### Fonts Included
|
### Fonts Included
|
||||||
|
|
||||||
* Cascadia Code, Cascadia Mono (2007.15)
|
* Cascadia Code, Cascadia Mono (2009.21)
|
||||||
* from microsoft/cascadia-code@2a54363b2c867f7ae811b9a034c0024cef67de96
|
* from microsoft/cascadia-code@32f84124db1970fa5d032f0fe9019e6922961beb
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ HRESULT HwndTerminal::Initialize()
|
|||||||
_terminal->Create(COORD{ 80, 25 }, 1000, *_renderer);
|
_terminal->Create(COORD{ 80, 25 }, 1000, *_renderer);
|
||||||
_terminal->SetDefaultBackground(RGB(12, 12, 12));
|
_terminal->SetDefaultBackground(RGB(12, 12, 12));
|
||||||
_terminal->SetDefaultForeground(RGB(204, 204, 204));
|
_terminal->SetDefaultForeground(RGB(204, 204, 204));
|
||||||
_terminal->SetWriteInputCallback([=](std::wstring & input) noexcept { _WriteTextToConnection(input); });
|
_terminal->SetWriteInputCallback([=](std::wstring& input) noexcept { _WriteTextToConnection(input); });
|
||||||
localPointerToThread->EnablePainting();
|
localPointerToThread->EnablePainting();
|
||||||
|
|
||||||
_multiClickTime = std::chrono::milliseconds{ GetDoubleClickTime() };
|
_multiClickTime = std::chrono::milliseconds{ GetDoubleClickTime() };
|
||||||
@@ -433,7 +433,15 @@ void _stdcall TerminalSendOutput(void* terminal, LPCWSTR data)
|
|||||||
publicTerminal->SendOutput(data);
|
publicTerminal->SendOutput(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT _stdcall TerminalTriggerResize(void* terminal, double width, double height, _Out_ COORD* dimensions)
|
/// <summary>
|
||||||
|
/// Triggers a terminal resize using the new width and height in pixel.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="terminal">Terminal pointer.</param>
|
||||||
|
/// <param name="width">New width of the terminal in pixels.</param>
|
||||||
|
/// <param name="height">New height of the terminal in pixels</param>
|
||||||
|
/// <param name="dimensions">Out parameter containing the columns and rows that fit the new size.</param>
|
||||||
|
/// <returns>HRESULT of the attempted resize.</returns>
|
||||||
|
HRESULT _stdcall TerminalTriggerResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions)
|
||||||
{
|
{
|
||||||
const auto publicTerminal = static_cast<HwndTerminal*>(terminal);
|
const auto publicTerminal = static_cast<HwndTerminal*>(terminal);
|
||||||
|
|
||||||
@@ -446,10 +454,55 @@ HRESULT _stdcall TerminalTriggerResize(void* terminal, double width, double heig
|
|||||||
static_cast<int>(height),
|
static_cast<int>(height),
|
||||||
0));
|
0));
|
||||||
|
|
||||||
const SIZE windowSize{ static_cast<short>(width), static_cast<short>(height) };
|
const SIZE windowSize{ width, height };
|
||||||
return publicTerminal->Refresh(windowSize, dimensions);
|
return publicTerminal->Refresh(windowSize, dimensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper method for resizing the terminal using character column and row counts
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="terminal">Pointer to the terminal object.</param>
|
||||||
|
/// <param name="dimensionsInCharacters">New terminal size in row and column count.</param>
|
||||||
|
/// <param name="dimensionsInPixels">Out parameter with the new size of the renderer.</param>
|
||||||
|
/// <returns>HRESULT of the attempted resize.</returns>
|
||||||
|
HRESULT _stdcall TerminalTriggerResizeWithDimension(_In_ void* terminal, _In_ COORD dimensionsInCharacters, _Out_ SIZE* dimensionsInPixels)
|
||||||
|
{
|
||||||
|
RETURN_HR_IF_NULL(E_INVALIDARG, dimensionsInPixels);
|
||||||
|
|
||||||
|
const auto publicTerminal = static_cast<const HwndTerminal*>(terminal);
|
||||||
|
|
||||||
|
const auto viewInCharacters = Viewport::FromDimensions({ 0, 0 }, { (dimensionsInCharacters.X), (dimensionsInCharacters.Y) });
|
||||||
|
const auto viewInPixels = publicTerminal->_renderEngine->GetViewportInPixels(viewInCharacters);
|
||||||
|
|
||||||
|
dimensionsInPixels->cx = viewInPixels.Width();
|
||||||
|
dimensionsInPixels->cy = viewInPixels.Height();
|
||||||
|
|
||||||
|
COORD unused{ 0, 0 };
|
||||||
|
|
||||||
|
return TerminalTriggerResize(terminal, viewInPixels.Width(), viewInPixels.Height(), &unused);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the amount of rows and columns that fit in the provided width and height.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="terminal">Terminal pointer</param>
|
||||||
|
/// <param name="width">Width of the terminal area to calculate.</param>
|
||||||
|
/// <param name="height">Height of the terminal area to calculate.</param>
|
||||||
|
/// <param name="dimensions">Out parameter containing the columns and rows that fit the new size.</param>
|
||||||
|
/// <returns>HRESULT of the calculation.</returns>
|
||||||
|
HRESULT _stdcall TerminalCalculateResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions)
|
||||||
|
{
|
||||||
|
const auto publicTerminal = static_cast<const HwndTerminal*>(terminal);
|
||||||
|
|
||||||
|
const auto viewInPixels = Viewport::FromDimensions({ 0, 0 }, { width, height });
|
||||||
|
const auto viewInCharacters = publicTerminal->_renderEngine->GetViewportInCharacters(viewInPixels);
|
||||||
|
|
||||||
|
dimensions->X = viewInCharacters.Width();
|
||||||
|
dimensions->Y = viewInCharacters.Height();
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void _stdcall TerminalDpiChanged(void* terminal, int newDpi)
|
void _stdcall TerminalDpiChanged(void* terminal, int newDpi)
|
||||||
{
|
{
|
||||||
const auto publicTerminal = static_cast<HwndTerminal*>(terminal);
|
const auto publicTerminal = static_cast<HwndTerminal*>(terminal);
|
||||||
@@ -760,18 +813,6 @@ void _stdcall TerminalSetTheme(void* terminal, TerminalTheme theme, LPCWSTR font
|
|||||||
publicTerminal->Refresh(windowSize, &dimensions);
|
publicTerminal->Refresh(windowSize, &dimensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resizes the terminal to the specified rows and columns.
|
|
||||||
HRESULT _stdcall TerminalResize(void* terminal, COORD dimensions)
|
|
||||||
{
|
|
||||||
const auto publicTerminal = static_cast<const HwndTerminal*>(terminal);
|
|
||||||
|
|
||||||
auto lock = publicTerminal->_terminal->LockForWriting();
|
|
||||||
publicTerminal->_terminal->ClearSelection();
|
|
||||||
publicTerminal->_renderer->TriggerRedrawAll();
|
|
||||||
|
|
||||||
return publicTerminal->_terminal->UserResize(dimensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _stdcall TerminalBlinkCursor(void* terminal)
|
void _stdcall TerminalBlinkCursor(void* terminal)
|
||||||
{
|
{
|
||||||
const auto publicTerminal = static_cast<const HwndTerminal*>(terminal);
|
const auto publicTerminal = static_cast<const HwndTerminal*>(terminal);
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ extern "C" {
|
|||||||
__declspec(dllexport) HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
|
__declspec(dllexport) HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
|
||||||
__declspec(dllexport) void _stdcall TerminalSendOutput(void* terminal, LPCWSTR data);
|
__declspec(dllexport) void _stdcall TerminalSendOutput(void* terminal, LPCWSTR data);
|
||||||
__declspec(dllexport) void _stdcall TerminalRegisterScrollCallback(void* terminal, void __stdcall callback(int, int, int));
|
__declspec(dllexport) void _stdcall TerminalRegisterScrollCallback(void* terminal, void __stdcall callback(int, int, int));
|
||||||
__declspec(dllexport) HRESULT _stdcall TerminalTriggerResize(void* terminal, double width, double height, _Out_ COORD* dimensions);
|
__declspec(dllexport) HRESULT _stdcall TerminalTriggerResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions);
|
||||||
__declspec(dllexport) HRESULT _stdcall TerminalResize(void* terminal, COORD dimensions);
|
__declspec(dllexport) HRESULT _stdcall TerminalTriggerResizeWithDimension(_In_ void* terminal, _In_ COORD dimensions, _Out_ SIZE* dimensionsInPixels);
|
||||||
|
__declspec(dllexport) HRESULT _stdcall TerminalCalculateResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions);
|
||||||
__declspec(dllexport) void _stdcall TerminalDpiChanged(void* terminal, int newDpi);
|
__declspec(dllexport) void _stdcall TerminalDpiChanged(void* terminal, int newDpi);
|
||||||
__declspec(dllexport) void _stdcall TerminalUserScroll(void* terminal, int viewTop);
|
__declspec(dllexport) void _stdcall TerminalUserScroll(void* terminal, int viewTop);
|
||||||
__declspec(dllexport) void _stdcall TerminalClearSelection(void* terminal);
|
__declspec(dllexport) void _stdcall TerminalClearSelection(void* terminal);
|
||||||
@@ -90,7 +91,9 @@ private:
|
|||||||
std::optional<til::point> _singleClickTouchdownPos;
|
std::optional<til::point> _singleClickTouchdownPos;
|
||||||
|
|
||||||
friend HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
|
friend HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
|
||||||
friend HRESULT _stdcall TerminalResize(void* terminal, COORD dimensions);
|
friend HRESULT _stdcall TerminalTriggerResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions);
|
||||||
|
friend HRESULT _stdcall TerminalTriggerResizeWithDimension(_In_ void* terminal, _In_ COORD dimensions, _Out_ SIZE* dimensionsInPixels);
|
||||||
|
friend HRESULT _stdcall TerminalCalculateResize(_In_ void* terminal, _In_ short width, _In_ short height, _Out_ COORD* dimensions);
|
||||||
friend void _stdcall TerminalDpiChanged(void* terminal, int newDpi);
|
friend void _stdcall TerminalDpiChanged(void* terminal, int newDpi);
|
||||||
friend void _stdcall TerminalUserScroll(void* terminal, int viewTop);
|
friend void _stdcall TerminalUserScroll(void* terminal, int viewTop);
|
||||||
friend void _stdcall TerminalClearSelection(void* terminal);
|
friend void _stdcall TerminalClearSelection(void* terminal);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace winrt::TerminalApp::implementation
|
|||||||
{ ToggleCommandPaletteKey, ShortcutAction::ToggleCommandPalette },
|
{ ToggleCommandPaletteKey, ShortcutAction::ToggleCommandPalette },
|
||||||
{ ToggleFocusModeKey, ShortcutAction::ToggleFocusMode },
|
{ ToggleFocusModeKey, ShortcutAction::ToggleFocusMode },
|
||||||
{ ToggleFullscreenKey, ShortcutAction::ToggleFullscreen },
|
{ ToggleFullscreenKey, ShortcutAction::ToggleFullscreen },
|
||||||
{ TogglePaneZoomKey, ShortcutAction::TogglePaneZoom },
|
// { TogglePaneZoomKey, ShortcutAction::TogglePaneZoom }, // TODO GH#7252: Re-enable pane zooming
|
||||||
{ ToggleRetroEffectKey, ShortcutAction::ToggleRetroEffect },
|
{ ToggleRetroEffectKey, ShortcutAction::ToggleRetroEffect },
|
||||||
{ UnboundKey, ShortcutAction::Invalid },
|
{ UnboundKey, ShortcutAction::Invalid },
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -339,19 +339,27 @@ namespace winrt::TerminalApp::implementation
|
|||||||
|
|
||||||
winrt::hstring CloseOtherTabsArgs::GenerateName() const
|
winrt::hstring CloseOtherTabsArgs::GenerateName() const
|
||||||
{
|
{
|
||||||
// "Close tabs other than index {0}"
|
if (_Index)
|
||||||
return winrt::hstring{
|
{
|
||||||
fmt::format(std::wstring_view(RS_(L"CloseOtherTabsCommandKey")),
|
// "Close tabs other than index {0}"
|
||||||
_Index)
|
return winrt::hstring{
|
||||||
};
|
fmt::format(std::wstring_view(RS_(L"CloseOtherTabsCommandKey")),
|
||||||
|
_Index.Value())
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return RS_(L"CloseOtherTabsDefaultCommandKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
winrt::hstring CloseTabsAfterArgs::GenerateName() const
|
winrt::hstring CloseTabsAfterArgs::GenerateName() const
|
||||||
{
|
{
|
||||||
// "Close tabs after index {0}"
|
if (_Index)
|
||||||
return winrt::hstring{
|
{
|
||||||
fmt::format(std::wstring_view(RS_(L"CloseTabsAfterCommandKey")),
|
// "Close tabs after index {0}"
|
||||||
_Index)
|
return winrt::hstring{
|
||||||
};
|
fmt::format(std::wstring_view(RS_(L"CloseTabsAfterCommandKey")),
|
||||||
|
_Index.Value())
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return RS_(L"CloseTabsAfterDefaultCommandKey");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ namespace winrt::TerminalApp::implementation
|
|||||||
struct CloseOtherTabsArgs : public CloseOtherTabsArgsT<CloseOtherTabsArgs>
|
struct CloseOtherTabsArgs : public CloseOtherTabsArgsT<CloseOtherTabsArgs>
|
||||||
{
|
{
|
||||||
CloseOtherTabsArgs() = default;
|
CloseOtherTabsArgs() = default;
|
||||||
GETSET_PROPERTY(uint32_t, Index, 0);
|
GETSET_PROPERTY(winrt::Windows::Foundation::IReference<uint32_t>, Index, nullptr);
|
||||||
|
|
||||||
static constexpr std::string_view IndexKey{ "index" };
|
static constexpr std::string_view IndexKey{ "index" };
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ namespace winrt::TerminalApp::implementation
|
|||||||
struct CloseTabsAfterArgs : public CloseTabsAfterArgsT<CloseTabsAfterArgs>
|
struct CloseTabsAfterArgs : public CloseTabsAfterArgsT<CloseTabsAfterArgs>
|
||||||
{
|
{
|
||||||
CloseTabsAfterArgs() = default;
|
CloseTabsAfterArgs() = default;
|
||||||
GETSET_PROPERTY(uint32_t, Index, 0);
|
GETSET_PROPERTY(winrt::Windows::Foundation::IReference<uint32_t>, Index, nullptr);
|
||||||
|
|
||||||
static constexpr std::string_view IndexKey{ "index" };
|
static constexpr std::string_view IndexKey{ "index" };
|
||||||
|
|
||||||
|
|||||||
@@ -134,11 +134,11 @@ namespace TerminalApp
|
|||||||
|
|
||||||
[default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs
|
[default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs
|
||||||
{
|
{
|
||||||
UInt32 Index { get; };
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
||||||
};
|
};
|
||||||
|
|
||||||
[default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs
|
[default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs
|
||||||
{
|
{
|
||||||
UInt32 Index { get; };
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,7 +415,21 @@ namespace winrt::TerminalApp::implementation
|
|||||||
{
|
{
|
||||||
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseOtherTabsArgs>())
|
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseOtherTabsArgs>())
|
||||||
{
|
{
|
||||||
uint32_t index = realArgs.Index();
|
uint32_t index;
|
||||||
|
if (realArgs.Index())
|
||||||
|
{
|
||||||
|
index = realArgs.Index().Value();
|
||||||
|
}
|
||||||
|
else if (auto focusedTabIndex = _GetFocusedTabIndex())
|
||||||
|
{
|
||||||
|
index = *focusedTabIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
actionArgs.Handled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove tabs after the current one
|
// Remove tabs after the current one
|
||||||
while (_tabs.Size() > index + 1)
|
while (_tabs.Size() > index + 1)
|
||||||
@@ -438,7 +452,21 @@ namespace winrt::TerminalApp::implementation
|
|||||||
{
|
{
|
||||||
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseTabsAfterArgs>())
|
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseTabsAfterArgs>())
|
||||||
{
|
{
|
||||||
uint32_t index = realArgs.Index();
|
uint32_t index;
|
||||||
|
if (realArgs.Index())
|
||||||
|
{
|
||||||
|
index = realArgs.Index().Value();
|
||||||
|
}
|
||||||
|
else if (auto focusedTabIndex = _GetFocusedTabIndex())
|
||||||
|
{
|
||||||
|
index = *focusedTabIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
actionArgs.Handled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove tabs after the current one
|
// Remove tabs after the current one
|
||||||
while (_tabs.Size() > index + 1)
|
while (_tabs.Size() > index + 1)
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ std::vector<TerminalApp::Profile> AzureCloudShellGenerator::GenerateProfiles()
|
|||||||
azureCloudShellProfile.SetCommandline(L"Azure");
|
azureCloudShellProfile.SetCommandline(L"Azure");
|
||||||
azureCloudShellProfile.SetStartingDirectory(DEFAULT_STARTING_DIRECTORY);
|
azureCloudShellProfile.SetStartingDirectory(DEFAULT_STARTING_DIRECTORY);
|
||||||
azureCloudShellProfile.SetColorScheme({ L"Vintage" });
|
azureCloudShellProfile.SetColorScheme({ L"Vintage" });
|
||||||
azureCloudShellProfile.SetAcrylicOpacity(0.6);
|
|
||||||
azureCloudShellProfile.SetUseAcrylic(true);
|
|
||||||
azureCloudShellProfile.SetConnectionType(AzureConnectionType);
|
azureCloudShellProfile.SetConnectionType(AzureConnectionType);
|
||||||
profiles.emplace_back(azureCloudShellProfile);
|
profiles.emplace_back(azureCloudShellProfile);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -646,4 +646,10 @@
|
|||||||
<data name="DarkGrayColorButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
<data name="DarkGrayColorButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||||
<value>Dark Gray</value>
|
<value>Dark Gray</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
<data name="CloseOtherTabsDefaultCommandKey" xml:space="preserve">
|
||||||
|
<value>Close all other tabs</value>
|
||||||
|
</data>
|
||||||
|
<data name="CloseTabsAfterDefaultCommandKey" xml:space="preserve">
|
||||||
|
<value>Close all tabs after the current tab</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -1304,9 +1304,9 @@ namespace winrt::TerminalApp::implementation
|
|||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Returns the index in our list of tabs of the currently focused tab. If
|
// - Returns the index in our list of tabs of the currently focused tab. If
|
||||||
// no tab is currently selected, returns -1.
|
// no tab is currently selected, returns nullopt.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - the index of the currently focused tab if there is one, else -1
|
// - the index of the currently focused tab if there is one, else nullopt
|
||||||
std::optional<uint32_t> TerminalPage::_GetFocusedTabIndex() const noexcept
|
std::optional<uint32_t> TerminalPage::_GetFocusedTabIndex() const noexcept
|
||||||
{
|
{
|
||||||
// GH#1117: This is a workaround because _tabView.SelectedIndex()
|
// GH#1117: This is a workaround because _tabView.SelectedIndex()
|
||||||
|
|||||||
@@ -291,6 +291,8 @@
|
|||||||
// Tab Management
|
// Tab Management
|
||||||
// "command": "closeTab" is unbound by default.
|
// "command": "closeTab" is unbound by default.
|
||||||
// The closeTab command closes a tab without confirmation, even if it has multiple panes.
|
// The closeTab command closes a tab without confirmation, even if it has multiple panes.
|
||||||
|
{ "command": "closeOtherTabs" },
|
||||||
|
{ "command": "closeTabsAfter" },
|
||||||
{ "command": "newTab", "keys": "ctrl+shift+t" },
|
{ "command": "newTab", "keys": "ctrl+shift+t" },
|
||||||
{ "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+shift+1" },
|
{ "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+shift+1" },
|
||||||
{ "command": { "action": "newTab", "index": 1 }, "keys": "ctrl+shift+2" },
|
{ "command": { "action": "newTab", "index": 1 }, "keys": "ctrl+shift+2" },
|
||||||
@@ -326,7 +328,6 @@
|
|||||||
{ "command": { "action": "moveFocus", "direction": "left" }, "keys": "alt+left" },
|
{ "command": { "action": "moveFocus", "direction": "left" }, "keys": "alt+left" },
|
||||||
{ "command": { "action": "moveFocus", "direction": "right" }, "keys": "alt+right" },
|
{ "command": { "action": "moveFocus", "direction": "right" }, "keys": "alt+right" },
|
||||||
{ "command": { "action": "moveFocus", "direction": "up" }, "keys": "alt+up" },
|
{ "command": { "action": "moveFocus", "direction": "up" }, "keys": "alt+up" },
|
||||||
{ "command": "togglePaneZoom" },
|
|
||||||
|
|
||||||
// Clipboard Integration
|
// Clipboard Integration
|
||||||
{ "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c" },
|
{ "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c" },
|
||||||
|
|||||||
@@ -52,10 +52,10 @@
|
|||||||
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
|
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
|
||||||
"schemes": [],
|
"schemes": [],
|
||||||
|
|
||||||
// Add custom keybindings to this array.
|
// Add custom actions and keybindings to this array.
|
||||||
// To unbind a key combination from your defaults.json, set the command to "unbound".
|
// To unbind a key combination from your defaults.json, set the command to "unbound".
|
||||||
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
|
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
|
||||||
"keybindings":
|
"actions":
|
||||||
[
|
[
|
||||||
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
|
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
|
||||||
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
|
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "ConptyConnection.h"
|
#include "ConptyConnection.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <userenv.h>
|
|
||||||
|
|
||||||
#include "ConptyConnection.g.cpp"
|
#include "ConptyConnection.g.cpp"
|
||||||
|
|
||||||
@@ -98,11 +97,8 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
|||||||
environment.clear();
|
environment.clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
// Populate the environment map with the current environment.
|
||||||
const auto newEnvironmentBlock{ Utils::CreateEnvironmentBlock() };
|
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment));
|
||||||
// Populate the environment map with the current environment.
|
|
||||||
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment, newEnvironmentBlock.get()));
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Convert connection Guid to string and ignore the enclosing '{}'.
|
// Convert connection Guid to string and ignore the enclosing '{}'.
|
||||||
@@ -455,4 +451,23 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Function Description:
|
||||||
|
// - This function will be called (by C++/WinRT) after the final outstanding reference to
|
||||||
|
// any given connection instance is released.
|
||||||
|
// When a client application exits, its termination will wait for the output thread to
|
||||||
|
// run down. However, because our teardown is somewhat complex, our last reference may
|
||||||
|
// be owned by the very output thread that the client wait threadpool is blocked on.
|
||||||
|
// During destruction, we'll try to release any outstanding handles--including the one
|
||||||
|
// we have to the threadpool wait. As you might imagine, this takes us right to deadlock
|
||||||
|
// city.
|
||||||
|
// Deferring the final destruction of the connection to a background thread that can't
|
||||||
|
// be awaiting our destruction breaks the deadlock.
|
||||||
|
// Arguments:
|
||||||
|
// - connection: the final living reference to an outgoing connection
|
||||||
|
winrt::fire_and_forget ConptyConnection::final_release(std::unique_ptr<ConptyConnection> connection)
|
||||||
|
{
|
||||||
|
co_await winrt::resume_background(); // move to background
|
||||||
|
connection.reset(); // explicitly destruct
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
|||||||
const uint32_t rows,
|
const uint32_t rows,
|
||||||
const uint32_t cols,
|
const uint32_t cols,
|
||||||
const guid& guid);
|
const guid& guid);
|
||||||
|
static winrt::fire_and_forget final_release(std::unique_ptr<ConptyConnection> connection);
|
||||||
|
|
||||||
void Start();
|
void Start();
|
||||||
void WriteInput(hstring const& data);
|
void WriteInput(hstring const& data);
|
||||||
|
|||||||
@@ -457,7 +457,6 @@ bool Terminal::SendKeyEvent(const WORD vkey,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto isAltOnlyPressed = states.IsAltPressed() && !states.IsCtrlPressed();
|
const auto isAltOnlyPressed = states.IsAltPressed() && !states.IsCtrlPressed();
|
||||||
const auto isSuppressedAltGrAlias = !_altGrAliasing && states.IsAltPressed() && states.IsCtrlPressed();
|
|
||||||
|
|
||||||
// DON'T manually handle Alt+Space - the system will use this to bring up
|
// DON'T manually handle Alt+Space - the system will use this to bring up
|
||||||
// the system menu for restore, min/maximize, size, move, close.
|
// the system menu for restore, min/maximize, size, move, close.
|
||||||
@@ -477,6 +476,7 @@ bool Terminal::SendKeyEvent(const WORD vkey,
|
|||||||
// as TerminalInput::HandleKey will then fall back to using the vkey which
|
// as TerminalInput::HandleKey will then fall back to using the vkey which
|
||||||
// is the underlying ASCII character (e.g. A-Z) on the keyboard in our case.
|
// is the underlying ASCII character (e.g. A-Z) on the keyboard in our case.
|
||||||
// See GH#5525/GH#6211 for more details
|
// See GH#5525/GH#6211 for more details
|
||||||
|
const auto isSuppressedAltGrAlias = !_altGrAliasing && states.IsAltPressed() && states.IsCtrlPressed() && !states.IsAltGrPressed();
|
||||||
const auto ch = isSuppressedAltGrAlias ? UNICODE_NULL : _CharacterFromKeyEvent(vkey, scanCode, states);
|
const auto ch = isSuppressedAltGrAlias ? UNICODE_NULL : _CharacterFromKeyEvent(vkey, scanCode, states);
|
||||||
|
|
||||||
// Delegate it to the character event handler if this key event can be
|
// Delegate it to the character event handler if this key event can be
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Automation.Provider;
|
|
||||||
|
|
||||||
#pragma warning disable SA1600 // Elements should be documented
|
#pragma warning disable SA1600 // Elements should be documented
|
||||||
internal static class NativeMethods
|
internal static class NativeMethods
|
||||||
@@ -187,10 +186,13 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
public static extern void TerminalSendOutput(IntPtr terminal, string lpdata);
|
public static extern void TerminalSendOutput(IntPtr terminal, string lpdata);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern uint TerminalTriggerResize(IntPtr terminal, double width, double height, out COORD dimensions);
|
public static extern uint TerminalTriggerResize(IntPtr terminal, short width, short height, out COORD dimensions);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern uint TerminalResize(IntPtr terminal, COORD dimensions);
|
public static extern uint TerminalTriggerResizeWithDimension(IntPtr terminal, [MarshalAs(UnmanagedType.Struct)] COORD dimensions, out SIZE dimensionsInPixels);
|
||||||
|
|
||||||
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
|
public static extern uint TerminalCalculateResize(IntPtr terminal, short width, short height, out COORD dimensions);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern void TerminalDpiChanged(IntPtr terminal, int newDpi);
|
public static extern void TerminalDpiChanged(IntPtr terminal, int newDpi);
|
||||||
@@ -205,10 +207,10 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
public static extern void TerminalUserScroll(IntPtr terminal, int viewTop);
|
public static extern void TerminalUserScroll(IntPtr terminal, int viewTop);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern uint TerminalStartSelection(IntPtr terminal, NativeMethods.COORD cursorPosition, bool altPressed);
|
public static extern uint TerminalStartSelection(IntPtr terminal, COORD cursorPosition, bool altPressed);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern uint TerminalMoveSelection(IntPtr terminal, NativeMethods.COORD cursorPosition);
|
public static extern uint TerminalMoveSelection(IntPtr terminal, COORD cursorPosition);
|
||||||
|
|
||||||
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
[DllImport("PublicTerminalCore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern void TerminalClearSelection(IntPtr terminal);
|
public static extern void TerminalClearSelection(IntPtr terminal);
|
||||||
@@ -278,10 +280,24 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
public short X;
|
public short X;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The x-coordinate of the point.
|
/// The y-coordinate of the point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public short Y;
|
public short Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct SIZE
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The x size.
|
||||||
|
/// </summary>
|
||||||
|
public int cx;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The y size.
|
||||||
|
/// </summary>
|
||||||
|
public int cy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore SA1600 // Elements should be documented
|
#pragma warning restore SA1600 // Elements should be documented
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,20 +20,6 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class TerminalContainer : HwndHost
|
public class TerminalContainer : HwndHost
|
||||||
{
|
{
|
||||||
private static void UnpackKeyMessage(IntPtr wParam, IntPtr lParam, out ushort vkey, out ushort scanCode, out ushort flags)
|
|
||||||
{
|
|
||||||
ulong scanCodeAndFlags = (((ulong)lParam) & 0xFFFF0000) >> 16;
|
|
||||||
scanCode = (ushort)(scanCodeAndFlags & 0x00FFu);
|
|
||||||
flags = (ushort)(scanCodeAndFlags & 0xFF00u);
|
|
||||||
vkey = (ushort)wParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void UnpackCharMessage(IntPtr wParam, IntPtr lParam, out char character, out ushort scanCode, out ushort flags)
|
|
||||||
{
|
|
||||||
UnpackKeyMessage(wParam, lParam, out ushort vKey, out scanCode, out flags);
|
|
||||||
character = (char)vKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ITerminalConnection connection;
|
private ITerminalConnection connection;
|
||||||
private IntPtr hwnd;
|
private IntPtr hwnd;
|
||||||
private IntPtr terminal;
|
private IntPtr terminal;
|
||||||
@@ -77,12 +63,29 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
internal event EventHandler<int> UserScrolled;
|
internal event EventHandler<int> UserScrolled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the character rows available to the terminal.
|
/// Gets or sets a value indicating whether if the renderer should automatically resize to fill the control
|
||||||
|
/// on user action.
|
||||||
|
/// </summary>
|
||||||
|
internal bool AutoResize { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the size of the parent user control that hosts the terminal hwnd.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Control size is in device independent units, but for simplicity all sizes should be scaled.</remarks>
|
||||||
|
internal Size TerminalControlSize { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the size of the terminal renderer.
|
||||||
|
/// </summary>
|
||||||
|
internal Size TerminalRendererSize { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current character rows available to the terminal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal int Rows { get; private set; }
|
internal int Rows { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the character columns available to the terminal.
|
/// Gets the current character columns available to the terminal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal int Columns { get; private set; }
|
internal int Columns { get; private set; }
|
||||||
|
|
||||||
@@ -135,7 +138,7 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
|
|
||||||
NativeMethods.TerminalSetTheme(this.terminal, theme, fontFamily, fontSize, (int)dpiScale.PixelsPerInchX);
|
NativeMethods.TerminalSetTheme(this.terminal, theme, fontFamily, fontSize, (int)dpiScale.PixelsPerInchX);
|
||||||
|
|
||||||
this.TriggerResize(this.RenderSize);
|
this.Resize(this.TerminalControlSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -153,43 +156,75 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Triggers a refresh of the terminal with the given size.
|
/// Triggers a resize of the terminal with the given size, redrawing the rendered text.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="renderSize">Size of the rendering window.</param>
|
/// <param name="renderSize">Size of the rendering window.</param>
|
||||||
/// <returns>Tuple with rows and columns.</returns>
|
internal void Resize(Size renderSize)
|
||||||
internal (int rows, int columns) TriggerResize(Size renderSize)
|
|
||||||
{
|
{
|
||||||
var dpiScale = VisualTreeHelper.GetDpi(this);
|
NativeMethods.TerminalTriggerResize(
|
||||||
|
this.terminal,
|
||||||
NativeMethods.COORD dimensions;
|
Convert.ToInt16(renderSize.Width),
|
||||||
NativeMethods.TerminalTriggerResize(this.terminal, renderSize.Width * dpiScale.DpiScaleX, renderSize.Height * dpiScale.DpiScaleY, out dimensions);
|
Convert.ToInt16(renderSize.Height),
|
||||||
|
out NativeMethods.COORD dimensions);
|
||||||
|
|
||||||
this.Rows = dimensions.Y;
|
this.Rows = dimensions.Y;
|
||||||
this.Columns = dimensions.X;
|
this.Columns = dimensions.X;
|
||||||
|
this.TerminalRendererSize = renderSize;
|
||||||
|
|
||||||
this.connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
this.Connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
||||||
return (dimensions.Y, dimensions.X);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resizes the terminal.
|
/// Resizes the terminal using row and column count as the new size.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rows">Number of rows to show.</param>
|
/// <param name="rows">Number of rows to show.</param>
|
||||||
/// <param name="columns">Number of columns to show.</param>
|
/// <param name="columns">Number of columns to show.</param>
|
||||||
internal void Resize(uint rows, uint columns)
|
internal void Resize(uint rows, uint columns)
|
||||||
{
|
{
|
||||||
|
NativeMethods.SIZE dimensionsInPixels;
|
||||||
NativeMethods.COORD dimensions = new NativeMethods.COORD
|
NativeMethods.COORD dimensions = new NativeMethods.COORD
|
||||||
{
|
{
|
||||||
X = (short)columns,
|
X = (short)columns,
|
||||||
Y = (short)rows,
|
Y = (short)rows,
|
||||||
};
|
};
|
||||||
|
|
||||||
NativeMethods.TerminalResize(this.terminal, dimensions);
|
NativeMethods.TerminalTriggerResizeWithDimension(this.terminal, dimensions, out dimensionsInPixels);
|
||||||
|
|
||||||
this.Rows = dimensions.Y;
|
|
||||||
this.Columns = dimensions.X;
|
this.Columns = dimensions.X;
|
||||||
|
this.Rows = dimensions.Y;
|
||||||
|
|
||||||
this.connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
this.TerminalRendererSize = new Size()
|
||||||
|
{
|
||||||
|
Width = dimensionsInPixels.cx,
|
||||||
|
Height = dimensionsInPixels.cy,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.Connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the rows and columns that would fit in the given size.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="size">DPI scaled size.</param>
|
||||||
|
/// <returns>Amount of rows and columns that would fit the given size.</returns>
|
||||||
|
internal (uint columns, uint rows) CalculateRowsAndColumns(Size size)
|
||||||
|
{
|
||||||
|
NativeMethods.TerminalCalculateResize(this.terminal, (short)size.Width, (short)size.Height, out NativeMethods.COORD dimensions);
|
||||||
|
|
||||||
|
return ((uint)dimensions.X, (uint)dimensions.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Triggers the terminal resize event if more space is available in the terminal control.
|
||||||
|
/// </summary>
|
||||||
|
internal void RaiseResizedIfDrawSpaceIncreased()
|
||||||
|
{
|
||||||
|
(var columns, var rows) = this.CalculateRowsAndColumns(this.TerminalControlSize);
|
||||||
|
|
||||||
|
if (this.Columns < columns || this.Rows < rows)
|
||||||
|
{
|
||||||
|
this.connection?.Resize(rows, columns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@@ -238,6 +273,20 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
this.terminal = IntPtr.Zero;
|
this.terminal = IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void UnpackKeyMessage(IntPtr wParam, IntPtr lParam, out ushort vkey, out ushort scanCode, out ushort flags)
|
||||||
|
{
|
||||||
|
ulong scanCodeAndFlags = (((ulong)lParam) & 0xFFFF0000) >> 16;
|
||||||
|
scanCode = (ushort)(scanCodeAndFlags & 0x00FFu);
|
||||||
|
flags = (ushort)(scanCodeAndFlags & 0xFF00u);
|
||||||
|
vkey = (ushort)wParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void UnpackCharMessage(IntPtr wParam, IntPtr lParam, out char character, out ushort scanCode, out ushort flags)
|
||||||
|
{
|
||||||
|
UnpackKeyMessage(wParam, lParam, out ushort vKey, out scanCode, out flags);
|
||||||
|
character = (char)vKey;
|
||||||
|
}
|
||||||
|
|
||||||
private void TerminalContainer_GotFocus(object sender, RoutedEventArgs e)
|
private void TerminalContainer_GotFocus(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
@@ -299,13 +348,30 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NativeMethods.TerminalTriggerResize(this.terminal, windowpos.cx, windowpos.cy, out var dimensions);
|
NativeMethods.COORD dimensions;
|
||||||
|
|
||||||
this.connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
if (this.AutoResize)
|
||||||
this.Columns = dimensions.X;
|
{
|
||||||
this.Rows = dimensions.Y;
|
NativeMethods.TerminalTriggerResize(this.terminal, (short)windowpos.cx, (short)windowpos.cy, out dimensions);
|
||||||
|
|
||||||
|
this.Columns = dimensions.X;
|
||||||
|
this.Rows = dimensions.Y;
|
||||||
|
|
||||||
|
this.TerminalRendererSize = new Size()
|
||||||
|
{
|
||||||
|
Width = windowpos.cx,
|
||||||
|
Height = windowpos.cy,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Calculate the new columns and rows that fit the total control size and alert the control to redraw the margins.
|
||||||
|
NativeMethods.TerminalCalculateResize(this.terminal, (short)this.TerminalControlSize.Width, (short)this.TerminalControlSize.Height, out dimensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Connection?.Resize((uint)dimensions.Y, (uint)dimensions.X);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NativeMethods.WindowMessage.WM_MOUSEWHEEL:
|
case NativeMethods.WindowMessage.WM_MOUSEWHEEL:
|
||||||
var delta = (short)(((long)wParam) >> 16);
|
var delta = (short)(((long)wParam) >> 16);
|
||||||
this.UserScrolled?.Invoke(this, delta);
|
this.UserScrolled?.Invoke(this, delta);
|
||||||
@@ -360,7 +426,7 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
|
|
||||||
private void OnWrite(string data)
|
private void OnWrite(string data)
|
||||||
{
|
{
|
||||||
this.connection?.WriteInput(data);
|
this.Connection?.WriteInput(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
xmlns:local="clr-namespace:Microsoft.Terminal.Wpf"
|
xmlns:local="clr-namespace:Microsoft.Terminal.Wpf"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
Focusable="True">
|
Focusable="True"
|
||||||
<Grid>
|
x:Name="terminalUserControl">
|
||||||
|
<Grid x:Name="terminalGrid">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
|||||||
@@ -5,10 +5,13 @@
|
|||||||
|
|
||||||
namespace Microsoft.Terminal.Wpf
|
namespace Microsoft.Terminal.Wpf
|
||||||
{
|
{
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using Task = System.Threading.Tasks.Task;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A basic terminal control. This control can receive and render standard VT100 sequences.
|
/// A basic terminal control. This control can receive and render standard VT100 sequences.
|
||||||
@@ -17,6 +20,14 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
{
|
{
|
||||||
private int accumulatedDelta = 0;
|
private int accumulatedDelta = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets size of the terminal renderer.
|
||||||
|
/// </summary>
|
||||||
|
private Size TerminalRendererSize
|
||||||
|
{
|
||||||
|
get => this.termContainer.TerminalRendererSize;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="TerminalControl"/> class.
|
/// Initializes a new instance of the <see cref="TerminalControl"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -32,24 +43,31 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the character rows available to the terminal.
|
/// Gets the current character rows available to the terminal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Rows => this.termContainer.Rows;
|
public int Rows => this.termContainer.Rows;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the character columns available to the terminal.
|
/// Gets the current character columns available to the terminal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Columns => this.termContainer.Columns;
|
public int Columns => this.termContainer.Columns;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether if the renderer should automatically resize to fill the control
|
||||||
|
/// on user action.
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoResize
|
||||||
|
{
|
||||||
|
get => this.termContainer.AutoResize;
|
||||||
|
set => this.termContainer.AutoResize = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the connection to a terminal backend.
|
/// Sets the connection to a terminal backend.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ITerminalConnection Connection
|
public ITerminalConnection Connection
|
||||||
{
|
{
|
||||||
set
|
set => this.termContainer.Connection = value;
|
||||||
{
|
|
||||||
this.termContainer.Connection = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -68,6 +86,13 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.termContainer.SetTheme(theme, fontFamily, fontSize);
|
this.termContainer.SetTheme(theme, fontFamily, fontSize);
|
||||||
|
|
||||||
|
// DefaultBackground uses Win32 COLORREF syntax which is BGR instead of RGB.
|
||||||
|
byte b = Convert.ToByte((theme.DefaultBackground >> 16) & 0xff);
|
||||||
|
byte g = Convert.ToByte((theme.DefaultBackground >> 8) & 0xff);
|
||||||
|
byte r = Convert.ToByte(theme.DefaultBackground & 0xff);
|
||||||
|
|
||||||
|
this.terminalGrid.Background = new SolidColorBrush(Color.FromRgb(r, g, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -84,19 +109,98 @@ namespace Microsoft.Terminal.Wpf
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rows">Number of rows to display.</param>
|
/// <param name="rows">Number of rows to display.</param>
|
||||||
/// <param name="columns">Number of columns to display.</param>
|
/// <param name="columns">Number of columns to display.</param>
|
||||||
public void Resize(uint rows, uint columns)
|
/// <param name="cancellationToken">Cancellation token for this task.</param>
|
||||||
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||||
|
public async Task ResizeAsync(uint rows, uint columns, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
this.termContainer.Resize(rows, columns);
|
this.termContainer.Resize(rows, columns);
|
||||||
|
|
||||||
|
#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
|
||||||
|
await this.Dispatcher.BeginInvoke(
|
||||||
|
new Action(delegate() { this.terminalGrid.Margin = this.CalculateMargins(); }),
|
||||||
|
System.Windows.Threading.DispatcherPriority.Render);
|
||||||
|
#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resizes the terminal to the specified dimensions.
|
/// Resizes the terminal to the specified dimensions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rendersize">Rendering size for the terminal.</param>
|
/// <param name="rendersize">Rendering size for the terminal in device independent units.</param>
|
||||||
/// <returns>A tuple of (int, int) representing the number of rows and columns in the terminal.</returns>
|
/// <returns>A tuple of (int, int) representing the number of rows and columns in the terminal.</returns>
|
||||||
public (int rows, int columns) TriggerResize(Size rendersize)
|
public (int rows, int columns) TriggerResize(Size rendersize)
|
||||||
{
|
{
|
||||||
return this.termContainer.TriggerResize(rendersize);
|
var dpiScale = VisualTreeHelper.GetDpi(this);
|
||||||
|
rendersize.Width *= dpiScale.DpiScaleX;
|
||||||
|
rendersize.Height *= dpiScale.DpiScaleY;
|
||||||
|
|
||||||
|
this.termContainer.Resize(rendersize);
|
||||||
|
|
||||||
|
return (this.Rows, this.Columns);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
||||||
|
{
|
||||||
|
var dpiScale = VisualTreeHelper.GetDpi(this);
|
||||||
|
|
||||||
|
// termContainer requires scaled sizes.
|
||||||
|
this.termContainer.TerminalControlSize = new Size()
|
||||||
|
{
|
||||||
|
Width = (sizeInfo.NewSize.Width - this.scrollbar.ActualWidth) * dpiScale.DpiScaleX,
|
||||||
|
Height = sizeInfo.NewSize.Height * dpiScale.DpiScaleY,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!this.AutoResize)
|
||||||
|
{
|
||||||
|
// Renderer will not resize on control resize. We have to manually calculate the margin to fill in the space.
|
||||||
|
this.terminalGrid.Margin = this.CalculateMargins(sizeInfo.NewSize);
|
||||||
|
|
||||||
|
// Margins stop resize events, therefore we have to manually check if more space is available and raise
|
||||||
|
// a resize event if needed.
|
||||||
|
this.termContainer.RaiseResizedIfDrawSpaceIncreased();
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnRenderSizeChanged(sizeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the margins that should surround the terminal renderer, if any.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="controlSize">New size of the control. Uses the control's current size if not provided.</param>
|
||||||
|
/// <returns>The new terminal control margin thickness in device independent units.</returns>
|
||||||
|
private Thickness CalculateMargins(Size controlSize = default)
|
||||||
|
{
|
||||||
|
var dpiScale = VisualTreeHelper.GetDpi(this);
|
||||||
|
double width = 0, height = 0;
|
||||||
|
|
||||||
|
if (controlSize == default)
|
||||||
|
{
|
||||||
|
controlSize = new Size()
|
||||||
|
{
|
||||||
|
Width = this.terminalUserControl.ActualWidth,
|
||||||
|
Height = this.terminalUserControl.ActualHeight,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// During initialization, the terminal renderer size will be 0 and the terminal renderer
|
||||||
|
// draws on all available space. Therefore no margins are needed until resized.
|
||||||
|
if (this.TerminalRendererSize.Width != 0)
|
||||||
|
{
|
||||||
|
width = controlSize.Width - (this.TerminalRendererSize.Width / dpiScale.DpiScaleX);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.TerminalRendererSize.Height != 0)
|
||||||
|
{
|
||||||
|
height = controlSize.Height - (this.TerminalRendererSize.Height / dpiScale.DpiScaleX);
|
||||||
|
}
|
||||||
|
|
||||||
|
width -= this.scrollbar.ActualWidth;
|
||||||
|
|
||||||
|
// Prevent negative margin size.
|
||||||
|
width = width < 0 ? 0 : width;
|
||||||
|
height = height < 0 ? 0 : height;
|
||||||
|
|
||||||
|
return new Thickness(0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TerminalControl_GotFocus(object sender, RoutedEventArgs e)
|
private void TerminalControl_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -534,41 +534,6 @@ void EventsToUnicode(_Inout_ std::deque<std::unique_ptr<IInputEvent>>& inEvents,
|
|||||||
CATCH_RETURN();
|
CATCH_RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function Description:
|
|
||||||
// - Writes the input records to the beginning of the input buffer. This is used
|
|
||||||
// by VT sequences that need a response immediately written back to the
|
|
||||||
// input.
|
|
||||||
// Arguments:
|
|
||||||
// - pInputBuffer - the input buffer to write to
|
|
||||||
// - events - the events to written
|
|
||||||
// - eventsWritten - on output, the number of events written
|
|
||||||
// Return Value:
|
|
||||||
// - HRESULT indicating success or failure
|
|
||||||
[[nodiscard]] HRESULT DoSrvPrivatePrependConsoleInput(_Inout_ InputBuffer* const pInputBuffer,
|
|
||||||
_Inout_ std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
_Out_ size_t& eventsWritten)
|
|
||||||
{
|
|
||||||
LockConsole();
|
|
||||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
|
||||||
|
|
||||||
eventsWritten = 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// add partial byte event if necessary
|
|
||||||
if (pInputBuffer->IsWritePartialByteSequenceAvailable())
|
|
||||||
{
|
|
||||||
events.push_front(pInputBuffer->FetchWritePartialByteSequence(false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CATCH_RETURN();
|
|
||||||
|
|
||||||
// add to InputBuffer
|
|
||||||
eventsWritten = pInputBuffer->Prepend(events);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function Description:
|
// Function Description:
|
||||||
// - Writes the input KeyEvent to the console as a console control event. This
|
// - Writes the input KeyEvent to the console as a console control event. This
|
||||||
// can be used for potentially generating Ctrl-C events, as
|
// can be used for potentially generating Ctrl-C events, as
|
||||||
|
|||||||
@@ -31,9 +31,5 @@ class SCREEN_INFORMATION;
|
|||||||
_In_ PCD_CREATE_OBJECT_INFORMATION Information,
|
_In_ PCD_CREATE_OBJECT_INFORMATION Information,
|
||||||
_In_ PCONSOLE_CREATESCREENBUFFER_MSG a);
|
_In_ PCONSOLE_CREATESCREENBUFFER_MSG a);
|
||||||
|
|
||||||
[[nodiscard]] NTSTATUS DoSrvPrivatePrependConsoleInput(_Inout_ InputBuffer* const pInputBuffer,
|
|
||||||
_Inout_ std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
_Out_ size_t& eventsWritten);
|
|
||||||
|
|
||||||
[[nodiscard]] NTSTATUS DoSrvPrivateWriteConsoleControlInput(_Inout_ InputBuffer* const pInputBuffer,
|
[[nodiscard]] NTSTATUS DoSrvPrivateWriteConsoleControlInput(_Inout_ InputBuffer* const pInputBuffer,
|
||||||
_In_ KeyEvent key);
|
_In_ KeyEvent key);
|
||||||
|
|||||||
@@ -527,22 +527,6 @@ bool ConhostInternalGetSet::SetCursorStyle(const CursorType style)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Routine Description:
|
|
||||||
// - Connects the PrivatePrependConsoleInput API call directly into our Driver Message servicing call inside Conhost.exe
|
|
||||||
// Arguments:
|
|
||||||
// - events - the input events to be copied into the head of the input
|
|
||||||
// buffer for the underlying attached process
|
|
||||||
// - eventsWritten - on output, the number of events written
|
|
||||||
// Return Value:
|
|
||||||
// - true if successful (see DoSrvPrivatePrependConsoleInput). false otherwise.
|
|
||||||
bool ConhostInternalGetSet::PrivatePrependConsoleInput(std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
size_t& eventsWritten)
|
|
||||||
{
|
|
||||||
return SUCCEEDED(DoSrvPrivatePrependConsoleInput(_io.GetActiveInputBuffer(),
|
|
||||||
events,
|
|
||||||
eventsWritten));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Routine Description:
|
// Routine Description:
|
||||||
// - Connects the PrivatePrependConsoleInput API call directly into our Driver Message servicing call inside Conhost.exe
|
// - Connects the PrivatePrependConsoleInput API call directly into our Driver Message servicing call inside Conhost.exe
|
||||||
// Arguments:
|
// Arguments:
|
||||||
|
|||||||
@@ -104,9 +104,6 @@ public:
|
|||||||
bool PrivateEnableAlternateScroll(const bool enabled) override;
|
bool PrivateEnableAlternateScroll(const bool enabled) override;
|
||||||
bool PrivateEraseAll() override;
|
bool PrivateEraseAll() override;
|
||||||
|
|
||||||
bool PrivatePrependConsoleInput(std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
size_t& eventsWritten) override;
|
|
||||||
|
|
||||||
bool SetCursorStyle(CursorType const style) override;
|
bool SetCursorStyle(CursorType const style) override;
|
||||||
bool SetCursorColor(COLORREF const color) override;
|
bool SetCursorColor(COLORREF const color) override;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,27 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||||||
#pragma warning(disable : 26472)
|
#pragma warning(disable : 26472)
|
||||||
struct color
|
struct color
|
||||||
{
|
{
|
||||||
uint8_t r, g, b, a;
|
// Clang (10) has no trouble optimizing the COLORREF conversion operator, below, to a
|
||||||
|
// simple 32-bit load with mask (!) even though it's a series of bit shifts across
|
||||||
|
// multiple struct members.
|
||||||
|
// CL (19.24) doesn't make the same optimization decision, and it emits three 8-bit loads
|
||||||
|
// and some shifting.
|
||||||
|
// In any case, the optimization only applies at -O2 (clang) and above.
|
||||||
|
// Here, we leverage the spec-legality of using unions for type conversions and the
|
||||||
|
// overlap of four uint8_ts and a uint32_t to make the conversion very obvious to
|
||||||
|
// both compilers.
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ // Clang, GCC
|
||||||
|
uint8_t a, b, g, r;
|
||||||
|
#else
|
||||||
|
uint8_t r, g, b, a;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
uint32_t abgr;
|
||||||
|
};
|
||||||
|
|
||||||
constexpr color() noexcept :
|
constexpr color() noexcept :
|
||||||
r{ 0 },
|
r{ 0 },
|
||||||
@@ -40,16 +60,13 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||||||
|
|
||||||
#ifdef _WINDEF_
|
#ifdef _WINDEF_
|
||||||
constexpr color(COLORREF c) :
|
constexpr color(COLORREF c) :
|
||||||
r{ static_cast<uint8_t>(c & 0xFF) },
|
abgr{ static_cast<uint32_t>(c | 0xFF000000u) }
|
||||||
g{ static_cast<uint8_t>((c & 0xFF00) >> 8) },
|
|
||||||
b{ static_cast<uint8_t>((c & 0xFF0000) >> 16) },
|
|
||||||
a{ 255 }
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
operator COLORREF() const noexcept
|
operator COLORREF() const noexcept
|
||||||
{
|
{
|
||||||
return static_cast<COLORREF>(r) | (static_cast<COLORREF>(g) << 8) | (static_cast<COLORREF>(b) << 16);
|
return static_cast<COLORREF>(abgr & 0x00FFFFFFu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -137,7 +154,7 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||||||
|
|
||||||
constexpr bool operator==(const til::color& other) const
|
constexpr bool operator==(const til::color& other) const
|
||||||
{
|
{
|
||||||
return r == other.r && g == other.g && b == other.b && a == other.a;
|
return abgr == other.abgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool operator!=(const til::color& other) const
|
constexpr bool operator!=(const til::color& other) const
|
||||||
@@ -171,6 +188,8 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static_assert(sizeof(til::color) == sizeof(uint32_t));
|
||||||
|
|
||||||
#ifdef __WEX_COMMON_H__
|
#ifdef __WEX_COMMON_H__
|
||||||
namespace WEX::TestExecution
|
namespace WEX::TestExecution
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,5 +70,5 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||||||
// 1. static_map's member types are all the same
|
// 1. static_map's member types are all the same
|
||||||
// 2. static_map's fourth template argument (otherwise undeduced) is how many pairs it contains
|
// 2. static_map's fourth template argument (otherwise undeduced) is how many pairs it contains
|
||||||
template<typename First, typename... Rest>
|
template<typename First, typename... Rest>
|
||||||
static_map(First, Rest...)->static_map<std::conditional_t<std::conjunction_v<std::is_same<First, Rest>...>, typename First::first_type, void>, typename First::second_type, std::less<typename First::first_type>, 1 + sizeof...(Rest)>;
|
static_map(First, Rest...) -> static_map<std::conditional_t<std::conjunction_v<std::is_same<First, Rest>...>, typename First::first_type, void>, typename First::second_type, std::less<typename First::first_type>, 1 + sizeof...(Rest)>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ class UiaTextRangeTests
|
|||||||
{
|
{
|
||||||
5,
|
5,
|
||||||
{4 , 0 + 1},
|
{4 , 0 + 1},
|
||||||
{5 , 0 + 1}
|
{4 , 0 + 1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -694,6 +694,30 @@ class UiaTextRangeTests
|
|||||||
{0, bottomRow},
|
{0, bottomRow},
|
||||||
{0, bottomRow}
|
{0, bottomRow}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
MoveTest{
|
||||||
|
L"can move to a new row when necessary when moving forward",
|
||||||
|
{ lastColumnIndex, 0 },
|
||||||
|
{ lastColumnIndex, 0 },
|
||||||
|
5,
|
||||||
|
{
|
||||||
|
5,
|
||||||
|
{0, 0 + 5},
|
||||||
|
{0, 0 + 5}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
MoveTest{
|
||||||
|
L"can move to a new row when necessary when moving backward",
|
||||||
|
{ 0, 7 },
|
||||||
|
{ 0, 7 },
|
||||||
|
-5,
|
||||||
|
{
|
||||||
|
-5,
|
||||||
|
{0, 7 - 5},
|
||||||
|
{0, 7 - 5}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IPersist
|
// IPersist
|
||||||
STDMETHODIMP GetClassID(_Out_ CLSID* clsid) override
|
STDMETHODIMP GetClassID(_Out_ CLSID * clsid) override
|
||||||
{
|
{
|
||||||
*clsid = __uuidof(this);
|
*clsid = __uuidof(this);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
// IShellExtInit
|
// IShellExtInit
|
||||||
// Shell QI's for IShellExtInit and calls Initialize first. If we return a succeeding HRESULT, the shell will QI for
|
// Shell QI's for IShellExtInit and calls Initialize first. If we return a succeeding HRESULT, the shell will QI for
|
||||||
// IShellPropSheetExt and call AddPages. A failing HRESULT causes the shell to skip us.
|
// IShellPropSheetExt and call AddPages. A failing HRESULT causes the shell to skip us.
|
||||||
STDMETHODIMP Initialize(_In_ PCIDLIST_ABSOLUTE /*pidlFolder*/, _In_ IDataObject* pdtobj, _In_ HKEY /*hkeyProgID*/)
|
STDMETHODIMP Initialize(_In_ PCIDLIST_ABSOLUTE /*pidlFolder*/, _In_ IDataObject * pdtobj, _In_ HKEY /*hkeyProgID*/)
|
||||||
{
|
{
|
||||||
WCHAR szLinkFileName[MAX_PATH];
|
WCHAR szLinkFileName[MAX_PATH];
|
||||||
HRESULT hr = _ShouldAddPropertySheet(pdtobj, szLinkFileName, ARRAYSIZE(szLinkFileName));
|
HRESULT hr = _ShouldAddPropertySheet(pdtobj, szLinkFileName, ARRAYSIZE(szLinkFileName));
|
||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// CODE FROM THE SHELL DEPOT'S `idllib.h`
|
// CODE FROM THE SHELL DEPOT'S `idllib.h`
|
||||||
// get a link target item without resolving it.
|
// get a link target item without resolving it.
|
||||||
HRESULT GetTargetIdList(_In_ IShellItem* psiLink, _COM_Outptr_ PIDLIST_ABSOLUTE* ppidl)
|
HRESULT GetTargetIdList(_In_ IShellItem * psiLink, _COM_Outptr_ PIDLIST_ABSOLUTE * ppidl)
|
||||||
{
|
{
|
||||||
*ppidl = nullptr;
|
*ppidl = nullptr;
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ private:
|
|||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
HRESULT GetTargetItem(_In_ IShellItem* psiLink, _In_ REFIID riid, _COM_Outptr_ void** ppv)
|
HRESULT GetTargetItem(_In_ IShellItem * psiLink, _In_ REFIID riid, _COM_Outptr_ void** ppv)
|
||||||
{
|
{
|
||||||
*ppv = nullptr;
|
*ppv = nullptr;
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ private:
|
|||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
HRESULT _GetShellItemLinkTargetExpanded(_In_ IShellItem* pShellItem,
|
HRESULT _GetShellItemLinkTargetExpanded(_In_ IShellItem * pShellItem,
|
||||||
_Out_writes_(cchFilePathExtended) PWSTR pszFilePathExtended,
|
_Out_writes_(cchFilePathExtended) PWSTR pszFilePathExtended,
|
||||||
const size_t cchFilePathExtended)
|
const size_t cchFilePathExtended)
|
||||||
{
|
{
|
||||||
@@ -190,7 +190,7 @@ private:
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT _ShouldAddPropertySheet(_In_ IDataObject* pdtobj,
|
HRESULT _ShouldAddPropertySheet(_In_ IDataObject * pdtobj,
|
||||||
_Out_writes_(cchLinkFileName) PWSTR pszLinkFileName,
|
_Out_writes_(cchLinkFileName) PWSTR pszLinkFileName,
|
||||||
const size_t cchLinkFileName)
|
const size_t cchLinkFileName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1488,8 +1488,7 @@ try
|
|||||||
const D2D_POINT_2F target = { coordTarget.X * font.width, coordTarget.Y * font.height };
|
const D2D_POINT_2F target = { coordTarget.X * font.width, coordTarget.Y * font.height };
|
||||||
const auto fullRunWidth = font.width * gsl::narrow_cast<unsigned>(cchLine);
|
const auto fullRunWidth = font.width * gsl::narrow_cast<unsigned>(cchLine);
|
||||||
|
|
||||||
const auto DrawLine = [=](const auto x0, const auto y0, const auto x1, const auto y1, const auto strokeWidth) noexcept
|
const auto DrawLine = [=](const auto x0, const auto y0, const auto x1, const auto y1, const auto strokeWidth) noexcept {
|
||||||
{
|
|
||||||
_d2dDeviceContext->DrawLine({ x0, y0 }, { x1, y1 }, _d2dBrushForeground.Get(), strokeWidth, _strokeStyle.Get());
|
_d2dDeviceContext->DrawLine({ x0, y0 }, { x1, y1 }, _d2dBrushForeground.Get(), strokeWidth, _strokeStyle.Get());
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1751,12 +1750,20 @@ CATCH_RETURN();
|
|||||||
|
|
||||||
[[nodiscard]] Viewport DxEngine::GetViewportInCharacters(const Viewport& viewInPixels) noexcept
|
[[nodiscard]] Viewport DxEngine::GetViewportInCharacters(const Viewport& viewInPixels) noexcept
|
||||||
{
|
{
|
||||||
const short widthInChars = gsl::narrow_cast<short>(viewInPixels.Width() / _glyphCell.width());
|
const short widthInChars = base::saturated_cast<short>(viewInPixels.Width() / _glyphCell.width());
|
||||||
const short heightInChars = gsl::narrow_cast<short>(viewInPixels.Height() / _glyphCell.height());
|
const short heightInChars = base::saturated_cast<short>(viewInPixels.Height() / _glyphCell.height());
|
||||||
|
|
||||||
return Viewport::FromDimensions(viewInPixels.Origin(), { widthInChars, heightInChars });
|
return Viewport::FromDimensions(viewInPixels.Origin(), { widthInChars, heightInChars });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Viewport DxEngine::GetViewportInPixels(const Viewport& viewInCharacters) noexcept
|
||||||
|
{
|
||||||
|
const short widthInPixels = base::saturated_cast<short>(viewInCharacters.Width() * _glyphCell.width());
|
||||||
|
const short heightInPixels = base::saturated_cast<short>(viewInCharacters.Height() * _glyphCell.height());
|
||||||
|
|
||||||
|
return Viewport::FromDimensions(viewInCharacters.Origin(), { widthInPixels, heightInPixels });
|
||||||
|
}
|
||||||
|
|
||||||
// Routine Description:
|
// Routine Description:
|
||||||
// - Sets the DPI in this renderer
|
// - Sets the DPI in this renderer
|
||||||
// Arguments:
|
// Arguments:
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ namespace Microsoft::Console::Render
|
|||||||
[[nodiscard]] HRESULT IsGlyphWideByFont(const std::wstring_view glyph, _Out_ bool* const pResult) noexcept override;
|
[[nodiscard]] HRESULT IsGlyphWideByFont(const std::wstring_view glyph, _Out_ bool* const pResult) noexcept override;
|
||||||
|
|
||||||
[[nodiscard]] ::Microsoft::Console::Types::Viewport GetViewportInCharacters(const ::Microsoft::Console::Types::Viewport& viewInPixels) noexcept;
|
[[nodiscard]] ::Microsoft::Console::Types::Viewport GetViewportInCharacters(const ::Microsoft::Console::Types::Viewport& viewInPixels) noexcept;
|
||||||
|
[[nodiscard]] ::Microsoft::Console::Types::Viewport GetViewportInPixels(const ::Microsoft::Console::Types::Viewport& viewInCharacters) noexcept;
|
||||||
|
|
||||||
float GetScaling() const noexcept;
|
float GetScaling() const noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -855,7 +855,11 @@ bool AdaptDispatch::_WriteResponse(const std::wstring_view reply) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t eventsWritten;
|
size_t eventsWritten;
|
||||||
success = _pConApi->PrivatePrependConsoleInput(inEvents, eventsWritten);
|
// TODO GH#4954 During the input refactor we may want to add a "priority" input list
|
||||||
|
// to make sure that "response" input is spooled directly into the application.
|
||||||
|
// We switched this to an append (vs. a prepend) to fix GH#1637, a bug where two CPR
|
||||||
|
// could collide with eachother.
|
||||||
|
success = _pConApi->PrivateWriteConsoleInputW(inEvents, eventsWritten);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ namespace Microsoft::Console::VirtualTerminal
|
|||||||
virtual bool PrivateEraseAll() = 0;
|
virtual bool PrivateEraseAll() = 0;
|
||||||
virtual bool SetCursorStyle(const CursorType style) = 0;
|
virtual bool SetCursorStyle(const CursorType style) = 0;
|
||||||
virtual bool SetCursorColor(const COLORREF color) = 0;
|
virtual bool SetCursorColor(const COLORREF color) = 0;
|
||||||
virtual bool PrivatePrependConsoleInput(std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
size_t& eventsWritten) = 0;
|
|
||||||
virtual bool PrivateWriteConsoleControlInput(const KeyEvent key) = 0;
|
virtual bool PrivateWriteConsoleControlInput(const KeyEvent key) = 0;
|
||||||
virtual bool PrivateRefreshWindow() = 0;
|
virtual bool PrivateRefreshWindow() = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -259,32 +259,21 @@ public:
|
|||||||
// move all the input events we were given into local storage so we can test against them
|
// move all the input events we were given into local storage so we can test against them
|
||||||
Log::Comment(NoThrowString().Format(L"Moving %zu input events into local storage...", events.size()));
|
Log::Comment(NoThrowString().Format(L"Moving %zu input events into local storage...", events.size()));
|
||||||
|
|
||||||
_events.clear();
|
if (_retainInput)
|
||||||
_events.swap(events);
|
{
|
||||||
|
std::move(events.begin(), events.end(), std::back_inserter(_events));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_events.clear();
|
||||||
|
_events.swap(events);
|
||||||
|
}
|
||||||
eventsWritten = _events.size();
|
eventsWritten = _events.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
return _privateWriteConsoleInputWResult;
|
return _privateWriteConsoleInputWResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrivatePrependConsoleInput(std::deque<std::unique_ptr<IInputEvent>>& events,
|
|
||||||
size_t& eventsWritten) override
|
|
||||||
{
|
|
||||||
Log::Comment(L"PrivatePrependConsoleInput MOCK called...");
|
|
||||||
|
|
||||||
if (_privatePrependConsoleInputResult)
|
|
||||||
{
|
|
||||||
// move all the input events we were given into local storage so we can test against them
|
|
||||||
Log::Comment(NoThrowString().Format(L"Moving %zu input events into local storage...", events.size()));
|
|
||||||
|
|
||||||
_events.clear();
|
|
||||||
_events.swap(events);
|
|
||||||
eventsWritten = _events.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _privatePrependConsoleInputResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PrivateWriteConsoleControlInput(_In_ KeyEvent key) override
|
bool PrivateWriteConsoleControlInput(_In_ KeyEvent key) override
|
||||||
{
|
{
|
||||||
Log::Comment(L"PrivateWriteConsoleControlInput MOCK called...");
|
Log::Comment(L"PrivateWriteConsoleControlInput MOCK called...");
|
||||||
@@ -613,7 +602,6 @@ public:
|
|||||||
_privateGetTextAttributesResult = TRUE;
|
_privateGetTextAttributesResult = TRUE;
|
||||||
_privateSetTextAttributesResult = TRUE;
|
_privateSetTextAttributesResult = TRUE;
|
||||||
_privateWriteConsoleInputWResult = TRUE;
|
_privateWriteConsoleInputWResult = TRUE;
|
||||||
_privatePrependConsoleInputResult = TRUE;
|
|
||||||
_privateWriteConsoleControlInputResult = TRUE;
|
_privateWriteConsoleControlInputResult = TRUE;
|
||||||
_setConsoleWindowInfoResult = TRUE;
|
_setConsoleWindowInfoResult = TRUE;
|
||||||
_moveToBottomResult = true;
|
_moveToBottomResult = true;
|
||||||
@@ -639,6 +627,9 @@ public:
|
|||||||
// Attribute default is gray on black.
|
// Attribute default is gray on black.
|
||||||
_attribute = TextAttribute{ FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED };
|
_attribute = TextAttribute{ FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED };
|
||||||
_expectedAttribute = _attribute;
|
_expectedAttribute = _attribute;
|
||||||
|
|
||||||
|
_events.clear();
|
||||||
|
_retainInput = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrepCursor(CursorX xact, CursorY yact)
|
void PrepCursor(CursorX xact, CursorY yact)
|
||||||
@@ -726,6 +717,16 @@ public:
|
|||||||
static const WORD s_defaultFill = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED; // dark gray on black.
|
static const WORD s_defaultFill = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED; // dark gray on black.
|
||||||
|
|
||||||
std::deque<std::unique_ptr<IInputEvent>> _events;
|
std::deque<std::unique_ptr<IInputEvent>> _events;
|
||||||
|
bool _retainInput{ false };
|
||||||
|
|
||||||
|
auto EnableInputRetentionInScope()
|
||||||
|
{
|
||||||
|
auto oldRetainValue{ _retainInput };
|
||||||
|
_retainInput = true;
|
||||||
|
return wil::scope_exit([oldRetainValue, this] {
|
||||||
|
_retainInput = oldRetainValue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
COORD _bufferSize = { 0, 0 };
|
COORD _bufferSize = { 0, 0 };
|
||||||
SMALL_RECT _viewport = { 0, 0, 0, 0 };
|
SMALL_RECT _viewport = { 0, 0, 0, 0 };
|
||||||
@@ -755,7 +756,6 @@ public:
|
|||||||
bool _privateGetTextAttributesResult = false;
|
bool _privateGetTextAttributesResult = false;
|
||||||
bool _privateSetTextAttributesResult = false;
|
bool _privateSetTextAttributesResult = false;
|
||||||
bool _privateWriteConsoleInputWResult = false;
|
bool _privateWriteConsoleInputWResult = false;
|
||||||
bool _privatePrependConsoleInputResult = false;
|
|
||||||
bool _privateWriteConsoleControlInputResult = false;
|
bool _privateWriteConsoleControlInputResult = false;
|
||||||
|
|
||||||
bool _setConsoleWindowInfoResult = false;
|
bool _setConsoleWindowInfoResult = false;
|
||||||
@@ -1694,25 +1694,59 @@ public:
|
|||||||
{
|
{
|
||||||
Log::Comment(L"Starting test...");
|
Log::Comment(L"Starting test...");
|
||||||
|
|
||||||
Log::Comment(L"Test 1: Verify normal cursor response position.");
|
{
|
||||||
_testGetSet->PrepData(CursorX::XCENTER, CursorY::YCENTER);
|
Log::Comment(L"Test 1: Verify normal cursor response position.");
|
||||||
|
_testGetSet->PrepData(CursorX::XCENTER, CursorY::YCENTER);
|
||||||
|
|
||||||
// start with the cursor position in the buffer.
|
// start with the cursor position in the buffer.
|
||||||
COORD coordCursorExpected = _testGetSet->_cursorPos;
|
COORD coordCursorExpected = _testGetSet->_cursorPos;
|
||||||
|
|
||||||
// to get to VT, we have to adjust it to its position relative to the viewport top.
|
// to get to VT, we have to adjust it to its position relative to the viewport top.
|
||||||
coordCursorExpected.Y -= _testGetSet->_viewport.Top;
|
coordCursorExpected.Y -= _testGetSet->_viewport.Top;
|
||||||
|
|
||||||
// Then note that VT is 1,1 based for the top left, so add 1. (The rest of the console uses 0,0 for array index bases.)
|
// Then note that VT is 1,1 based for the top left, so add 1. (The rest of the console uses 0,0 for array index bases.)
|
||||||
coordCursorExpected.X++;
|
coordCursorExpected.X++;
|
||||||
coordCursorExpected.Y++;
|
coordCursorExpected.Y++;
|
||||||
|
|
||||||
VERIFY_IS_TRUE(_pDispatch.get()->DeviceStatusReport(DispatchTypes::AnsiStatusType::CPR_CursorPositionReport));
|
VERIFY_IS_TRUE(_pDispatch.get()->DeviceStatusReport(DispatchTypes::AnsiStatusType::CPR_CursorPositionReport));
|
||||||
|
|
||||||
wchar_t pwszBuffer[50];
|
wchar_t pwszBuffer[50];
|
||||||
|
|
||||||
swprintf_s(pwszBuffer, ARRAYSIZE(pwszBuffer), L"\x1b[%d;%dR", coordCursorExpected.Y, coordCursorExpected.X);
|
swprintf_s(pwszBuffer, ARRAYSIZE(pwszBuffer), L"\x1b[%d;%dR", coordCursorExpected.Y, coordCursorExpected.X);
|
||||||
_testGetSet->ValidateInputEvent(pwszBuffer);
|
_testGetSet->ValidateInputEvent(pwszBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Log::Comment(L"Test 2: Verify multiple CPRs with a cursor move between them");
|
||||||
|
_testGetSet->PrepData(CursorX::XCENTER, CursorY::YCENTER);
|
||||||
|
|
||||||
|
// enable retention so that the two DSR responses don't delete eachother
|
||||||
|
auto retentionScope{ _testGetSet->EnableInputRetentionInScope() };
|
||||||
|
|
||||||
|
// start with the cursor position in the buffer.
|
||||||
|
til::point coordCursorExpectedFirst{ _testGetSet->_cursorPos };
|
||||||
|
|
||||||
|
// to get to VT, we have to adjust it to its position relative to the viewport top.
|
||||||
|
coordCursorExpectedFirst -= til::point{ 0, _testGetSet->_viewport.Top };
|
||||||
|
|
||||||
|
// Then note that VT is 1,1 based for the top left, so add 1. (The rest of the console uses 0,0 for array index bases.)
|
||||||
|
coordCursorExpectedFirst += til::point{ 1, 1 };
|
||||||
|
|
||||||
|
VERIFY_IS_TRUE(_pDispatch.get()->DeviceStatusReport(DispatchTypes::AnsiStatusType::CPR_CursorPositionReport));
|
||||||
|
|
||||||
|
_testGetSet->_cursorPos.X++;
|
||||||
|
_testGetSet->_cursorPos.Y++;
|
||||||
|
|
||||||
|
auto coordCursorExpectedSecond{ coordCursorExpectedFirst };
|
||||||
|
coordCursorExpectedSecond += til::point{ 1, 1 };
|
||||||
|
|
||||||
|
VERIFY_IS_TRUE(_pDispatch.get()->DeviceStatusReport(DispatchTypes::AnsiStatusType::CPR_CursorPositionReport));
|
||||||
|
|
||||||
|
wchar_t pwszBuffer[50];
|
||||||
|
|
||||||
|
swprintf_s(pwszBuffer, ARRAYSIZE(pwszBuffer), L"\x1b[%d;%dR\x1b[%d;%dR", coordCursorExpectedFirst.y<int>(), coordCursorExpectedFirst.x<int>(), coordCursorExpectedSecond.y<int>(), coordCursorExpectedSecond.x<int>());
|
||||||
|
_testGetSet->ValidateInputEvent(pwszBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_METHOD(DeviceAttributesTests)
|
TEST_METHOD(DeviceAttributesTests)
|
||||||
@@ -1728,7 +1762,7 @@ public:
|
|||||||
|
|
||||||
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
||||||
_testGetSet->PrepData();
|
_testGetSet->PrepData();
|
||||||
_testGetSet->_privatePrependConsoleInputResult = FALSE;
|
_testGetSet->_privateWriteConsoleInputWResult = FALSE;
|
||||||
|
|
||||||
VERIFY_IS_FALSE(_pDispatch.get()->DeviceAttributes());
|
VERIFY_IS_FALSE(_pDispatch.get()->DeviceAttributes());
|
||||||
}
|
}
|
||||||
@@ -1746,7 +1780,7 @@ public:
|
|||||||
|
|
||||||
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
||||||
_testGetSet->PrepData();
|
_testGetSet->PrepData();
|
||||||
_testGetSet->_privatePrependConsoleInputResult = FALSE;
|
_testGetSet->_privateWriteConsoleInputWResult = FALSE;
|
||||||
|
|
||||||
VERIFY_IS_FALSE(_pDispatch.get()->SecondaryDeviceAttributes());
|
VERIFY_IS_FALSE(_pDispatch.get()->SecondaryDeviceAttributes());
|
||||||
}
|
}
|
||||||
@@ -1764,7 +1798,7 @@ public:
|
|||||||
|
|
||||||
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
Log::Comment(L"Test 2: Verify failure when WriteConsoleInput doesn't work.");
|
||||||
_testGetSet->PrepData();
|
_testGetSet->PrepData();
|
||||||
_testGetSet->_privatePrependConsoleInputResult = FALSE;
|
_testGetSet->_privateWriteConsoleInputWResult = FALSE;
|
||||||
|
|
||||||
VERIFY_IS_FALSE(_pDispatch.get()->TertiaryDeviceAttributes());
|
VERIFY_IS_FALSE(_pDispatch.get()->TertiaryDeviceAttributes());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -588,8 +588,7 @@ bool TerminalInput::HandleKey(const IInputEvent* const pInEvent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto senderFunc = [this](const std::wstring_view seq) noexcept
|
const auto senderFunc = [this](const std::wstring_view seq) noexcept {
|
||||||
{
|
|
||||||
_SendInputSequence(seq);
|
_SendInputSequence(seq);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,42 +9,30 @@ using namespace ::Microsoft::Console::Utils;
|
|||||||
// We cannot use spand or not_null because we're dealing with \0\0-terminated buffers of unknown length
|
// We cannot use spand or not_null because we're dealing with \0\0-terminated buffers of unknown length
|
||||||
#pragma warning(disable : 26481 26429)
|
#pragma warning(disable : 26481 26429)
|
||||||
|
|
||||||
// Function Description:
|
|
||||||
// - Wraps win32's CreateEnvironmentBlock to return a smart pointer.
|
|
||||||
EnvironmentBlockPtr Microsoft::Console::Utils::CreateEnvironmentBlock()
|
|
||||||
{
|
|
||||||
void* newEnvironmentBlock{ nullptr };
|
|
||||||
if (!::CreateEnvironmentBlock(&newEnvironmentBlock, GetCurrentProcessToken(), FALSE))
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return EnvironmentBlockPtr{ newEnvironmentBlock };
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function Description:
|
// Function Description:
|
||||||
// - Updates an EnvironmentVariableMapW with the current process's unicode
|
// - Updates an EnvironmentVariableMapW with the current process's unicode
|
||||||
// environment variables ignoring ones already set in the provided map.
|
// environment variables ignoring ones already set in the provided map.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - map: The map to populate with the current processes's environment variables.
|
// - map: The map to populate with the current processes's environment variables.
|
||||||
// - environmentBlock: Optional environment block to use when filling map. If omitted,
|
|
||||||
// defaults to the current environment.
|
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - S_OK if we succeeded, or an appropriate HRESULT for failing
|
// - S_OK if we succeeded, or an appropriate HRESULT for failing
|
||||||
HRESULT Microsoft::Console::Utils::UpdateEnvironmentMapW(EnvironmentVariableMapW& map, void* environmentBlock) noexcept
|
HRESULT Microsoft::Console::Utils::UpdateEnvironmentMapW(EnvironmentVariableMapW& map) noexcept
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wchar_t const* activeEnvironmentBlock{ static_cast<wchar_t const*>(environmentBlock) };
|
LPWCH currentEnvVars{};
|
||||||
|
auto freeCurrentEnv = wil::scope_exit([&] {
|
||||||
|
if (currentEnvVars)
|
||||||
|
{
|
||||||
|
FreeEnvironmentStringsW(currentEnvVars);
|
||||||
|
currentEnvVars = nullptr;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
wil::unique_environstrings_ptr currentEnvVars;
|
currentEnvVars = ::GetEnvironmentStringsW();
|
||||||
if (!activeEnvironmentBlock)
|
RETURN_HR_IF_NULL(E_OUTOFMEMORY, currentEnvVars);
|
||||||
{
|
|
||||||
currentEnvVars.reset(::GetEnvironmentStringsW());
|
|
||||||
RETURN_HR_IF_NULL(E_OUTOFMEMORY, currentEnvVars);
|
|
||||||
activeEnvironmentBlock = currentEnvVars.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Each entry is NULL-terminated; block is guaranteed to be double-NULL terminated at a minimum.
|
// Each entry is NULL-terminated; block is guaranteed to be double-NULL terminated at a minimum.
|
||||||
for (wchar_t const* lastCh{ activeEnvironmentBlock }; *lastCh != '\0'; ++lastCh)
|
for (wchar_t const* lastCh{ currentEnvVars }; *lastCh != '\0'; ++lastCh)
|
||||||
{
|
{
|
||||||
// Copy current entry into temporary map.
|
// Copy current entry into temporary map.
|
||||||
const size_t cchEntry{ ::wcslen(lastCh) };
|
const size_t cchEntry{ ::wcslen(lastCh) };
|
||||||
|
|||||||
@@ -579,6 +579,7 @@ IFACEMETHODIMP UiaTextRangeBase::Move(_In_ TextUnit unit,
|
|||||||
// We can abstract this movement by moving _start, but disallowing moving to the end of the buffer
|
// We can abstract this movement by moving _start, but disallowing moving to the end of the buffer
|
||||||
constexpr auto endpoint = TextPatternRangeEndpoint::TextPatternRangeEndpoint_Start;
|
constexpr auto endpoint = TextPatternRangeEndpoint::TextPatternRangeEndpoint_Start;
|
||||||
constexpr auto preventBufferEnd = true;
|
constexpr auto preventBufferEnd = true;
|
||||||
|
const auto wasDegenerate = IsDegenerate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (unit == TextUnit::TextUnit_Character)
|
if (unit == TextUnit::TextUnit_Character)
|
||||||
@@ -603,8 +604,17 @@ IFACEMETHODIMP UiaTextRangeBase::Move(_In_ TextUnit unit,
|
|||||||
// If we actually moved...
|
// If we actually moved...
|
||||||
if (*pRetVal != 0)
|
if (*pRetVal != 0)
|
||||||
{
|
{
|
||||||
// then just expand to get our _end
|
if (wasDegenerate)
|
||||||
ExpandToEnclosingUnit(unit);
|
{
|
||||||
|
// GH#7342: The range was degenerate before the move.
|
||||||
|
// To keep it that way, move _end to the new _start.
|
||||||
|
_end = _start;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// then just expand to get our _end
|
||||||
|
ExpandToEnclosingUnit(unit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UiaTracing::TextRange::Move(unit, count, *pRetVal, *this);
|
UiaTracing::TextRange::Move(unit, count, *pRetVal, *this);
|
||||||
@@ -702,8 +712,13 @@ try
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
const auto bufferSize = _pData->GetTextBuffer().GetSize();
|
||||||
|
if (!bufferSize.IsInBounds(_start, true) || !bufferSize.IsInBounds(_end, true))
|
||||||
|
{
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
auto inclusiveEnd = _end;
|
auto inclusiveEnd = _end;
|
||||||
_pData->GetTextBuffer().GetSize().DecrementInBounds(inclusiveEnd);
|
bufferSize.DecrementInBounds(inclusiveEnd);
|
||||||
_pData->SelectNewRegion(_start, inclusiveEnd);
|
_pData->SelectNewRegion(_start, inclusiveEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ static const WORD leftShiftScanCode = 0x2A;
|
|||||||
THROW_IF_FAILED(SizeTToInt(source.size(), &iSource));
|
THROW_IF_FAILED(SizeTToInt(source.size(), &iSource));
|
||||||
|
|
||||||
// Ask how much space we will need.
|
// Ask how much space we will need.
|
||||||
|
// In certain codepages, Mb2Wc will "successfully" produce zero characters (like in CP50220, where a SHIFT-IN character
|
||||||
|
// is consumed but not transformed into anything) without explicitly failing. When it does this, GetLastError will return
|
||||||
|
// the last error encountered by the last function that actually did have an error.
|
||||||
|
// This is arguably correct (as the documentation says "The function returns 0 if it does not succeed"). There is a
|
||||||
|
// difference that we **don't actually care about** between failing and successfully producing zero characters.,
|
||||||
|
// Anyway: we need to clear the last error so that we can fail out and IGNORE_BAD_GLE after it inevitably succeed-fails.
|
||||||
|
SetLastError(0);
|
||||||
int const iTarget = MultiByteToWideChar(codePage, 0, source.data(), iSource, nullptr, 0);
|
int const iTarget = MultiByteToWideChar(codePage, 0, source.data(), iSource, nullptr, 0);
|
||||||
THROW_LAST_ERROR_IF_AND_IGNORE_BAD_GLE(0 == iTarget);
|
THROW_LAST_ERROR_IF_AND_IGNORE_BAD_GLE(0 == iTarget);
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,9 @@ namespace Microsoft::Console::Utils
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using EnvironmentBlockPtr = wil::unique_any<void*, decltype(::DestroyEnvironmentBlock), ::DestroyEnvironmentBlock>;
|
|
||||||
[[nodiscard]] EnvironmentBlockPtr CreateEnvironmentBlock();
|
|
||||||
|
|
||||||
using EnvironmentVariableMapW = std::map<std::wstring, std::wstring, WStringCaseInsensitiveCompare>;
|
using EnvironmentVariableMapW = std::map<std::wstring, std::wstring, WStringCaseInsensitiveCompare>;
|
||||||
|
|
||||||
[[nodiscard]] HRESULT UpdateEnvironmentMapW(EnvironmentVariableMapW& map, void* environmentBlock = nullptr) noexcept;
|
[[nodiscard]] HRESULT UpdateEnvironmentMapW(EnvironmentVariableMapW& map) noexcept;
|
||||||
|
|
||||||
[[nodiscard]] HRESULT EnvironmentMapToEnvironmentStringsW(EnvironmentVariableMapW& map,
|
[[nodiscard]] HRESULT EnvironmentMapToEnvironmentStringsW(EnvironmentVariableMapW& map,
|
||||||
std::vector<wchar_t>& newEnvVars) noexcept;
|
std::vector<wchar_t>& newEnvVars) noexcept;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ Abstract:
|
|||||||
|
|
||||||
// Windows Header Files:
|
// Windows Header Files:
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <userenv.h>
|
|
||||||
#include <combaseapi.h>
|
#include <combaseapi.h>
|
||||||
#include <UIAutomation.h>
|
#include <UIAutomation.h>
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
|
|||||||
@@ -323,7 +323,10 @@ function Invoke-ClangFormat {
|
|||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
|
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
|
||||||
[string[]]$Path
|
[string[]]$Path,
|
||||||
|
|
||||||
|
[Parameter(Mandatory=$false)]
|
||||||
|
[string]$ClangFormatPath = "clang-format" # (whichever one is in $PATH)
|
||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
@@ -340,7 +343,7 @@ function Invoke-ClangFormat {
|
|||||||
End {
|
End {
|
||||||
For($i = [int]0; $i -Lt $Paths.Length; $i += $BatchSize) {
|
For($i = [int]0; $i -Lt $Paths.Length; $i += $BatchSize) {
|
||||||
Try {
|
Try {
|
||||||
& "$env:OpenconsoleRoot/dep/llvm/clang-format" -i $Paths[$i .. ($i + $BatchSize - 1)]
|
& $ClangFormatPath -i $Paths[$i .. ($i + $BatchSize - 1)]
|
||||||
} Catch {
|
} Catch {
|
||||||
Write-Error $_
|
Write-Error $_
|
||||||
}
|
}
|
||||||
@@ -351,9 +354,12 @@ function Invoke-ClangFormat {
|
|||||||
#.SYNOPSIS
|
#.SYNOPSIS
|
||||||
# runs code formatting on all c++ files
|
# runs code formatting on all c++ files
|
||||||
function Invoke-CodeFormat() {
|
function Invoke-CodeFormat() {
|
||||||
|
& "$env:OpenConsoleRoot\dep\nuget\nuget.exe" restore "$env:OpenConsoleRoot\tools\packages.config"
|
||||||
|
$clangPackage = ([xml](Get-Content "$env:OpenConsoleRoot\tools\packages.config")).packages.package | Where-Object id -like "clang-format*"
|
||||||
|
$clangFormatPath = "$env:OpenConsoleRoot\packages\$($clangPackage.id).$($clangPackage.version)\tools\clang-format.exe"
|
||||||
Get-ChildItem -Recurse "$env:OpenConsoleRoot/src" -Include *.cpp, *.hpp, *.h |
|
Get-ChildItem -Recurse "$env:OpenConsoleRoot/src" -Include *.cpp, *.hpp, *.h |
|
||||||
Where FullName -NotLike "*Generated Files*" |
|
Where FullName -NotLike "*Generated Files*" |
|
||||||
Invoke-ClangFormat
|
Invoke-ClangFormat -ClangFormatPath $clangFormatPath
|
||||||
}
|
}
|
||||||
|
|
||||||
Export-ModuleMember -Function Set-MsbuildDevEnvironment,Invoke-OpenConsoleTests,Invoke-OpenConsoleBuild,Start-OpenConsole,Debug-OpenConsole,Invoke-CodeFormat
|
Export-ModuleMember -Function Set-MsbuildDevEnvironment,Invoke-OpenConsoleTests,Invoke-OpenConsoleBuild,Start-OpenConsole,Debug-OpenConsole,Invoke-CodeFormat
|
||||||
|
|||||||
4
tools/packages.config
Normal file
4
tools/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="clang-format.win-x86" version="10.0.0" targetFramework="native" />
|
||||||
|
</packages>
|
||||||
Reference in New Issue
Block a user