Compare commits
45 commits
main
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
258a3f32ad | |||
596586d911 | |||
afb0cac3e3 | |||
bae1793de4 | |||
fd4af02ff3 | |||
d5ff31cdfd | |||
889ffe9934 | |||
dc77f8cbce | |||
0480f20d20 | |||
5c93e4bf12 | |||
d3db8f8480 | |||
91d599b830 | |||
89b420c572 | |||
e9d8b53e7c | |||
50acd89814 | |||
d49d045bd9 | |||
dbe688dcd9 | |||
39f3f23da8 | |||
8c5f676533 | |||
6c60f2be82 | |||
f9ba77f186 | |||
9a2a9db5e9 | |||
079cadeb18 | |||
cf859053a1 | |||
cd6ec2d625 | |||
bf6fd9d67f | |||
e77ab2b036 | |||
1b996e7416 | |||
8a73c69567 | |||
44e99f4976 | |||
a7f2a8badd | |||
ee058551c5 | |||
febbf083e4 | |||
658e6e6ee2 | |||
3fd8ebf319 | |||
1a4e2e65d7 | |||
33774d23d6 | |||
f284843afd | |||
fd06b0ce60 | |||
c8ac63e78e | |||
414adf16a9 | |||
3533aa2661 | |||
fbc59b7a3b | |||
30f1c64e08 | |||
d9c93430a0 |
28
.github/actions/spelling/allow/allow.txt
vendored
28
.github/actions/spelling/allow/allow.txt
vendored
|
@ -1,10 +1,15 @@
|
|||
Apc
|
||||
apc
|
||||
calt
|
||||
ccmp
|
||||
changelog
|
||||
cybersecurity
|
||||
Apc
|
||||
clickable
|
||||
clig
|
||||
copyable
|
||||
dalet
|
||||
Dcs
|
||||
dcs
|
||||
Dcs
|
||||
dialytika
|
||||
dje
|
||||
downside
|
||||
|
@ -12,7 +17,10 @@ downsides
|
|||
dze
|
||||
dzhe
|
||||
Enum'd
|
||||
Fitt
|
||||
formattings
|
||||
ftp
|
||||
fvar
|
||||
geeksforgeeks
|
||||
ghe
|
||||
gje
|
||||
|
@ -24,9 +32,17 @@ hyperlinks
|
|||
img
|
||||
It'd
|
||||
kje
|
||||
liga
|
||||
lje
|
||||
locl
|
||||
lorem
|
||||
Llast
|
||||
Lmid
|
||||
Lorigin
|
||||
maxed
|
||||
mkmk
|
||||
mru
|
||||
noreply
|
||||
nje
|
||||
ogonek
|
||||
ok'd
|
||||
|
@ -34,18 +50,26 @@ overlined
|
|||
postmodern
|
||||
ptys
|
||||
qof
|
||||
qps
|
||||
rclt
|
||||
reimplementation
|
||||
reserialization
|
||||
reserialize
|
||||
reserializes
|
||||
rlig
|
||||
runtimes
|
||||
shcha
|
||||
slnt
|
||||
Sos
|
||||
timestamped
|
||||
TLDR
|
||||
tokenizes
|
||||
tonos
|
||||
tshe
|
||||
uiatextrange
|
||||
UIs
|
||||
und
|
||||
unregister
|
||||
versioned
|
||||
We'd
|
||||
wildcards
|
||||
|
|
42
.github/actions/spelling/allow/apis.txt
vendored
42
.github/actions/spelling/allow/apis.txt
vendored
|
@ -2,15 +2,20 @@ ACCEPTFILES
|
|||
ACCESSDENIED
|
||||
alignas
|
||||
alignof
|
||||
APPLYTOSUBMENUS
|
||||
bitfield
|
||||
bitfields
|
||||
BUILDBRANCH
|
||||
BUILDMSG
|
||||
BUILDNUMBER
|
||||
BYPOSITION
|
||||
charconv
|
||||
CLASSNOTAVAILABLE
|
||||
cmdletbinding
|
||||
COLORPROPERTY
|
||||
colspan
|
||||
COMDLG
|
||||
comparand
|
||||
cstdint
|
||||
CXICON
|
||||
CYICON
|
||||
|
@ -20,9 +25,11 @@ DERR
|
|||
dlldata
|
||||
DONTADDTORECENT
|
||||
DWORDLONG
|
||||
enumset
|
||||
environstrings
|
||||
EXPCMDFLAGS
|
||||
EXPCMDSTATE
|
||||
filetime
|
||||
FILTERSPEC
|
||||
FORCEFILESYSTEM
|
||||
FORCEMINIMIZE
|
||||
|
@ -45,6 +52,7 @@ IBind
|
|||
IBox
|
||||
IClass
|
||||
IComparable
|
||||
IComparer
|
||||
IConnection
|
||||
ICustom
|
||||
IDialog
|
||||
|
@ -58,6 +66,8 @@ IObject
|
|||
iosfwd
|
||||
IPackage
|
||||
IPeasant
|
||||
isspace
|
||||
ISetup
|
||||
IStorage
|
||||
istream
|
||||
IStringable
|
||||
|
@ -65,26 +75,40 @@ ITab
|
|||
ITaskbar
|
||||
IUri
|
||||
IVirtual
|
||||
KEYSELECT
|
||||
LCID
|
||||
llabs
|
||||
llu
|
||||
localtime
|
||||
lround
|
||||
LSHIFT
|
||||
MENUCOMMAND
|
||||
MENUDATA
|
||||
MENUINFO
|
||||
memicmp
|
||||
mptt
|
||||
mov
|
||||
msappx
|
||||
MULTIPLEUSE
|
||||
NCHITTEST
|
||||
NCLBUTTONDBLCLK
|
||||
NCRBUTTONDBLCLK
|
||||
NIF
|
||||
NIN
|
||||
NOAGGREGATION
|
||||
NOASYNC
|
||||
NOCHANGEDIR
|
||||
NOPROGRESS
|
||||
NOREDIRECTIONBITMAP
|
||||
NOREPEAT
|
||||
NOTIFYBYPOS
|
||||
NOTIFYICON
|
||||
NOTIFYICONDATA
|
||||
ntprivapi
|
||||
oaidl
|
||||
ocidl
|
||||
ODR
|
||||
offsetof
|
||||
osver
|
||||
OSVERSIONINFOEXW
|
||||
otms
|
||||
|
@ -93,6 +117,7 @@ overridable
|
|||
PAGESCROLL
|
||||
PICKFOLDERS
|
||||
pmr
|
||||
rcx
|
||||
REGCLS
|
||||
RETURNCMD
|
||||
rfind
|
||||
|
@ -101,41 +126,54 @@ RSHIFT
|
|||
schandle
|
||||
semver
|
||||
serializer
|
||||
SETVERSION
|
||||
SHELLEXECUTEINFOW
|
||||
shobjidl
|
||||
SHOWMINIMIZED
|
||||
SHOWTIP
|
||||
SINGLEUSE
|
||||
SIZENS
|
||||
smoothstep
|
||||
snprintf
|
||||
spsc
|
||||
sregex
|
||||
SRWLOC
|
||||
SRWLOCK
|
||||
STDCPP
|
||||
STDMETHOD
|
||||
strchr
|
||||
strcpy
|
||||
streambuf
|
||||
strtoul
|
||||
Stubless
|
||||
Subheader
|
||||
Subpage
|
||||
syscall
|
||||
TASKBARCREATED
|
||||
TBPF
|
||||
THEMECHANGED
|
||||
tlg
|
||||
tmp
|
||||
tolower
|
||||
toupper
|
||||
TTask
|
||||
TVal
|
||||
UChar
|
||||
UPDATEINIFILE
|
||||
userenv
|
||||
wcsstr
|
||||
wcstoui
|
||||
winmain
|
||||
wmemcmp
|
||||
wpc
|
||||
wsregex
|
||||
wwinmain
|
||||
xchg
|
||||
XDocument
|
||||
XElement
|
||||
xfacet
|
||||
xhash
|
||||
XIcon
|
||||
xiosbase
|
||||
xlocale
|
||||
xlocbuf
|
||||
|
@ -144,9 +182,13 @@ xlocmes
|
|||
xlocmon
|
||||
xlocnum
|
||||
xloctime
|
||||
XMax
|
||||
xmemory
|
||||
XParse
|
||||
xpath
|
||||
xstddef
|
||||
xstring
|
||||
xtree
|
||||
xutility
|
||||
YIcon
|
||||
YMax
|
||||
|
|
1
.github/actions/spelling/allow/fonts.txt
vendored
1
.github/actions/spelling/allow/fonts.txt
vendored
|
@ -7,3 +7,4 @@ Iosevka
|
|||
MDL
|
||||
Monofur
|
||||
Segoe
|
||||
wght
|
||||
|
|
8
.github/actions/spelling/allow/math.txt
vendored
8
.github/actions/spelling/allow/math.txt
vendored
|
@ -1,3 +1,11 @@
|
|||
atan
|
||||
CPrime
|
||||
HBar
|
||||
HPrime
|
||||
isnan
|
||||
LPrime
|
||||
LStep
|
||||
powf
|
||||
RSub
|
||||
sqrtf
|
||||
ULP
|
||||
|
|
14
.github/actions/spelling/allow/microsoft.txt
vendored
14
.github/actions/spelling/allow/microsoft.txt
vendored
|
@ -1,5 +1,6 @@
|
|||
ACLs
|
||||
ADMINS
|
||||
advapi
|
||||
altform
|
||||
altforms
|
||||
appendwttlogging
|
||||
|
@ -7,6 +8,7 @@ appx
|
|||
appxbundle
|
||||
appxerror
|
||||
appxmanifest
|
||||
ATL
|
||||
backplating
|
||||
bitmaps
|
||||
BOMs
|
||||
|
@ -14,6 +16,7 @@ CPLs
|
|||
cpptools
|
||||
cppvsdbg
|
||||
CPRs
|
||||
cryptbase
|
||||
DACL
|
||||
DACLs
|
||||
diffs
|
||||
|
@ -23,14 +26,20 @@ DTDs
|
|||
DWINRT
|
||||
enablewttlogging
|
||||
Intelli
|
||||
IVisual
|
||||
LKG
|
||||
LOCKFILE
|
||||
Lxss
|
||||
mfcribbon
|
||||
microsoft
|
||||
microsoftonline
|
||||
MSAA
|
||||
msixbundle
|
||||
MSVC
|
||||
muxc
|
||||
netcore
|
||||
osgvsowi
|
||||
PFILETIME
|
||||
pgc
|
||||
pgo
|
||||
pgosweep
|
||||
|
@ -38,10 +47,14 @@ powerrename
|
|||
powershell
|
||||
propkey
|
||||
pscustomobject
|
||||
QWORD
|
||||
regedit
|
||||
robocopy
|
||||
SACLs
|
||||
sdkddkver
|
||||
Shobjidl
|
||||
Skype
|
||||
SRW
|
||||
sxs
|
||||
Sysinternals
|
||||
sysnative
|
||||
|
@ -56,6 +69,7 @@ Virtualization
|
|||
visualstudio
|
||||
vscode
|
||||
VSTHRD
|
||||
winsdkver
|
||||
wlk
|
||||
wslpath
|
||||
wtl
|
||||
|
|
3
.github/actions/spelling/allow/names.txt
vendored
3
.github/actions/spelling/allow/names.txt
vendored
|
@ -31,6 +31,7 @@ Kourosh
|
|||
kowalczyk
|
||||
leonmsft
|
||||
Lepilleur
|
||||
lhecker
|
||||
lukesampson
|
||||
Manandhar
|
||||
mbadolato
|
||||
|
@ -52,6 +53,7 @@ oldnewthing
|
|||
opengl
|
||||
osgwiki
|
||||
pabhojwa
|
||||
panos
|
||||
paulcam
|
||||
pauldotknopf
|
||||
PGP
|
||||
|
@ -66,6 +68,7 @@ sonpham
|
|||
stakx
|
||||
thereses
|
||||
Walisch
|
||||
Wellons
|
||||
Wirt
|
||||
Wojciech
|
||||
zadjii
|
||||
|
|
3
.github/actions/spelling/expect/alphabet.txt
vendored
3
.github/actions/spelling/expect/alphabet.txt
vendored
|
@ -2,10 +2,7 @@ AAAa
|
|||
AAAAA
|
||||
AAAAAAAAAAAAA
|
||||
AAAAAABBBBBBCCC
|
||||
AAAAABBBBBBBCCC
|
||||
AAAAABBBBBBCCC
|
||||
AAAAABCCCCCCCCC
|
||||
AAAAADCCCCCCCCC
|
||||
abcd
|
||||
abcd
|
||||
abcde
|
||||
|
|
81
.github/actions/spelling/expect/expect.txt
vendored
81
.github/actions/spelling/expect/expect.txt
vendored
|
@ -14,7 +14,6 @@ ACTIVEBORDER
|
|||
ACTIVECAPTION
|
||||
adaa
|
||||
ADDALIAS
|
||||
ADDB
|
||||
ADDREF
|
||||
addressof
|
||||
ADDSTRING
|
||||
|
@ -50,6 +49,7 @@ APARTMENTTHREADED
|
|||
APCs
|
||||
api
|
||||
APIENTRY
|
||||
apimswincoresynchl
|
||||
apiset
|
||||
APPBARDATA
|
||||
appconsult
|
||||
|
@ -105,6 +105,7 @@ autoscrolling
|
|||
Autowrap
|
||||
AVerify
|
||||
AVI
|
||||
AVX
|
||||
awch
|
||||
azuredevopspodcast
|
||||
azzle
|
||||
|
@ -114,6 +115,7 @@ Backgrounder
|
|||
backgrounding
|
||||
backport
|
||||
backstory
|
||||
barbaz
|
||||
Batang
|
||||
baz
|
||||
Bazz
|
||||
|
@ -163,9 +165,11 @@ BPBF
|
|||
bpp
|
||||
BPPF
|
||||
branchconfig
|
||||
brandings
|
||||
BRK
|
||||
Browsable
|
||||
bsearch
|
||||
Bspace
|
||||
bstr
|
||||
BTNFACE
|
||||
buf
|
||||
|
@ -183,12 +187,13 @@ bytebuffer
|
|||
cac
|
||||
cacafire
|
||||
callee
|
||||
cang
|
||||
capslock
|
||||
CARETBLINKINGENABLED
|
||||
carlos
|
||||
CARRIAGERETURN
|
||||
cascadia
|
||||
cassert
|
||||
castsi
|
||||
catid
|
||||
cazamor
|
||||
CBash
|
||||
|
@ -267,9 +272,12 @@ cmder
|
|||
CMDEXT
|
||||
Cmdlet
|
||||
cmdline
|
||||
cmh
|
||||
CMOUSEBUTTONS
|
||||
cmp
|
||||
cmpeq
|
||||
cmt
|
||||
cmw
|
||||
cmyk
|
||||
CNL
|
||||
cnt
|
||||
|
@ -379,6 +387,7 @@ cplusplus
|
|||
cpp
|
||||
CPPCORECHECK
|
||||
cppcorecheckrules
|
||||
cppm
|
||||
cpprest
|
||||
cpprestsdk
|
||||
cppwinrt
|
||||
|
@ -401,11 +410,13 @@ csbiex
|
|||
csharp
|
||||
CSHORT
|
||||
CSIDL
|
||||
Cspace
|
||||
csproj
|
||||
Csr
|
||||
csrmsg
|
||||
CSRSS
|
||||
csrutil
|
||||
css
|
||||
cstdarg
|
||||
cstddef
|
||||
cstdio
|
||||
|
@ -496,7 +507,6 @@ DEADCHAR
|
|||
dealloc
|
||||
Debian
|
||||
debolden
|
||||
debounce
|
||||
debugtype
|
||||
DECALN
|
||||
DECANM
|
||||
|
@ -505,6 +515,8 @@ DECAWM
|
|||
DECCKM
|
||||
DECCOLM
|
||||
DECDHL
|
||||
decdld
|
||||
DECDLD
|
||||
DECDWL
|
||||
DECEKBD
|
||||
DECID
|
||||
|
@ -525,6 +537,7 @@ DECRC
|
|||
DECREQTPARM
|
||||
DECRLM
|
||||
DECRQM
|
||||
DECRQSS
|
||||
DECRST
|
||||
DECSASD
|
||||
DECSC
|
||||
|
@ -545,6 +558,7 @@ DECSTR
|
|||
DECSWL
|
||||
DECTCEM
|
||||
Dedupe
|
||||
deduplicate
|
||||
deduplicated
|
||||
DEFAPP
|
||||
DEFAULTBACKGROUND
|
||||
|
@ -654,6 +668,7 @@ dwriteglyphrundescriptionclustermap
|
|||
dxgi
|
||||
dxgidwm
|
||||
dxinterop
|
||||
dxsm
|
||||
dxttbmp
|
||||
eachother
|
||||
eae
|
||||
|
@ -757,7 +772,6 @@ filepath
|
|||
FILESUBTYPE
|
||||
FILESYSPATH
|
||||
filesystem
|
||||
FILETIME
|
||||
FILETYPE
|
||||
fileurl
|
||||
FILEW
|
||||
|
@ -773,11 +787,13 @@ FINDSTRINGEXACT
|
|||
FINDUP
|
||||
FIter
|
||||
FIXEDCONVERTED
|
||||
FIXEDFILEINFO
|
||||
Flg
|
||||
flyout
|
||||
fmodern
|
||||
fmtarg
|
||||
fmtid
|
||||
FNV
|
||||
FOLDERID
|
||||
FONTCHANGE
|
||||
fontdlg
|
||||
|
@ -786,6 +802,7 @@ FONTENUMPROC
|
|||
FONTFACE
|
||||
FONTFAMILY
|
||||
FONTHEIGHT
|
||||
FONTINFO
|
||||
fontlist
|
||||
FONTOK
|
||||
FONTSIZE
|
||||
|
@ -795,6 +812,7 @@ FONTTYPE
|
|||
FONTWEIGHT
|
||||
FONTWIDTH
|
||||
FONTWINDOW
|
||||
fooo
|
||||
forceinline
|
||||
FORCEOFFFEEDBACK
|
||||
FORCEONFEEDBACK
|
||||
|
@ -898,6 +916,7 @@ github
|
|||
gitlab
|
||||
gle
|
||||
globals
|
||||
GLYPHENTRY
|
||||
gmail
|
||||
GMEM
|
||||
GNUC
|
||||
|
@ -946,6 +965,7 @@ hdrstop
|
|||
HEIGHTSCROLL
|
||||
hfile
|
||||
hfont
|
||||
hfontresource
|
||||
hglobal
|
||||
hhh
|
||||
HHmm
|
||||
|
@ -981,7 +1001,7 @@ hostlib
|
|||
Hostx
|
||||
HPA
|
||||
HPAINTBUFFER
|
||||
hpcon
|
||||
HPCON
|
||||
hpj
|
||||
hpp
|
||||
HPR
|
||||
|
@ -1020,6 +1040,7 @@ IAction
|
|||
IApi
|
||||
IApplication
|
||||
IBase
|
||||
ICache
|
||||
icacls
|
||||
iccex
|
||||
icch
|
||||
|
@ -1113,6 +1134,7 @@ interop
|
|||
interoperability
|
||||
inthread
|
||||
intptr
|
||||
intrin
|
||||
intsafe
|
||||
INVALIDARG
|
||||
INVALIDATERECT
|
||||
|
@ -1165,6 +1187,7 @@ IWin
|
|||
IWindow
|
||||
IXaml
|
||||
IXMP
|
||||
ixx
|
||||
jconcpp
|
||||
JOBOBJECT
|
||||
JOBOBJECTINFOCLASS
|
||||
|
@ -1209,6 +1232,7 @@ KLF
|
|||
KLMNO
|
||||
KLMNOPQRST
|
||||
KLMNOPQRSTQQQQQ
|
||||
KPRIORITY
|
||||
KVM
|
||||
langid
|
||||
LANGUAGELIST
|
||||
|
@ -1257,6 +1281,7 @@ lnkd
|
|||
lnkfile
|
||||
LNM
|
||||
LOADONCALL
|
||||
loadu
|
||||
LOBYTE
|
||||
localappdata
|
||||
localhost
|
||||
|
@ -1264,6 +1289,7 @@ locsrc
|
|||
locstudio
|
||||
Loewen
|
||||
LOGFONT
|
||||
LOGFONTA
|
||||
LOGFONTW
|
||||
logissue
|
||||
lowercased
|
||||
|
@ -1368,7 +1394,6 @@ MEASUREITEM
|
|||
megamix
|
||||
memallocator
|
||||
memcmp
|
||||
memcopy
|
||||
memcpy
|
||||
memmove
|
||||
memset
|
||||
|
@ -1418,6 +1443,7 @@ MOUSEFIRST
|
|||
MOUSEHWHEEL
|
||||
MOUSEMOVE
|
||||
mousewheel
|
||||
movemask
|
||||
MOVESTART
|
||||
msb
|
||||
msbuild
|
||||
|
@ -1444,11 +1470,13 @@ MSVCRTD
|
|||
MSVS
|
||||
msys
|
||||
msysgit
|
||||
MTSM
|
||||
mui
|
||||
Mul
|
||||
multiline
|
||||
munged
|
||||
munges
|
||||
murmurhash
|
||||
mutex
|
||||
mutexes
|
||||
muxes
|
||||
|
@ -1499,6 +1527,7 @@ nfe
|
|||
nlength
|
||||
Nls
|
||||
NLSMODE
|
||||
nnn
|
||||
NOACTIVATE
|
||||
NOAPPLYNOW
|
||||
NOCLIP
|
||||
|
@ -1579,6 +1608,7 @@ NTVDM
|
|||
ntverp
|
||||
NTWIN
|
||||
nuget
|
||||
nullability
|
||||
nullness
|
||||
nullonfailure
|
||||
nullopt
|
||||
|
@ -1613,6 +1643,7 @@ onecoreuapuuid
|
|||
onecoreuuid
|
||||
ONECOREWINDOWS
|
||||
onehalf
|
||||
oneseq
|
||||
ONLCR
|
||||
openbash
|
||||
opencode
|
||||
|
@ -1643,6 +1674,7 @@ oss
|
|||
ostream
|
||||
ostringstream
|
||||
ouicompat
|
||||
OUnter
|
||||
outdir
|
||||
outfile
|
||||
Outof
|
||||
|
@ -1653,6 +1685,7 @@ Outptr
|
|||
OVERLAPPEDWINDOW
|
||||
OWNDC
|
||||
OWNERDRAWFIXED
|
||||
packagename
|
||||
packageuwp
|
||||
PACKCOORD
|
||||
PACKVERSION
|
||||
|
@ -1677,6 +1710,7 @@ pcch
|
|||
PCCHAR
|
||||
PCCONSOLE
|
||||
PCD
|
||||
pcg
|
||||
pch
|
||||
PCHAR
|
||||
PCIDLIST
|
||||
|
@ -1772,6 +1806,7 @@ POSX
|
|||
POSXSCROLL
|
||||
POSYSCROLL
|
||||
ppci
|
||||
PPEB
|
||||
ppf
|
||||
ppguid
|
||||
ppidl
|
||||
|
@ -1922,6 +1957,7 @@ realloc
|
|||
reamapping
|
||||
rects
|
||||
redef
|
||||
redefinable
|
||||
Redir
|
||||
redirector
|
||||
redist
|
||||
|
@ -1943,7 +1979,7 @@ REGSTR
|
|||
reingest
|
||||
Relayout
|
||||
RELBINPATH
|
||||
Remoting
|
||||
remoting
|
||||
renamer
|
||||
renderengine
|
||||
rendersize
|
||||
|
@ -1964,11 +2000,12 @@ resx
|
|||
retval
|
||||
rfa
|
||||
rfc
|
||||
rfid
|
||||
rftp
|
||||
rgb
|
||||
rgba
|
||||
RGBCOLOR
|
||||
rgbi
|
||||
rgch
|
||||
rgci
|
||||
rgfae
|
||||
rgfte
|
||||
|
@ -1985,9 +2022,11 @@ rhs
|
|||
RIGHTALIGN
|
||||
RIGHTBUTTON
|
||||
riid
|
||||
Rike
|
||||
RIPMSG
|
||||
RIS
|
||||
RMENU
|
||||
rng
|
||||
roadmap
|
||||
robomac
|
||||
roundtrip
|
||||
|
@ -2033,7 +2072,6 @@ scanline
|
|||
schemename
|
||||
SCL
|
||||
scm
|
||||
scprintf
|
||||
SCRBUF
|
||||
SCRBUFSIZE
|
||||
screenbuffer
|
||||
|
@ -2044,8 +2082,6 @@ scriptload
|
|||
Scrollable
|
||||
scrollback
|
||||
scrollbar
|
||||
Scrolldown
|
||||
Scrolldownpage
|
||||
Scroller
|
||||
SCROLLFORWARD
|
||||
SCROLLINFO
|
||||
|
@ -2053,8 +2089,6 @@ scrolllock
|
|||
scrolloffset
|
||||
SCROLLSCALE
|
||||
SCROLLSCREENBUFFER
|
||||
Scrollup
|
||||
Scrolluppage
|
||||
scursor
|
||||
sddl
|
||||
sdeleted
|
||||
|
@ -2069,8 +2103,7 @@ selectany
|
|||
SELECTEDFONT
|
||||
SELECTSTRING
|
||||
Selfhosters
|
||||
serializer
|
||||
serializers
|
||||
SERIALIZERS
|
||||
SERVERDLL
|
||||
SETACTIVE
|
||||
SETBUDDYINT
|
||||
|
@ -2142,6 +2175,7 @@ SIGDN
|
|||
SINGLEFLAG
|
||||
SINGLETHREADED
|
||||
siup
|
||||
sixel
|
||||
SIZEBOX
|
||||
sizeof
|
||||
SIZESCROLL
|
||||
|
@ -2213,6 +2247,7 @@ stoi
|
|||
stol
|
||||
stoul
|
||||
stoutapot
|
||||
Stri
|
||||
strikethrough
|
||||
stringstream
|
||||
STRINGTABLE
|
||||
|
@ -2245,6 +2280,7 @@ SWMR
|
|||
SWP
|
||||
swprintf
|
||||
SYMED
|
||||
symlink
|
||||
SYNCPAINT
|
||||
sys
|
||||
syscalls
|
||||
|
@ -2311,7 +2347,6 @@ testmddefinition
|
|||
testmode
|
||||
testname
|
||||
testnameprefix
|
||||
testnetv
|
||||
TESTNULL
|
||||
testpass
|
||||
testpasses
|
||||
|
@ -2347,7 +2382,6 @@ TITLEISLINKNAME
|
|||
TJson
|
||||
TLambda
|
||||
TLEN
|
||||
Tlg
|
||||
Tlgdata
|
||||
TMAE
|
||||
TMPF
|
||||
|
@ -2422,7 +2456,6 @@ uapadmin
|
|||
UAX
|
||||
ubuntu
|
||||
ucd
|
||||
ucd
|
||||
ucdxml
|
||||
uch
|
||||
UCHAR
|
||||
|
@ -2531,6 +2564,7 @@ vcvarsall
|
|||
vcxitems
|
||||
vcxproj
|
||||
vec
|
||||
vectorized
|
||||
VERCTRL
|
||||
versioning
|
||||
VERTBAR
|
||||
|
@ -2548,13 +2582,13 @@ VMs
|
|||
VPA
|
||||
VPATH
|
||||
VPR
|
||||
VPrintf
|
||||
VProc
|
||||
VRaw
|
||||
VREDRAW
|
||||
vsc
|
||||
vscprintf
|
||||
VSCROLL
|
||||
vsdevshell
|
||||
vsinfo
|
||||
vsnprintf
|
||||
vso
|
||||
|
@ -2663,6 +2697,7 @@ WINDOWPOSCHANGING
|
|||
windowproc
|
||||
windowrect
|
||||
windowsapp
|
||||
windowsdeveloper
|
||||
windowsinternalstring
|
||||
WINDOWSIZE
|
||||
windowsx
|
||||
|
@ -2694,6 +2729,7 @@ wixproj
|
|||
wline
|
||||
wlinestream
|
||||
wmain
|
||||
wmemory
|
||||
WMSZ
|
||||
wnd
|
||||
WNDALLOC
|
||||
|
@ -2749,6 +2785,7 @@ WTo
|
|||
wtof
|
||||
wtoi
|
||||
WTs
|
||||
WTSOFTFONT
|
||||
wtw
|
||||
wtypes
|
||||
Wubi
|
||||
|
@ -2775,10 +2812,10 @@ XCount
|
|||
xdy
|
||||
XEncoding
|
||||
xes
|
||||
Xes
|
||||
xff
|
||||
XFile
|
||||
XFORM
|
||||
xIcon
|
||||
XManifest
|
||||
XMath
|
||||
XMFLOAT
|
||||
|
@ -2786,8 +2823,6 @@ xml
|
|||
xmlns
|
||||
xor
|
||||
xorg
|
||||
xorg
|
||||
Xpath
|
||||
XPosition
|
||||
XResource
|
||||
xsd
|
||||
|
@ -2813,6 +2848,7 @@ YCast
|
|||
YCENTER
|
||||
YCount
|
||||
YDPI
|
||||
yIcon
|
||||
yml
|
||||
YOffset
|
||||
YPosition
|
||||
|
@ -2820,6 +2856,7 @@ YSize
|
|||
YSubstantial
|
||||
YVIRTUALSCREEN
|
||||
YWalk
|
||||
zamora
|
||||
ZCmd
|
||||
ZCtrl
|
||||
zsh
|
||||
|
|
3
.github/actions/spelling/expect/web.txt
vendored
3
.github/actions/spelling/expect/web.txt
vendored
|
@ -1,5 +1,7 @@
|
|||
http
|
||||
www
|
||||
easyrgb
|
||||
php
|
||||
ecma
|
||||
rapidtables
|
||||
WCAG
|
||||
|
@ -11,6 +13,7 @@ leonerd
|
|||
fixterms
|
||||
winui
|
||||
appshellintegration
|
||||
mdtauk
|
||||
cppreference
|
||||
gfycat
|
||||
Guake
|
||||
|
|
|
@ -23,3 +23,5 @@ VERIFY_ARE_EQUAL\(L"[^"]+"
|
|||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
|
||||
std::memory_order_[\w]+
|
||||
D2DERR_SHADER_COMPILE_FAILED
|
||||
TIL_FEATURE_[0-9A-Z_]+
|
||||
vcvars\w*
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
|
||||
name: Spell checking
|
||||
on:
|
||||
pull_request_target:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
spelling:
|
||||
name: Spell checking
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout-merge
|
||||
if: "contains(github.event_name, 'pull_request')"
|
||||
uses: actions/checkout@v2.0.0
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: refs/pull/${{github.event.pull_request.number}}/merge
|
||||
- name: checkout
|
||||
if: "!contains(github.event_name, 'pull_request')"
|
||||
uses: actions/checkout@v2.0.0
|
||||
- uses: check-spelling/check-spelling@v0.0.18
|
||||
uses: actions/checkout@v2
|
||||
- uses: check-spelling/check-spelling@v0.0.19
|
97
build/rules/GenerateFeatureFlags.proj
Normal file
97
build/rules/GenerateFeatureFlags.proj
Normal file
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- THIS PROJECT CANNOT BE LOADED INTO THE SOLUTION. -->
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Any CPU">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Fuzzing|Any CPU">
|
||||
<Configuration>Fuzzing</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="AuditMode|Any CPU">
|
||||
<Configuration>AuditMode</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Any CPU">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>d97c3c61-53cd-4e72-919b-9a0940e038f9</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntermediateOutputPath>$(SolutionDir)obj\$(Configuration)\GenerateFeatureFlags\</IntermediateOutputPath>
|
||||
<OpenConsoleCommonOutDir>$(SolutionDir)bin\$(Configuration)\</OpenConsoleCommonOutDir>
|
||||
|
||||
<_WTBrandingName Condition="'$(WindowsTerminalBranding)'=='Preview'">Preview</_WTBrandingName>
|
||||
<_WTBrandingName Condition="'$(WindowsTerminalBranding)'=='Release'">Release</_WTBrandingName>
|
||||
<_WTBrandingName Condition="'$(_WTBrandingName)'==''">Dev</_WTBrandingName>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_GenerateBranchAndBrandingCache">
|
||||
<Exec Command="git.exe rev-parse --abbrev-ref HEAD"
|
||||
CustomWarningRegularExpression="^fatal:.*"
|
||||
ConsoleToMsBuild="true"
|
||||
IgnoreExitCode="true">
|
||||
<Output TaskParameter="ConsoleOutput" ItemName="_GitBranchLines" />
|
||||
</Exec>
|
||||
|
||||
<ItemGroup>
|
||||
<_BrandingLines Include="$(_WTBrandingName)" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile File="$(IntermediateOutputPath)branch_branding_cache.txt"
|
||||
Lines="@(_GitBranchLines);@(_BrandingLines)"
|
||||
Overwrite="true"
|
||||
WriteOnlyWhenDifferent="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(IntermediateOutputPath)branch_branding_cache.txt" />
|
||||
<_BranchBrandingCacheFiles Include="$(IntermediateOutputPath)branch_branding_cache.txt" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="_RunFeatureFlagScript"
|
||||
Inputs="@(FeatureFlagFile);@(_BranchBrandingCacheFiles)"
|
||||
Outputs="$(OpenConsoleCommonOutDir)\inc\TilFeatureStaging.h"
|
||||
DependsOnTargets="_GenerateBranchAndBrandingCache">
|
||||
<MakeDir Directories="$(OpenConsoleCommonOutDir)\inc" />
|
||||
<Exec
|
||||
Command="powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy ByPass -Command "$(SolutionDir)\tools\Generate-FeatureStagingHeader.ps1" -Path "%(FeatureFlagFile.FullPath)" -Branding $(_WTBrandingName)"
|
||||
ConsoleToMsBuild="true"
|
||||
StandardOutputImportance="low">
|
||||
<Output TaskParameter="ConsoleOutput" ItemName="_FeatureFlagFileLines" />
|
||||
</Exec>
|
||||
|
||||
<!--
|
||||
We gather the feature flag output in MSBuild and emit the file so that we can take advantage of
|
||||
WriteOnlyWhenDifferent. Doing this ensures that we don't rebuild the world when the branch changes
|
||||
(if it results in a new TilFeatureStaging.h that would have had the same content/features as the previous one)
|
||||
-->
|
||||
|
||||
<WriteLinesToFile File="$(OpenConsoleCommonOutDir)\inc\TilFeatureStaging.h"
|
||||
Lines="@(_FeatureFlagFileLines)"
|
||||
Overwrite="true"
|
||||
WriteOnlyWhenDifferent="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(OpenConsoleCommonOutDir)\inc\TilFeatureStaging.h" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="Build" DependsOnTargets="_RunFeatureFlagScript" />
|
||||
<Target Name="Clean">
|
||||
<Delete Files="$(OpenConsoleCommonOutDir)\inc\TilFeatureStaging.h" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<FeatureFlagFile Include="$(SolutionDir)\src\features.xml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -19,6 +19,7 @@
|
|||
"/.github/",
|
||||
"/samples/",
|
||||
"/res/terminal/",
|
||||
"/res/fonts/",
|
||||
"/doc/specs/",
|
||||
"/doc/cascadia/",
|
||||
"/doc/user-docs/",
|
||||
|
|
|
@ -191,6 +191,7 @@
|
|||
"find",
|
||||
"findMatch",
|
||||
"focusPane",
|
||||
"globalSummon",
|
||||
"identifyWindow",
|
||||
"identifyWindows",
|
||||
"moveFocus",
|
||||
|
@ -206,6 +207,7 @@
|
|||
"prevTab",
|
||||
"renameTab",
|
||||
"openTabRenamer",
|
||||
"quakeMode",
|
||||
"resetFontSize",
|
||||
"resizePane",
|
||||
"renameWindow",
|
||||
|
@ -544,12 +546,14 @@
|
|||
"action": { "type": "string", "pattern": "openSettings" },
|
||||
"target": {
|
||||
"type": "string",
|
||||
"default": "settingsFile",
|
||||
"description": "The settings file to open.",
|
||||
"default": "settingsUI",
|
||||
"description": "Opens Settings UI or settings file.",
|
||||
"enum": [
|
||||
"settingsFile",
|
||||
"defaultsFile",
|
||||
"allFiles"
|
||||
"allFiles",
|
||||
"settingsUI"
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -817,6 +821,63 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"GlobalSummonAction": {
|
||||
"description": "This is a special action that works globally in the OS, rather than only in the context of the terminal window. When pressed, this action will summon the terminal window.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/ShortcutAction" },
|
||||
{
|
||||
"properties": {
|
||||
"action": { "type": "string", "pattern": "globalSummon" },
|
||||
"desktop": {
|
||||
"type": "string",
|
||||
"default": "toCurrent",
|
||||
"description": "This controls how the terminal should interact with virtual desktops.\n- \"any\": Leave the window on whichever desktop it's already on - will switch to that desktop as the window is activated.\n- \"toCurrent\" (default): Move the window to the current virtual desktop.\n- \"onCurrent\": Only summon the window if it's already on the current virtual desktop. ",
|
||||
"enum": [
|
||||
"any",
|
||||
"toCurrent",
|
||||
"onCurrent"
|
||||
]
|
||||
},
|
||||
"monitor": {
|
||||
"type": "string",
|
||||
"default": "toMouse",
|
||||
"description": "This controls the monitor that the window will be summoned from/to.\n- \"any\": Summon the most recently used window, regardless of which monitor it's currently on.\n- \"toCurrent\": Summon the most recently used window to the monitor with the current foreground window.\n- \"toMouse\" (default): Summon the most recently used window to the monitor where the mouse cursor is.",
|
||||
"enum": [
|
||||
"any",
|
||||
"toCurrent",
|
||||
"toMouse"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "When provided, summon the window whose name or ID matches the given name value. If no such window exists, then create a new window with that name."
|
||||
},
|
||||
"dropdownDuration": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"default": 0,
|
||||
"description": "When provided with a positive number, \"slide\" the window in from the top of the screen using an animation that lasts dropdownDuration milliseconds."
|
||||
},
|
||||
"toggleVisibility": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "When true, pressing the assigned keys for this action will dismiss (minimize) the window when the window is currently the foreground window."
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"QuakeModeAction": {
|
||||
"description": "This action is a special variation of the globalSummon action. It specifically summons a window called \"_quake\". If you would like to change the behavior of the quakeMode action, we recommended creating a new globalSummon entry.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/ShortcutAction" },
|
||||
{
|
||||
"properties": {
|
||||
"action": { "type": "string", "pattern": "quakeMode" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Keybinding": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
|
@ -848,6 +909,8 @@
|
|||
{ "$ref": "#/definitions/RenameTabAction" },
|
||||
{ "$ref": "#/definitions/RenameWindowAction" },
|
||||
{ "$ref": "#/definitions/FocusPaneAction" },
|
||||
{ "$ref": "#/definitions/GlobalSummonAction" },
|
||||
{ "$ref": "#/definitions/QuakeModeAction" },
|
||||
{ "type": "null" }
|
||||
]
|
||||
},
|
||||
|
@ -868,16 +931,38 @@
|
|||
},
|
||||
"icon": { "$ref": "#/definitions/Icon" },
|
||||
"name": {
|
||||
"description": "The name that will appear in the command palette. If one isn't provided, the terminal will attempt to automatically generate a name.",
|
||||
"description": "The name that will appear in the command palette. If one isn't provided, the terminal will attempt to automatically generate a name.\nIf name is a string, it will be the name of the command.\nIf name is a object, the key property of the object will be used to lookup a localized string resource for the command",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": [
|
||||
"string",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"iterateOn": {
|
||||
"type": "string",
|
||||
"description": "Used to create iterable commands based on other objects in your settings. Possible values:\n- \"profiles\" \n- \"schemes\"",
|
||||
"enum": [
|
||||
"profiles",
|
||||
"schemes"
|
||||
]
|
||||
},
|
||||
"commands": {
|
||||
"description": "List of commands to execute",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Keybinding/properties/command"
|
||||
},
|
||||
"minItems": 1,
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command",
|
||||
"keys"
|
||||
"anyOf": [
|
||||
{"required": ["name","commands"]},
|
||||
{"required": ["command"]}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
|
@ -1011,8 +1096,16 @@
|
|||
"type": [ "integer", "string" ],
|
||||
"deprecated": true
|
||||
},
|
||||
"actions": {
|
||||
"description": "Properties are specific to each custom action.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Keybinding"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"keybindings": {
|
||||
"description": "Properties are specific to each custom key binding.",
|
||||
"description": "[deprecated] Use actions instead.",
|
||||
"deprecated": true,
|
||||
"items": {
|
||||
"$ref": "#/definitions/Keybinding"
|
||||
},
|
||||
|
|
65
doc/feature_flags.md
Normal file
65
doc/feature_flags.md
Normal file
|
@ -0,0 +1,65 @@
|
|||
# til::feature
|
||||
|
||||
Feature flags are controlled by an XML document stored at `src/features.xml`.
|
||||
|
||||
## Example Document
|
||||
|
||||
```xml
|
||||
<?xml version="1.0"?>
|
||||
<featureStaging xmlns="http://microsoft.com/TilFeatureStaging-Schema.xsd">
|
||||
<feature>
|
||||
<!-- This will produce Feature_XYZ::IsEnabled() and TIL_FEATURE_XYZ_ENABLED (preprocessor) -->
|
||||
<name>Feature_XYZ</name>
|
||||
|
||||
<description>Does a cool thing</description>
|
||||
|
||||
<!-- GitHub deliverable number; optional -->
|
||||
<id>1234</id>
|
||||
|
||||
<!-- Whether the feature defaults to enabled or disabled -->
|
||||
<stage>AlwaysEnabled|AlwaysDisabled</stage>
|
||||
|
||||
<!-- Branch wildcards where the feature should be *DISABLED* -->
|
||||
<alwaysDisabledBranchTokens>
|
||||
<branchToken>branch/with/wildcard/*</branchToken>
|
||||
<!-- ... more branchTokens ... -->
|
||||
</alwaysDisabledBranchTokens>
|
||||
|
||||
<!-- Just like alwaysDisabledBranchTokens, but for *ENABLING* the feature. -->
|
||||
<alwaysEnabledBranchTokens>
|
||||
<branchToken>...</branchToken>
|
||||
</alwaysEnabledBranchTokens>
|
||||
|
||||
<!-- Brandings where the feature should be *DISABLED* -->
|
||||
<alwaysDisabledBrandingTokens>
|
||||
<!-- Valid brandings include Dev, Preview, Release, WindowsInbox -->
|
||||
<brandingToken>Release</brandingToken>
|
||||
<!-- ... more brandingTokens ... -->
|
||||
</alwaysDisabledBrandingTokens>
|
||||
|
||||
<!-- Just like alwaysDisabledBrandingTokens, but for *ENABLING* the feature -->
|
||||
<alwaysEnabledBrandingTokens>
|
||||
<branchToken>...</branchToken>
|
||||
</alwaysEnabledBrandingTokens>
|
||||
|
||||
<!-- Unequivocally disable this feature in Release -->
|
||||
<alwaysDisabledReleaseTokens />
|
||||
</feature>
|
||||
</featureStaging>
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
Features that are disabled for Release using `alwaysDisabledReleaseTokens` are
|
||||
*always* disabled in Release, even if they come from a branch that would have
|
||||
been enabled by the wildcard.
|
||||
|
||||
### Precedence
|
||||
|
||||
1. `alwaysDisabledReleaseTokens`
|
||||
2. Enabled branches
|
||||
3. Disabled branches
|
||||
* The longest branch token that matches your branch will win.
|
||||
3. Enabled brandings
|
||||
4. Disabled brandings
|
||||
5. The feature's default state
|
BIN
res/Cascadia.ttf
BIN
res/Cascadia.ttf
Binary file not shown.
Binary file not shown.
|
@ -6,16 +6,3 @@ The images in this directory do not fall under the same [license](https://raw.gi
|
|||
of the Windows Terminal code.
|
||||
|
||||
Please consult the [license](./LICENSE) in this directory for terms applicable to the image assets in this directory.
|
||||
|
||||
## Fonts
|
||||
|
||||
The fonts in this directory do not fall under the same [license](https://raw.githubusercontent.com/microsoft/terminal/main/LICENSE) as the rest
|
||||
of the Windows Terminal code.
|
||||
|
||||
Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadia-code/main/LICENSE) in the
|
||||
[microsoft/cascadia-code](https://github.com/microsoft/cascadia-code) repository for terms applicable to the fonts in this directory.
|
||||
|
||||
### Fonts Included
|
||||
|
||||
* Cascadia Code, Cascadia Mono (2102.25)
|
||||
* from microsoft/cascadia-code@911dc421f333e3b72b97381d16fee5b71eb48f04
|
||||
|
|
BIN
res/fonts/CascadiaCode.ttf
Normal file
BIN
res/fonts/CascadiaCode.ttf
Normal file
Binary file not shown.
BIN
res/fonts/CascadiaCodeItalic.ttf
Normal file
BIN
res/fonts/CascadiaCodeItalic.ttf
Normal file
Binary file not shown.
BIN
res/fonts/CascadiaMono.ttf
Normal file
BIN
res/fonts/CascadiaMono.ttf
Normal file
Binary file not shown.
BIN
res/fonts/CascadiaMonoItalic.ttf
Normal file
BIN
res/fonts/CascadiaMonoItalic.ttf
Normal file
Binary file not shown.
12
res/fonts/README.md
Normal file
12
res/fonts/README.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Windows Terminal and Console Assets (Fonts)
|
||||
|
||||
The fonts in this directory do not fall under the same [license](https://raw.githubusercontent.com/microsoft/terminal/main/LICENSE) as the rest
|
||||
of the Windows Terminal code.
|
||||
|
||||
Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadia-code/main/LICENSE) in the
|
||||
[microsoft/cascadia-code](https://github.com/microsoft/cascadia-code) repository for terms applicable to the fonts in this directory.
|
||||
|
||||
### Fonts Included
|
||||
|
||||
* Cascadia Code, Cascadia Mono (2106.17)
|
||||
* from microsoft/cascadia-code@fb0bce69c1c12f6c298b8bc1c1d181868f5daa9a
|
|
@ -140,8 +140,10 @@
|
|||
<Extensions>
|
||||
<uap7:Extension Category="windows.sharedFonts">
|
||||
<uap7:SharedFonts>
|
||||
<uap4:Font File="Cascadia.ttf" />
|
||||
<uap4:Font File="CascadiaCode.ttf" />
|
||||
<uap4:Font File="CascadiaCodeItalic.ttf" />
|
||||
<uap4:Font File="CascadiaMono.ttf" />
|
||||
<uap4:Font File="CascadiaMonoItalic.ttf" />
|
||||
</uap7:SharedFonts>
|
||||
</uap7:Extension>
|
||||
</Extensions>
|
||||
|
|
|
@ -140,8 +140,10 @@
|
|||
<Extensions>
|
||||
<uap7:Extension Category="windows.sharedFonts">
|
||||
<uap7:SharedFonts>
|
||||
<uap4:Font File="Cascadia.ttf" />
|
||||
<uap4:Font File="CascadiaCode.ttf" />
|
||||
<uap4:Font File="CascadiaCodeItalic.ttf" />
|
||||
<uap4:Font File="CascadiaMono.ttf" />
|
||||
<uap4:Font File="CascadiaMonoItalic.ttf" />
|
||||
</uap7:SharedFonts>
|
||||
</uap7:Extension>
|
||||
</Extensions>
|
||||
|
|
|
@ -12,13 +12,9 @@
|
|||
<Link>Images\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Content>
|
||||
<!-- Fonts -->
|
||||
<Content Include="$(OpenConsoleDir)res\Cascadia.ttf" Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
|
||||
<Content Include="$(OpenConsoleDir)res\fonts\*.ttf" Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Content>
|
||||
<Content Include="$(OpenConsoleDir)res\CascadiaMono.ttf" Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
<Link>%(FileName)%(Extension)</Link>
|
||||
</Content>
|
||||
<!-- Profile Icons -->
|
||||
<Content Include="$(OpenConsoleDir)src\cascadia\CascadiaPackage\ProfileIcons\**\*">
|
||||
|
|
|
@ -647,10 +647,12 @@ namespace SettingsModelLocalTests
|
|||
const std::string bindings0String{ R"([ { "command": "closeWindow", "keys": "ctrl+a" } ])" };
|
||||
const std::string bindings1String{ R"([ { "command": { "action": "copy", "singleLine": true }, "keys": "ctrl+b" } ])" };
|
||||
const std::string bindings2String{ R"([ { "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+c" } ])" };
|
||||
const std::string bindings3String{ R"([ { "command": "commandPalette", "keys": "ctrl+shift+p" } ])" };
|
||||
|
||||
const auto bindings0Json = VerifyParseSucceeded(bindings0String);
|
||||
const auto bindings1Json = VerifyParseSucceeded(bindings1String);
|
||||
const auto bindings2Json = VerifyParseSucceeded(bindings2String);
|
||||
const auto bindings3Json = VerifyParseSucceeded(bindings3String);
|
||||
|
||||
auto VerifyKeyChordEquality = [](const KeyChord& expected, const KeyChord& actual) {
|
||||
if (expected)
|
||||
|
@ -699,5 +701,13 @@ namespace SettingsModelLocalTests
|
|||
const auto& kbd{ actionMap->GetKeyBindingForAction(ShortcutAction::NewTab, *args) };
|
||||
VerifyKeyChordEquality({ KeyModifiers::Ctrl, static_cast<int32_t>('C') }, kbd);
|
||||
}
|
||||
{
|
||||
Log::Comment(L"command with hidden args");
|
||||
actionMap->LayerJson(bindings3Json);
|
||||
VERIFY_ARE_EQUAL(4u, actionMap->_KeyMap.size());
|
||||
|
||||
const auto& kbd{ actionMap->GetKeyBindingForAction(ShortcutAction::ToggleCommandPalette) };
|
||||
VerifyKeyChordEquality({ KeyModifiers::Ctrl | KeyModifiers::Shift, static_cast<int32_t>('P') }, kbd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,10 +229,12 @@ namespace SettingsModelLocalTests
|
|||
|
||||
void SerializationTests::Actions()
|
||||
{
|
||||
// simple command
|
||||
const std::string actionsString1{ R"([
|
||||
{ "command": "paste" }
|
||||
])" };
|
||||
|
||||
// complex command
|
||||
const std::string actionsString2A{ R"([
|
||||
{ "command": { "action": "setTabColor" } }
|
||||
])" };
|
||||
|
@ -244,29 +246,35 @@ namespace SettingsModelLocalTests
|
|||
{ "command": { "action": "copy", "singleLine": true, "copyFormatting": "html" } }
|
||||
])" };
|
||||
|
||||
// simple command with key chords
|
||||
const std::string actionsString3{ R"([
|
||||
{ "command": "toggleAlwaysOnTop", "keys": "ctrl+a" },
|
||||
{ "command": "toggleAlwaysOnTop", "keys": "ctrl+b" }
|
||||
])" };
|
||||
|
||||
// complex command with key chords
|
||||
const std::string actionsString4{ R"([
|
||||
{ "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "ctrl+c" },
|
||||
{ "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "ctrl+d" }
|
||||
])" };
|
||||
|
||||
// command with name and icon and multiple key chords
|
||||
const std::string actionsString5{ R"([
|
||||
{ "icon": "image.png", "name": "Scroll To Top Name", "command": "scrollToTop", "keys": "ctrl+e" },
|
||||
{ "command": "scrollToTop", "keys": "ctrl+f" }
|
||||
])" };
|
||||
|
||||
// complex command with new terminal args
|
||||
const std::string actionsString6{ R"([
|
||||
{ "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+g" },
|
||||
])" };
|
||||
|
||||
// complex command with meaningful null arg
|
||||
const std::string actionsString7{ R"([
|
||||
{ "command": { "action": "renameWindow", "name": null }, "keys": "ctrl+h" }
|
||||
])" };
|
||||
|
||||
// nested command
|
||||
const std::string actionsString8{ R"([
|
||||
{
|
||||
"name": "Change font size...",
|
||||
|
@ -278,6 +286,7 @@ namespace SettingsModelLocalTests
|
|||
}
|
||||
])" };
|
||||
|
||||
// iterable command
|
||||
const std::string actionsString9A{ R"([
|
||||
{
|
||||
"name": "New tab",
|
||||
|
@ -330,7 +339,20 @@ namespace SettingsModelLocalTests
|
|||
"name": "Send Input (Evil) ..."
|
||||
}
|
||||
])"" };
|
||||
const std::string actionsString9D{ R""([
|
||||
{
|
||||
"command":
|
||||
{
|
||||
"action": "newTab",
|
||||
"profile": "${profile.name}"
|
||||
},
|
||||
"icon": "${profile.icon}",
|
||||
"iterateOn": "profiles",
|
||||
"name": "${profile.name}: New tab"
|
||||
}
|
||||
])"" };
|
||||
|
||||
// unbound command
|
||||
const std::string actionsString10{ R"([
|
||||
{ "command": "unbound", "keys": "ctrl+c" }
|
||||
])" };
|
||||
|
@ -365,6 +387,7 @@ namespace SettingsModelLocalTests
|
|||
RoundtripTest<implementation::ActionMap>(actionsString9A);
|
||||
RoundtripTest<implementation::ActionMap>(actionsString9B);
|
||||
RoundtripTest<implementation::ActionMap>(actionsString9C);
|
||||
RoundtripTest<implementation::ActionMap>(actionsString9D);
|
||||
|
||||
Log::Comment(L"unbound command");
|
||||
RoundtripTest<implementation::ActionMap>(actionsString10);
|
||||
|
|
|
@ -97,6 +97,6 @@
|
|||
|
||||
<!-- We actually can just straight up reference MUX here, it's fine -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -798,7 +798,7 @@ void _stdcall TerminalSetTheme(void* terminal, TerminalTheme theme, LPCWSTR font
|
|||
}
|
||||
}
|
||||
|
||||
publicTerminal->_terminal->SetCursorStyle(theme.CursorStyle);
|
||||
publicTerminal->_terminal->SetCursorStyle(static_cast<DispatchTypes::CursorStyle>(theme.CursorStyle));
|
||||
|
||||
publicTerminal->_desiredFont = { fontFamily, 0, DEFAULT_FONT_WEIGHT, { 0, fontSize }, CP_UTF8 };
|
||||
publicTerminal->_UpdateFont(newDpi);
|
||||
|
|
|
@ -19,7 +19,7 @@ typedef struct _TerminalTheme
|
|||
COLORREF DefaultForeground;
|
||||
COLORREF DefaultSelectionBackground;
|
||||
float SelectionBackgroundAlpha;
|
||||
DispatchTypes::CursorStyle CursorStyle;
|
||||
uint32_t CursorStyle; // This will be converted to DispatchTypes::CursorStyle (size_t), but C# cannot marshal an enum type and have it fit in a size_t.
|
||||
COLORREF ColorTable[16];
|
||||
} TerminalTheme, *LPTerminalTheme;
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#include "pch.h"
|
||||
#include "OpenTerminalHere.h"
|
||||
#include "../WinRTUtils/inc/WtExeUtils.h"
|
||||
#include "../WinRTUtils/inc/LibraryResources.h"
|
||||
|
||||
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
||||
#include <ShlObj.h>
|
||||
|
||||
// TODO GH#6112: Localize these strings
|
||||
static constexpr std::wstring_view VerbDisplayName{ L"Open in Windows Terminal" };
|
||||
static constexpr std::wstring_view VerbDevBuildDisplayName{ L"Open in Windows Terminal (Dev Build)" };
|
||||
static constexpr std::wstring_view VerbName{ L"WindowsTerminalOpenHere" };
|
||||
|
||||
// This code is aggressively copied from
|
||||
|
@ -56,16 +56,17 @@ HRESULT OpenTerminalHere::Invoke(IShellItemArray* psiItemArray,
|
|||
siEx.StartupInfo.cb = sizeof(STARTUPINFOEX);
|
||||
|
||||
// Append a "\." to the given path, so that this will work in "C:\"
|
||||
auto cmdline{ wil::str_printf<std::wstring>(LR"-("%s" -d "%s\.")-", GetWtExePath().c_str(), pszName.get()) };
|
||||
auto path{ wil::str_printf<std::wstring>(LR"-(%s\.)-", pszName.get()) };
|
||||
auto cmdline{ wil::str_printf<std::wstring>(LR"-("%s" -d "%s")-", GetWtExePath().c_str(), path.c_str()) };
|
||||
RETURN_IF_WIN32_BOOL_FALSE(CreateProcessW(
|
||||
nullptr,
|
||||
nullptr, // lpApplicationName
|
||||
cmdline.data(),
|
||||
nullptr, // lpProcessAttributes
|
||||
nullptr, // lpThreadAttributes
|
||||
false, // bInheritHandles
|
||||
EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT, // dwCreationFlags
|
||||
nullptr, // lpEnvironment
|
||||
nullptr,
|
||||
path.data(),
|
||||
&siEx.StartupInfo, // lpStartupInfo
|
||||
&_piClient // lpProcessInformation
|
||||
));
|
||||
|
@ -87,8 +88,15 @@ HRESULT OpenTerminalHere::GetTitle(IShellItemArray* /*psiItemArray*/,
|
|||
{
|
||||
// Change the string we return depending on if we're running from the dev
|
||||
// build package or not.
|
||||
const bool isDevBuild = IsDevBuild();
|
||||
return SHStrDup(isDevBuild ? VerbDevBuildDisplayName.data() : VerbDisplayName.data(), ppszName);
|
||||
const auto resource =
|
||||
#if defined(WT_BRANDING_RELEASE)
|
||||
RS_(L"ShellExtension_OpenInTerminalMenuItem");
|
||||
#elif defined(WT_BRANDING_PREVIEW)
|
||||
RS_(L"ShellExtension_OpenInTerminalMenuItem_Preview");
|
||||
#else
|
||||
RS_(L"ShellExtension_OpenInTerminalMenuItem_Dev");
|
||||
#endif
|
||||
return SHStrDup(resource.data(), ppszName);
|
||||
}
|
||||
|
||||
HRESULT OpenTerminalHere::GetState(IShellItemArray* /*psiItemArray*/,
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "pch.h"
|
||||
#include "OpenTerminalHere.h"
|
||||
|
||||
#include "../WinRTUtils/inc/LibraryResources.h"
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
STDAPI DllCanUnloadNow()
|
||||
|
@ -30,3 +32,6 @@ DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Usurp the TerminalApp's resource group.
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/Resources")
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace winrt::TerminalApp::implementation
|
|||
});
|
||||
_root->Create();
|
||||
|
||||
_ApplyTheme(_settings.GlobalSettings().Theme());
|
||||
_RefreshThemeRoutine();
|
||||
_ApplyStartupTaskStateChange();
|
||||
|
||||
TraceLoggingWrite(
|
||||
|
@ -895,36 +895,25 @@ namespace winrt::TerminalApp::implementation
|
|||
// this stops us from reloading too many times or too quickly.
|
||||
fire_and_forget AppLogic::_DispatchReloadSettings()
|
||||
{
|
||||
static constexpr auto FileActivityQuiesceTime{ std::chrono::milliseconds(50) };
|
||||
if (!_settingsReloadQueued.exchange(true))
|
||||
if (_settingsReloadQueued.exchange(true))
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
auto weakSelf = get_weak();
|
||||
|
||||
co_await winrt::resume_after(std::chrono::milliseconds(100));
|
||||
co_await winrt::resume_foreground(_root->Dispatcher());
|
||||
|
||||
if (auto self{ weakSelf.get() })
|
||||
{
|
||||
co_await winrt::resume_after(FileActivityQuiesceTime);
|
||||
_ReloadSettings();
|
||||
_settingsReloadQueued.store(false);
|
||||
}
|
||||
}
|
||||
|
||||
fire_and_forget AppLogic::_LoadErrorsDialogRoutine()
|
||||
void AppLogic::_RefreshThemeRoutine()
|
||||
{
|
||||
co_await winrt::resume_foreground(_root->Dispatcher());
|
||||
|
||||
const winrt::hstring titleKey = USES_RESOURCE(L"ReloadJsonParseErrorTitle");
|
||||
const winrt::hstring textKey = USES_RESOURCE(L"ReloadJsonParseErrorText");
|
||||
_ShowLoadErrorsDialog(titleKey, textKey, _settingsLoadedResult);
|
||||
}
|
||||
|
||||
fire_and_forget AppLogic::_ShowLoadWarningsDialogRoutine()
|
||||
{
|
||||
co_await winrt::resume_foreground(_root->Dispatcher());
|
||||
|
||||
_ShowLoadWarningsDialog();
|
||||
}
|
||||
|
||||
fire_and_forget AppLogic::_RefreshThemeRoutine()
|
||||
{
|
||||
co_await winrt::resume_foreground(_root->Dispatcher());
|
||||
|
||||
// Refresh the UI theme
|
||||
_ApplyTheme(_settings.GlobalSettings().Theme());
|
||||
}
|
||||
|
||||
|
@ -959,39 +948,26 @@ namespace winrt::TerminalApp::implementation
|
|||
return;
|
||||
}
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
co_await winrt::resume_foreground(_root->Dispatcher(), CoreDispatcherPriority::Normal);
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
StartupTaskState state;
|
||||
bool tryEnableStartupTask = _settings.GlobalSettings().StartOnUserLogin();
|
||||
StartupTask task = co_await StartupTask::GetAsync(StartupTaskName);
|
||||
const auto tryEnableStartupTask = _settings.GlobalSettings().StartOnUserLogin();
|
||||
const auto task = co_await StartupTask::GetAsync(StartupTaskName);
|
||||
|
||||
state = task.State();
|
||||
switch (state)
|
||||
switch (task.State())
|
||||
{
|
||||
case StartupTaskState::Disabled:
|
||||
if (tryEnableStartupTask)
|
||||
{
|
||||
case StartupTaskState::Disabled:
|
||||
co_await task.RequestEnableAsync();
|
||||
}
|
||||
break;
|
||||
case StartupTaskState::DisabledByUser:
|
||||
// TODO: GH#6254: define UX for other StartupTaskStates
|
||||
break;
|
||||
case StartupTaskState::Enabled:
|
||||
if (!tryEnableStartupTask)
|
||||
{
|
||||
if (tryEnableStartupTask)
|
||||
{
|
||||
co_await task.RequestEnableAsync();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case StartupTaskState::DisabledByUser:
|
||||
{
|
||||
// TODO: GH#6254: define UX for other StartupTaskStates
|
||||
break;
|
||||
}
|
||||
case StartupTaskState::Enabled:
|
||||
{
|
||||
if (!tryEnableStartupTask)
|
||||
{
|
||||
task.Disable();
|
||||
}
|
||||
break;
|
||||
}
|
||||
task.Disable();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
|
@ -1009,12 +985,15 @@ namespace winrt::TerminalApp::implementation
|
|||
|
||||
if (FAILED(_settingsLoadedResult))
|
||||
{
|
||||
_LoadErrorsDialogRoutine();
|
||||
const winrt::hstring titleKey = USES_RESOURCE(L"ReloadJsonParseErrorTitle");
|
||||
const winrt::hstring textKey = USES_RESOURCE(L"ReloadJsonParseErrorText");
|
||||
_ShowLoadErrorsDialog(titleKey, textKey, _settingsLoadedResult);
|
||||
return;
|
||||
}
|
||||
else if (_settingsLoadedResult == S_FALSE)
|
||||
|
||||
if (_settingsLoadedResult == S_FALSE)
|
||||
{
|
||||
_ShowLoadWarningsDialogRoutine();
|
||||
_ShowLoadWarningsDialog();
|
||||
}
|
||||
|
||||
// Here, we successfully reloaded the settings, and created a new
|
||||
|
@ -1206,7 +1185,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// in and be routed to an event with no handlers or a non-ready Page.
|
||||
if (_appArgs.IsHandoffListener())
|
||||
{
|
||||
SetInboundListener();
|
||||
_root->SetInboundListener(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1222,7 +1201,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// - <none>
|
||||
void AppLogic::SetInboundListener()
|
||||
{
|
||||
_root->SetInboundListener();
|
||||
_root->SetInboundListener(false);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
|
|
@ -124,18 +124,14 @@ namespace winrt::TerminalApp::implementation
|
|||
|
||||
::TerminalApp::AppCommandlineArgs _appArgs;
|
||||
::TerminalApp::AppCommandlineArgs _settingsAppArgs;
|
||||
int _ParseArgs(winrt::array_view<const hstring>& args);
|
||||
static TerminalApp::FindTargetWindowResult _doFindTargetWindow(winrt::array_view<const hstring> args,
|
||||
const Microsoft::Terminal::Settings::Model::WindowingMode& windowingBehavior);
|
||||
|
||||
void _ShowLoadErrorsDialog(const winrt::hstring& titleKey, const winrt::hstring& contentKey, HRESULT settingsLoadedResult);
|
||||
void _ShowLoadWarningsDialog();
|
||||
bool _IsKeyboardServiceEnabled();
|
||||
void _ShowKeyboardServiceDisabledDialog();
|
||||
|
||||
fire_and_forget _LoadErrorsDialogRoutine();
|
||||
fire_and_forget _ShowLoadWarningsDialogRoutine();
|
||||
fire_and_forget _RefreshThemeRoutine();
|
||||
void _RefreshThemeRoutine();
|
||||
fire_and_forget _ApplyStartupTaskStateChange();
|
||||
|
||||
void _OnLoaded(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
|
@ -165,6 +161,7 @@ namespace winrt::TerminalApp::implementation
|
|||
FORWARDED_TYPED_EVENT(IdentifyWindowsRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IdentifyWindowsRequested);
|
||||
FORWARDED_TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::RenameWindowRequestedArgs, _root, RenameWindowRequested);
|
||||
FORWARDED_TYPED_EVENT(IsQuakeWindowChanged, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IsQuakeWindowChanged);
|
||||
FORWARDED_TYPED_EVENT(SummonWindowRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, SummonWindowRequested);
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
friend class TerminalAppLocalTests::CommandlineTest;
|
||||
|
|
|
@ -92,5 +92,6 @@ namespace TerminalApp
|
|||
event Windows.Foundation.TypedEventHandler<Object, RenameWindowRequestedArgs> RenameWindowRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> SettingsChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> IsQuakeWindowChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ using namespace winrt;
|
|||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
|
@ -317,6 +318,13 @@ namespace winrt::TerminalApp::implementation
|
|||
}
|
||||
else if (key == VirtualKey::Enter)
|
||||
{
|
||||
if (const auto& button = e.OriginalSource().try_as<Button>())
|
||||
{
|
||||
// Let the button handle the Enter key so an eventually attached click handler will be called
|
||||
e.Handled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto selectedCommand = _filteredActionsView().SelectedItem();
|
||||
const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>();
|
||||
_dispatchCommand(filteredCommand);
|
||||
|
@ -509,6 +517,7 @@ namespace winrt::TerminalApp::implementation
|
|||
void CommandPalette::_moveBackButtonClicked(Windows::Foundation::IInspectable const& /*sender*/,
|
||||
Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
_PreviewActionHandlers(*this, nullptr);
|
||||
_nestedActionStack.Clear();
|
||||
ParentCommandName(L"");
|
||||
_currentNestedCommands.Clear();
|
||||
|
@ -635,7 +644,13 @@ namespace winrt::TerminalApp::implementation
|
|||
// palette like the Tab Switcher will be able to have the last laugh.
|
||||
_close();
|
||||
|
||||
_DispatchCommandRequestedHandlers(*this, actionPaletteItem.Command());
|
||||
// But make an exception for the Toggle Command Palette action: we don't want the dispatch
|
||||
// make the command palette - that was just closed - visible again.
|
||||
// All other actions can just be dispatched.
|
||||
if (actionPaletteItem.Command().ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
|
||||
{
|
||||
_DispatchCommandRequestedHandlers(*this, actionPaletteItem.Command());
|
||||
}
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
|
||||
|
|
|
@ -329,6 +329,7 @@ void Pane::_ControlConnectionStateChangedHandler(const winrt::Windows::Foundatio
|
|||
}
|
||||
|
||||
const auto newConnectionState = _control.ConnectionState();
|
||||
const auto previousConnectionState = std::exchange(_connectionState, newConnectionState);
|
||||
|
||||
if (newConnectionState < ConnectionState::Closed)
|
||||
{
|
||||
|
@ -336,6 +337,14 @@ void Pane::_ControlConnectionStateChangedHandler(const winrt::Windows::Foundatio
|
|||
return;
|
||||
}
|
||||
|
||||
if (previousConnectionState < ConnectionState::Connected && newConnectionState >= ConnectionState::Failed)
|
||||
{
|
||||
// A failure to complete the connection (before it has _connected_) is not covered by "closeOnExit".
|
||||
// This is to prevent a misconfiguration (closeOnExit: always, startingDirectory: garbage) resulting
|
||||
// in Terminal flashing open and immediately closed.
|
||||
return;
|
||||
}
|
||||
|
||||
const auto settings{ winrt::TerminalApp::implementation::AppLogic::CurrentAppSettings() };
|
||||
auto paneProfile = settings.FindProfile(_profile.value());
|
||||
if (paneProfile)
|
||||
|
@ -709,6 +718,7 @@ void Pane::_CloseChild(const bool closeFirst)
|
|||
|
||||
// take the control, profile and id of the pane that _wasn't_ closed.
|
||||
_control = remainingChild->_control;
|
||||
_connectionState = remainingChild->_connectionState;
|
||||
_profile = remainingChild->_profile;
|
||||
_id = remainingChild->Id();
|
||||
|
||||
|
@ -1476,6 +1486,7 @@ std::pair<std::shared_ptr<Pane>, std::shared_ptr<Pane>> Pane::_Split(SplitState
|
|||
// Move our control, guid into the first one.
|
||||
// Move the new guid, control into the second.
|
||||
_firstChild = std::make_shared<Pane>(_profile.value(), _control);
|
||||
_firstChild->_connectionState = std::exchange(_connectionState, ConnectionState::NotConnected);
|
||||
_profile = std::nullopt;
|
||||
_control = { nullptr };
|
||||
_secondChild = std::make_shared<Pane>(profile, control);
|
||||
|
|
|
@ -95,6 +95,7 @@ private:
|
|||
winrt::Windows::UI::Xaml::Controls::Grid _root{};
|
||||
winrt::Windows::UI::Xaml::Controls::Border _border{};
|
||||
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
|
||||
static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_focusedBorderBrush;
|
||||
static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_unfocusedBorderBrush;
|
||||
|
||||
|
|
|
@ -634,4 +634,16 @@
|
|||
<data name="WindowRestoreDownButtonToolTip" xml:space="preserve">
|
||||
<value>Restore Down</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
|
||||
<value>Open in Windows Terminal (Dev)</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
|
||||
<value>Open in Windows Terminal Preview</value>
|
||||
<comment>{Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
|
||||
<value>Open in Windows Terminal</value>
|
||||
<comment>{Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal</comment>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<ItemDefinitionGroup>
|
||||
|
||||
<ClCompile>
|
||||
|
@ -372,13 +372,13 @@
|
|||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -92,31 +92,26 @@ namespace winrt::TerminalApp::implementation
|
|||
}
|
||||
}
|
||||
|
||||
winrt::fire_and_forget TerminalPage::SetSettings(CascadiaSettings settings, bool needRefreshUI)
|
||||
void TerminalPage::SetSettings(CascadiaSettings settings, bool needRefreshUI)
|
||||
{
|
||||
_settings = settings;
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
if (auto page{ weakThis.get() })
|
||||
// Make sure to _UpdateCommandsForPalette before
|
||||
// _RefreshUIForSettingsReload. _UpdateCommandsForPalette will make
|
||||
// sure the KeyChordText of Commands is updated, which needs to
|
||||
// happen before the Settings UI is reloaded and tries to re-read
|
||||
// those values.
|
||||
_UpdateCommandsForPalette();
|
||||
CommandPalette().SetActionMap(_settings.ActionMap());
|
||||
|
||||
if (needRefreshUI)
|
||||
{
|
||||
// Make sure to _UpdateCommandsForPalette before
|
||||
// _RefreshUIForSettingsReload. _UpdateCommandsForPalette will make
|
||||
// sure the KeyChordText of Commands is updated, which needs to
|
||||
// happen before the Settings UI is reloaded and tries to re-read
|
||||
// those values.
|
||||
_UpdateCommandsForPalette();
|
||||
CommandPalette().SetActionMap(_settings.ActionMap());
|
||||
|
||||
if (needRefreshUI)
|
||||
{
|
||||
_RefreshUIForSettingsReload();
|
||||
}
|
||||
|
||||
// Upon settings update we reload the system settings for scrolling as well.
|
||||
// TODO: consider reloading this value periodically.
|
||||
_systemRowsToScroll = _ReadSystemRowsToScroll();
|
||||
_RefreshUIForSettingsReload();
|
||||
}
|
||||
|
||||
// Upon settings update we reload the system settings for scrolling as well.
|
||||
// TODO: consider reloading this value periodically.
|
||||
_systemRowsToScroll = _ReadSystemRowsToScroll();
|
||||
}
|
||||
|
||||
void TerminalPage::Create()
|
||||
|
@ -356,7 +351,27 @@ namespace winrt::TerminalApp::implementation
|
|||
// we would be left with an empty terminal frame with no tabs.
|
||||
// Instead, crash out so COM sees the server die and things unwind
|
||||
// without a weird empty frame window.
|
||||
CATCH_FAIL_FAST()
|
||||
catch (...)
|
||||
{
|
||||
// However, we cannot always fail fast because of MSFT:33501832. Sometimes the COM catalog
|
||||
// tears the state between old and new versions and fails here for that reason.
|
||||
// As we're always becoming an inbound server in the monarch, even when COM didn't strictly
|
||||
// ask us yet...we might just crash always.
|
||||
// Instead... we're going to differentiate. If COM started us... we will fail fast
|
||||
// so it sees the process die and falls back.
|
||||
// If we were just starting normally as a Monarch and opportunistically listening for
|
||||
// inbound connections... then we'll just log the failure and move on assuming
|
||||
// the version state is torn and will fix itself whenever the packaging upgrade
|
||||
// tasks decide to clean up.
|
||||
if (_isEmbeddingInboundListener)
|
||||
{
|
||||
FAIL_FAST_CAUGHT_EXCEPTION();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_CAUGHT_EXCEPTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1810,7 +1825,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// This includes update the settings of all the tabs according
|
||||
// to their profiles, update the title and icon of each tab, and
|
||||
// finally create the tab flyout
|
||||
winrt::fire_and_forget TerminalPage::_RefreshUIForSettingsReload()
|
||||
void TerminalPage::_RefreshUIForSettingsReload()
|
||||
{
|
||||
// Re-wire the keybindings to their handlers, as we'll have created a
|
||||
// new AppKeyBindings object.
|
||||
|
@ -1865,17 +1880,10 @@ namespace winrt::TerminalApp::implementation
|
|||
tabImpl->SetActionMap(_settings.ActionMap());
|
||||
}
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
// repopulate the new tab button's flyout with entries for each
|
||||
// profile, which might have changed
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
_UpdateTabWidthMode();
|
||||
_CreateNewTabFlyout();
|
||||
}
|
||||
_UpdateTabWidthMode();
|
||||
_CreateNewTabFlyout();
|
||||
|
||||
// Reload the current value of alwaysOnTop from the settings file. This
|
||||
// will let the user hot-reload this setting, but any runtime changes to
|
||||
|
@ -1981,12 +1989,13 @@ namespace winrt::TerminalApp::implementation
|
|||
// listener for command-line tools attempting to join this Terminal
|
||||
// through the default application channel.
|
||||
// Arguments:
|
||||
// - <none> - Implicitly sets to true. Default page state is false.
|
||||
// - isEmbedding - True if COM started us to be a server. False if we're doing it of our own accord.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::SetInboundListener()
|
||||
void TerminalPage::SetInboundListener(bool isEmbedding)
|
||||
{
|
||||
_shouldStartInboundListener = true;
|
||||
_isEmbeddingInboundListener = isEmbedding;
|
||||
|
||||
// If the page has already passed the NotInitialized state,
|
||||
// then it is ready-enough for us to just start this immediately.
|
||||
|
@ -2319,6 +2328,9 @@ namespace winrt::TerminalApp::implementation
|
|||
{
|
||||
// TODO: GH 9458 will give us more context so we can try to choose a better profile.
|
||||
_OpenNewTab(nullptr, connection);
|
||||
|
||||
// Request a summon of this window to the foreground
|
||||
_SummonWindowRequestedHandlers(*this, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// put it in our inheritance graph. https://github.com/microsoft/microsoft-ui-xaml/issues/3331
|
||||
STDMETHODIMP Initialize(HWND hwnd);
|
||||
|
||||
winrt::fire_and_forget SetSettings(Microsoft::Terminal::Settings::Model::CascadiaSettings settings, bool needRefreshUI);
|
||||
void SetSettings(Microsoft::Terminal::Settings::Model::CascadiaSettings settings, bool needRefreshUI);
|
||||
|
||||
void Create();
|
||||
|
||||
|
@ -67,8 +67,6 @@ namespace winrt::TerminalApp::implementation
|
|||
winrt::hstring ApplicationDisplayName();
|
||||
winrt::hstring ApplicationVersion();
|
||||
|
||||
winrt::hstring ThirdPartyNoticesLink();
|
||||
|
||||
winrt::fire_and_forget CloseWindow();
|
||||
|
||||
void ToggleFocusMode();
|
||||
|
@ -79,7 +77,7 @@ namespace winrt::TerminalApp::implementation
|
|||
bool AlwaysOnTop() const;
|
||||
|
||||
void SetStartupActions(std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs>& actions);
|
||||
void SetInboundListener();
|
||||
void SetInboundListener(bool isEmbedding);
|
||||
static std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs> ConvertExecuteCommandlineToActions(const Microsoft::Terminal::Settings::Model::ExecuteCommandlineArgs& args);
|
||||
|
||||
winrt::TerminalApp::IDialogPresenter DialogPresenter() const;
|
||||
|
@ -124,6 +122,7 @@ namespace winrt::TerminalApp::implementation
|
|||
TYPED_EVENT(IdentifyWindowsRequested, IInspectable, IInspectable);
|
||||
TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::RenameWindowRequestedArgs);
|
||||
TYPED_EVENT(IsQuakeWindowChanged, IInspectable, IInspectable);
|
||||
TYPED_EVENT(SummonWindowRequested, IInspectable, IInspectable);
|
||||
|
||||
private:
|
||||
friend struct TerminalPageT<TerminalPage>; // for Xaml to bind events
|
||||
|
@ -174,6 +173,7 @@ namespace winrt::TerminalApp::implementation
|
|||
|
||||
Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::ActionAndArgs> _startupActions;
|
||||
bool _shouldStartInboundListener{ false };
|
||||
bool _isEmbeddingInboundListener{ false };
|
||||
|
||||
std::shared_ptr<Toast> _windowIdToast{ nullptr };
|
||||
std::shared_ptr<Toast> _windowRenameFailedToast{ nullptr };
|
||||
|
@ -294,7 +294,7 @@ namespace winrt::TerminalApp::implementation
|
|||
winrt::Microsoft::Terminal::Control::TermControl _InitControl(const winrt::Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult& settings,
|
||||
const winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection& connection);
|
||||
|
||||
winrt::fire_and_forget _RefreshUIForSettingsReload();
|
||||
void _RefreshUIForSettingsReload();
|
||||
|
||||
void _SetNonClientAreaColors(const Windows::UI::Color& selectedTabColor);
|
||||
void _ClearNonClientAreaColors();
|
||||
|
|
|
@ -56,5 +56,6 @@ namespace TerminalApp
|
|||
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, RenameWindowRequestedArgs> RenameWindowRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> IsQuakeWindowChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="..\..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<!-- ========================= XAML files ======================== -->
|
||||
<ItemGroup>
|
||||
<!-- DON'T PUT XAML FILES HERE! Put them in TerminalAppLib.vcxproj -->
|
||||
|
@ -90,13 +90,13 @@
|
|||
|
||||
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.2" targetFramework="native" />
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
|
||||
</packages>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "ConptyConnection.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <userenv.h>
|
||||
|
||||
#include "ConptyConnection.g.cpp"
|
||||
#include "CTerminalHandoff.h"
|
||||
|
@ -95,11 +94,8 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
|||
environment.clear();
|
||||
});
|
||||
|
||||
{
|
||||
const auto newEnvironmentBlock{ Utils::CreateEnvironmentBlock() };
|
||||
// Populate the environment map with the current environment.
|
||||
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment, newEnvironmentBlock.get()));
|
||||
}
|
||||
// Populate the environment map with the current environment.
|
||||
RETURN_IF_FAILED(Utils::UpdateEnvironmentMapW(environment));
|
||||
|
||||
{
|
||||
// Convert connection Guid to string and ignore the enclosing '{}'.
|
||||
|
@ -251,6 +247,8 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
|||
void ConptyConnection::Start()
|
||||
try
|
||||
{
|
||||
_transitionToState(ConnectionState::Connecting);
|
||||
|
||||
if (!_inPipe)
|
||||
{
|
||||
const COORD dimensions{ gsl::narrow_cast<SHORT>(_initialCols), gsl::narrow_cast<SHORT>(_initialRows) };
|
||||
|
|
|
@ -1126,6 +1126,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
{
|
||||
if (_renderEngine)
|
||||
{
|
||||
auto lock = _terminal->LockForWriting();
|
||||
_renderEngine->SetDefaultTextBackgroundOpacity(::base::saturated_cast<float>(opacity));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "../../cascadia/TerminalCore/Terminal.hpp"
|
||||
#include "../buffer/out/search.h"
|
||||
#include "cppwinrt_utils.h"
|
||||
#include "ThrottledFunc.h"
|
||||
|
||||
namespace ControlUnitTests
|
||||
{
|
||||
|
|
|
@ -48,9 +48,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
{
|
||||
TermControl::TermControl(IControlSettings settings,
|
||||
TerminalConnection::ITerminalConnection connection) :
|
||||
_initializedTerminal{ false },
|
||||
_settings{ settings },
|
||||
_closing{ false },
|
||||
_isInternalScrollBarUpdate{ false },
|
||||
_autoScrollVelocity{ 0 },
|
||||
_autoScrollingPointerPoint{ std::nullopt },
|
||||
|
@ -58,8 +56,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
_lastAutoScrollUpdateTime{ std::nullopt },
|
||||
_cursorTimer{},
|
||||
_blinkTimer{},
|
||||
_searchBox{ nullptr },
|
||||
_bellLightAnimation{ Window::Current().Compositor().CreateScalarKeyFrameAnimation() }
|
||||
_searchBox{ nullptr }
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -111,11 +108,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// Core eventually won't have access to. When we get to
|
||||
// https://github.com/microsoft/terminal/projects/5#card-50760282
|
||||
// then we'll move the applicable ones.
|
||||
//
|
||||
// These four throttled functions are triggered by terminal output and interact with the UI.
|
||||
// Since Close() is the point after which we are removed from the UI, but before the
|
||||
// destructor has run, we MUST check control->_IsClosing() before actually doing anything.
|
||||
_tsfTryRedrawCanvas = std::make_shared<ThrottledFuncTrailing<>>(
|
||||
Dispatcher(),
|
||||
TsfRedrawInterval,
|
||||
[weakThis = get_weak()]() {
|
||||
if (auto control{ weakThis.get() })
|
||||
if (auto control{ weakThis.get() }; !control->_IsClosing())
|
||||
{
|
||||
control->TSFInputControl().TryRedrawCanvas();
|
||||
}
|
||||
|
@ -125,7 +126,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Dispatcher(),
|
||||
UpdatePatternLocationsInterval,
|
||||
[weakThis = get_weak()]() {
|
||||
if (auto control{ weakThis.get() })
|
||||
if (auto control{ weakThis.get() }; !control->_IsClosing())
|
||||
{
|
||||
control->_core->UpdatePatternLocations();
|
||||
}
|
||||
|
@ -135,7 +136,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Dispatcher(),
|
||||
TerminalWarningBellInterval,
|
||||
[weakThis = get_weak()]() {
|
||||
if (auto control{ weakThis.get() })
|
||||
if (auto control{ weakThis.get() }; !control->_IsClosing())
|
||||
{
|
||||
control->_WarningBellHandlers(*control, nullptr);
|
||||
}
|
||||
|
@ -145,14 +146,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Dispatcher(),
|
||||
ScrollBarUpdateInterval,
|
||||
[weakThis = get_weak()](const auto& update) {
|
||||
if (auto control{ weakThis.get() })
|
||||
if (auto control{ weakThis.get() }; !control->_IsClosing())
|
||||
{
|
||||
control->_isInternalScrollBarUpdate = true;
|
||||
|
||||
auto scrollBar = control->ScrollBar();
|
||||
if (update.newValue.has_value())
|
||||
if (update.newValue)
|
||||
{
|
||||
scrollBar.Value(update.newValue.value());
|
||||
scrollBar.Value(*update.newValue);
|
||||
}
|
||||
scrollBar.Maximum(update.newMaximum);
|
||||
scrollBar.Minimum(update.newMinimum);
|
||||
|
@ -168,11 +169,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
_autoScrollTimer.Interval(AutoScrollUpdateInterval);
|
||||
_autoScrollTimer.Tick({ this, &TermControl::_UpdateAutoScroll });
|
||||
|
||||
// Add key frames and a duration to our bell light animation
|
||||
_bellLightAnimation.InsertKeyFrame(0.0, 2.0);
|
||||
_bellLightAnimation.InsertKeyFrame(1.0, 1.0);
|
||||
_bellLightAnimation.Duration(winrt::Windows::Foundation::TimeSpan(std::chrono::milliseconds(TerminalWarningBellInterval)));
|
||||
|
||||
_ApplyUISettings(_settings);
|
||||
}
|
||||
|
||||
|
@ -211,7 +207,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
|
||||
void TermControl::SearchMatch(const bool goForward)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -302,7 +298,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// - newSettings: the new settings to set
|
||||
void TermControl::_UpdateSettingsFromUIThread(IControlSettings newSettings)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -320,7 +316,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// - newAppearance: the new appearance to set
|
||||
void TermControl::_UpdateAppearanceFromUIThread(IControlAppearance newAppearance)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -533,7 +529,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Windows::UI::Xaml::Automation::Peers::AutomationPeer TermControl::OnCreateAutomationPeer()
|
||||
try
|
||||
{
|
||||
if (_initializedTerminal && !_closing) // only set up the automation peer if we're ready to go live
|
||||
if (_initializedTerminal && !_IsClosing()) // only set up the automation peer if we're ready to go live
|
||||
{
|
||||
// create a custom automation peer with this code pattern:
|
||||
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
||||
|
@ -753,7 +749,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_CharacterHandler(winrt::Windows::Foundation::IInspectable const& /*sender*/,
|
||||
Input::CharacterReceivedRoutedEventArgs const& e)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -851,7 +847,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// win32-input-mode, then we'll send all these keystrokes to the
|
||||
// terminal - it's smart enough to ignore the keys it doesn't care
|
||||
// about.
|
||||
if (_closing ||
|
||||
if (_IsClosing() ||
|
||||
e.OriginalKey() == VirtualKey::LeftWindows ||
|
||||
e.OriginalKey() == VirtualKey::RightWindows)
|
||||
|
||||
|
@ -1003,12 +999,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
keyDown) :
|
||||
true;
|
||||
|
||||
if (_cursorTimer.has_value())
|
||||
if (_cursorTimer)
|
||||
{
|
||||
// Manually show the cursor when a key is pressed. Restarting
|
||||
// the timer prevents flickering.
|
||||
_core->CursorOn(true);
|
||||
_cursorTimer.value().Start();
|
||||
_cursorTimer->Start();
|
||||
}
|
||||
|
||||
return handled;
|
||||
|
@ -1033,7 +1029,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_PointerPressedHandler(Windows::Foundation::IInspectable const& sender,
|
||||
Input::PointerRoutedEventArgs const& args)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1084,7 +1080,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_PointerMovedHandler(Windows::Foundation::IInspectable const& /*sender*/,
|
||||
Input::PointerRoutedEventArgs const& args)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1157,7 +1153,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_PointerReleasedHandler(Windows::Foundation::IInspectable const& sender,
|
||||
Input::PointerRoutedEventArgs const& args)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1199,7 +1195,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_MouseWheelHandler(Windows::Foundation::IInspectable const& /*sender*/,
|
||||
Input::PointerRoutedEventArgs const& args)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1301,7 +1297,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_ScrollbarChangeHandler(Windows::Foundation::IInspectable const& /*sender*/,
|
||||
Controls::Primitives::RangeBaseValueChangedEventArgs const& args)
|
||||
{
|
||||
if (_isInternalScrollBarUpdate || _closing)
|
||||
if (_isInternalScrollBarUpdate || _IsClosing())
|
||||
{
|
||||
// The update comes from ourselves, more specifically from the
|
||||
// terminal. So we don't have to update the terminal because it
|
||||
|
@ -1367,15 +1363,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_TryStartAutoScroll(Windows::UI::Input::PointerPoint const& pointerPoint, const double scrollVelocity)
|
||||
{
|
||||
// Allow only one pointer at the time
|
||||
if (!_autoScrollingPointerPoint.has_value() ||
|
||||
_autoScrollingPointerPoint.value().PointerId() == pointerPoint.PointerId())
|
||||
if (!_autoScrollingPointerPoint ||
|
||||
_autoScrollingPointerPoint->PointerId() == pointerPoint.PointerId())
|
||||
{
|
||||
_autoScrollingPointerPoint = pointerPoint;
|
||||
_autoScrollVelocity = scrollVelocity;
|
||||
|
||||
// If this is first time the auto scroll update is about to be called,
|
||||
// kick-start it by initializing its time delta as if it started now
|
||||
if (!_lastAutoScrollUpdateTime.has_value())
|
||||
if (!_lastAutoScrollUpdateTime)
|
||||
{
|
||||
_lastAutoScrollUpdateTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
@ -1394,8 +1390,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// - pointerId: id of pointer for which to stop auto scroll
|
||||
void TermControl::_TryStopAutoScroll(const uint32_t pointerId)
|
||||
{
|
||||
if (_autoScrollingPointerPoint.has_value() &&
|
||||
pointerId == _autoScrollingPointerPoint.value().PointerId())
|
||||
if (_autoScrollingPointerPoint &&
|
||||
pointerId == _autoScrollingPointerPoint->PointerId())
|
||||
{
|
||||
_autoScrollingPointerPoint = std::nullopt;
|
||||
_autoScrollVelocity = 0;
|
||||
|
@ -1421,15 +1417,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
{
|
||||
const auto timeNow = std::chrono::high_resolution_clock::now();
|
||||
|
||||
if (_lastAutoScrollUpdateTime.has_value())
|
||||
if (_lastAutoScrollUpdateTime)
|
||||
{
|
||||
static constexpr double microSecPerSec = 1000000.0;
|
||||
const double deltaTime = std::chrono::duration_cast<std::chrono::microseconds>(timeNow - _lastAutoScrollUpdateTime.value()).count() / microSecPerSec;
|
||||
const double deltaTime = std::chrono::duration_cast<std::chrono::microseconds>(timeNow - *_lastAutoScrollUpdateTime).count() / microSecPerSec;
|
||||
ScrollBar().Value(ScrollBar().Value() + _autoScrollVelocity * deltaTime);
|
||||
|
||||
if (_autoScrollingPointerPoint.has_value())
|
||||
if (_autoScrollingPointerPoint)
|
||||
{
|
||||
_SetEndSelectionPointAtCursor(_autoScrollingPointerPoint.value().Position());
|
||||
_SetEndSelectionPointAtCursor(_autoScrollingPointerPoint->Position());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1445,7 +1441,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_GotFocusHandler(Windows::Foundation::IInspectable const& /* sender */,
|
||||
RoutedEventArgs const& /* args */)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1474,16 +1470,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
TSFInputControl().NotifyFocusEnter();
|
||||
}
|
||||
|
||||
if (_cursorTimer.has_value())
|
||||
if (_cursorTimer)
|
||||
{
|
||||
// When the terminal focuses, show the cursor immediately
|
||||
_core->CursorOn(true);
|
||||
_cursorTimer.value().Start();
|
||||
_cursorTimer->Start();
|
||||
}
|
||||
|
||||
if (_blinkTimer.has_value())
|
||||
if (_blinkTimer)
|
||||
{
|
||||
_blinkTimer.value().Start();
|
||||
_blinkTimer->Start();
|
||||
}
|
||||
|
||||
_interactivity->GainFocus();
|
||||
|
@ -1504,7 +1500,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_LostFocusHandler(Windows::Foundation::IInspectable const& /* sender */,
|
||||
RoutedEventArgs const& /* args */)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1523,15 +1519,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
TSFInputControl().NotifyFocusLeave();
|
||||
}
|
||||
|
||||
if (_cursorTimer.has_value())
|
||||
if (_cursorTimer)
|
||||
{
|
||||
_cursorTimer.value().Stop();
|
||||
_cursorTimer->Stop();
|
||||
_core->CursorOn(false);
|
||||
}
|
||||
|
||||
if (_blinkTimer.has_value())
|
||||
if (_blinkTimer)
|
||||
{
|
||||
_blinkTimer.value().Stop();
|
||||
_blinkTimer->Stop();
|
||||
}
|
||||
|
||||
// Check if there is an unfocused config we should set the appearance to
|
||||
|
@ -1550,7 +1546,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_SwapChainSizeChanged(winrt::Windows::Foundation::IInspectable const& /*sender*/,
|
||||
SizeChangedEventArgs const& e)
|
||||
{
|
||||
if (!_initializedTerminal || _closing)
|
||||
if (!_initializedTerminal || _IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1602,7 +1598,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_CursorTimerTick(Windows::Foundation::IInspectable const& /* sender */,
|
||||
Windows::Foundation::IInspectable const& /* e */)
|
||||
{
|
||||
if (!_closing)
|
||||
if (!_IsClosing())
|
||||
{
|
||||
_core->BlinkCursor();
|
||||
}
|
||||
|
@ -1616,7 +1612,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_BlinkTimerTick(Windows::Foundation::IInspectable const& /* sender */,
|
||||
Windows::Foundation::IInspectable const& /* e */)
|
||||
{
|
||||
if (!_closing)
|
||||
if (!_IsClosing())
|
||||
{
|
||||
_core->BlinkAttributeTick();
|
||||
}
|
||||
|
@ -1644,13 +1640,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_ScrollPositionChanged(const IInspectable& /*sender*/,
|
||||
const Control::ScrollPositionChangedArgs& args)
|
||||
{
|
||||
// Since this callback fires from non-UI thread, we might be already
|
||||
// closed/closing.
|
||||
if (_closing.load())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ScrollBarUpdate update;
|
||||
const auto hiddenContent = args.BufferSize() - args.ViewHeight();
|
||||
update.newMaximum = hiddenContent;
|
||||
|
@ -1670,10 +1659,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_CursorPositionChanged(const IInspectable& /*sender*/,
|
||||
const IInspectable& /*args*/)
|
||||
{
|
||||
if (_tsfTryRedrawCanvas)
|
||||
{
|
||||
_tsfTryRedrawCanvas->Run();
|
||||
}
|
||||
_tsfTryRedrawCanvas->Run();
|
||||
}
|
||||
|
||||
hstring TermControl::Title()
|
||||
|
@ -1706,7 +1692,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// if we should defer which formats are copied to the global setting
|
||||
bool TermControl::CopySelectionToClipboard(bool singleLine, const Windows::Foundation::IReference<CopyFormat>& formats)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1723,21 +1709,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
|
||||
void TermControl::Close()
|
||||
{
|
||||
if (!_closing.exchange(true))
|
||||
if (!_IsClosing())
|
||||
{
|
||||
_closing = true;
|
||||
|
||||
_core->ReceivedOutput(_coreOutputEventToken);
|
||||
|
||||
_RestorePointerCursorHandlers(*this, nullptr);
|
||||
|
||||
// These four throttled functions are triggered by terminal output and interact with the UI.
|
||||
// Since Close() is the point after which we are removed from the UI, but before the destructor
|
||||
// has run, we should disconnect them *right now*. If we don't, they may fire between the
|
||||
// throttle delay (from the final output) and the dtor.
|
||||
_tsfTryRedrawCanvas.reset();
|
||||
_updatePatternLocations.reset();
|
||||
_updateScrollBar.reset();
|
||||
_playWarningBell.reset();
|
||||
|
||||
// Disconnect the TSF input control so it doesn't receive EditContext events.
|
||||
TSFInputControl().Close();
|
||||
_autoScrollTimer.Stop();
|
||||
|
@ -1845,9 +1822,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// will take up.
|
||||
// TODO: MSFT:21254947 - use a static function to do this instead of
|
||||
// instantiating a DxEngine
|
||||
// GH#10211 - UNDER NO CIRCUMSTANCE should this fail. If it does, the
|
||||
// whole app will crash instantaneously on launch, which is no good.
|
||||
auto dxEngine = std::make_unique<::Microsoft::Console::Render::DxEngine>();
|
||||
THROW_IF_FAILED(dxEngine->UpdateDpi(dpi));
|
||||
THROW_IF_FAILED(dxEngine->UpdateFont(desiredFont, actualFont));
|
||||
LOG_IF_FAILED(dxEngine->UpdateDpi(dpi));
|
||||
LOG_IF_FAILED(dxEngine->UpdateFont(desiredFont, actualFont));
|
||||
|
||||
const auto scale = dxEngine->GetScaling();
|
||||
const auto fontSize = actualFont.GetSize();
|
||||
|
@ -2101,7 +2080,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// - <none>
|
||||
void TermControl::_CompositionCompleted(winrt::hstring text)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2178,7 +2157,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
winrt::fire_and_forget TermControl::_DragDropHandler(Windows::Foundation::IInspectable /*sender*/,
|
||||
DragEventArgs e)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2265,7 +2244,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void TermControl::_DragOverHandler(Windows::Foundation::IInspectable const& /*sender*/,
|
||||
DragEventArgs const& e)
|
||||
{
|
||||
if (_closing)
|
||||
if (_IsClosing())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2384,17 +2363,33 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
|
||||
void TermControl::BellLightOn()
|
||||
{
|
||||
// Initialize the animation if it does not exist
|
||||
// We only initialize here instead of in the ctor because depending on the bell style setting,
|
||||
// we may never need this animation
|
||||
if (!_bellLightAnimation)
|
||||
{
|
||||
_bellLightAnimation = Window::Current().Compositor().CreateScalarKeyFrameAnimation();
|
||||
// Add key frames and a duration to our bell light animation
|
||||
_bellLightAnimation.InsertKeyFrame(0.0, 2.0);
|
||||
_bellLightAnimation.InsertKeyFrame(1.0, 1.0);
|
||||
_bellLightAnimation.Duration(winrt::Windows::Foundation::TimeSpan(std::chrono::milliseconds(TerminalWarningBellInterval)));
|
||||
}
|
||||
|
||||
// Similar to the animation, only initialize the timer here
|
||||
if (!_bellLightTimer)
|
||||
{
|
||||
_bellLightTimer = {};
|
||||
_bellLightTimer.Interval(std::chrono::milliseconds(TerminalWarningBellInterval));
|
||||
_bellLightTimer.Tick({ get_weak(), &TermControl::_BellLightOff });
|
||||
}
|
||||
|
||||
Windows::Foundation::Numerics::float2 zeroSize{ 0, 0 };
|
||||
// If the grid has 0 size or if the bell timer is
|
||||
// already active, do nothing
|
||||
if (RootGrid().ActualSize() != zeroSize && !_bellLightTimer)
|
||||
if (RootGrid().ActualSize() != zeroSize && !_bellLightTimer.IsEnabled())
|
||||
{
|
||||
// Start the timer, when the timer ticks we switch off the light
|
||||
DispatcherTimer invertTimer;
|
||||
invertTimer.Interval(std::chrono::milliseconds(TerminalWarningBellInterval));
|
||||
invertTimer.Tick({ get_weak(), &TermControl::_BellLightOff });
|
||||
invertTimer.Start();
|
||||
_bellLightTimer.emplace(std::move(invertTimer));
|
||||
_bellLightTimer.Start();
|
||||
|
||||
// Switch on the light and animate the intensity to fade out
|
||||
VisualBellLight::SetIsTarget(RootGrid(), true);
|
||||
|
@ -2408,10 +2403,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
if (_bellLightTimer)
|
||||
{
|
||||
// Stop the timer and switch off the light
|
||||
_bellLightTimer->Stop();
|
||||
_bellLightTimer.reset();
|
||||
_bellLightTimer.Stop();
|
||||
|
||||
if (!_closing)
|
||||
if (!_IsClosing())
|
||||
{
|
||||
VisualBellLight::SetIsTarget(RootGrid(), false);
|
||||
}
|
||||
|
@ -2454,7 +2448,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
if (auto self{ weakThis.get() })
|
||||
{
|
||||
auto lastHoveredCell = _core->GetHoveredCell();
|
||||
if (lastHoveredCell.has_value())
|
||||
if (lastHoveredCell)
|
||||
{
|
||||
const auto uriText = _core->GetHoveredUriText();
|
||||
if (!uriText.empty())
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "../buffer/out/search.h"
|
||||
#include "cppwinrt_utils.h"
|
||||
#include "SearchBoxControl.h"
|
||||
#include "ThrottledFunc.h"
|
||||
|
||||
#include "ControlInteractivity.h"
|
||||
|
||||
|
@ -150,9 +149,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
winrt::com_ptr<SearchBoxControl> _searchBox;
|
||||
|
||||
IControlSettings _settings;
|
||||
std::atomic<bool> _closing;
|
||||
bool _focused;
|
||||
bool _initializedTerminal;
|
||||
bool _closing{ false };
|
||||
bool _focused{ false };
|
||||
bool _initializedTerminal{ false };
|
||||
|
||||
std::shared_ptr<ThrottledFuncTrailing<>> _tsfTryRedrawCanvas;
|
||||
std::shared_ptr<ThrottledFuncTrailing<>> _updatePatternLocations;
|
||||
|
@ -174,16 +173,23 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Windows::UI::Xaml::DispatcherTimer _autoScrollTimer;
|
||||
std::optional<std::chrono::high_resolution_clock::time_point> _lastAutoScrollUpdateTime;
|
||||
|
||||
winrt::Windows::UI::Composition::ScalarKeyFrameAnimation _bellLightAnimation;
|
||||
winrt::Windows::UI::Composition::ScalarKeyFrameAnimation _bellLightAnimation{ nullptr };
|
||||
Windows::UI::Xaml::DispatcherTimer _bellLightTimer{ nullptr };
|
||||
|
||||
std::optional<Windows::UI::Xaml::DispatcherTimer> _cursorTimer;
|
||||
std::optional<Windows::UI::Xaml::DispatcherTimer> _blinkTimer;
|
||||
std::optional<Windows::UI::Xaml::DispatcherTimer> _bellLightTimer;
|
||||
|
||||
event_token _coreOutputEventToken;
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::SwapChainPanel::LayoutUpdated_revoker _layoutUpdatedRevoker;
|
||||
|
||||
inline bool _IsClosing() const noexcept
|
||||
{
|
||||
// _closing isn't atomic and may only be accessed from the main thread.
|
||||
assert(Dispatcher().HasThreadAccess());
|
||||
return _closing;
|
||||
}
|
||||
|
||||
void _UpdateSettingsFromUIThread(IControlSettings newSettings);
|
||||
void _UpdateAppearanceFromUIThread(IControlAppearance newAppearance);
|
||||
void _ApplyUISettings(const IControlSettings&);
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
<ClInclude Include="TermControlAutomationPeer.h">
|
||||
<DependentUpon>TermControlAutomationPeer.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ThrottledFunc.h" />
|
||||
<ClInclude Include="TSFInputControl.h">
|
||||
<DependentUpon>TSFInputControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
|
|
|
@ -1,186 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- ThrottledFunc.h
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
template<typename... Args>
|
||||
class ThrottledFuncStorage
|
||||
{
|
||||
public:
|
||||
template<typename... MakeArgs>
|
||||
bool Emplace(MakeArgs&&... args)
|
||||
{
|
||||
std::scoped_lock guard{ _lock };
|
||||
|
||||
const bool hadValue = _pendingRunArgs.has_value();
|
||||
_pendingRunArgs.emplace(std::forward<MakeArgs>(args)...);
|
||||
return hadValue;
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
void ModifyPending(F f)
|
||||
{
|
||||
std::scoped_lock guard{ _lock };
|
||||
|
||||
if (_pendingRunArgs.has_value())
|
||||
{
|
||||
std::apply(f, _pendingRunArgs.value());
|
||||
}
|
||||
}
|
||||
|
||||
std::tuple<Args...> Extract()
|
||||
{
|
||||
decltype(_pendingRunArgs) args;
|
||||
std::scoped_lock guard{ _lock };
|
||||
_pendingRunArgs.swap(args);
|
||||
return args.value();
|
||||
}
|
||||
|
||||
private:
|
||||
std::mutex _lock;
|
||||
std::optional<std::tuple<Args...>> _pendingRunArgs;
|
||||
};
|
||||
|
||||
template<>
|
||||
class ThrottledFuncStorage<>
|
||||
{
|
||||
public:
|
||||
bool Emplace()
|
||||
{
|
||||
return _isRunPending.test_and_set(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
std::tuple<> Extract()
|
||||
{
|
||||
Reset();
|
||||
return {};
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_isRunPending.clear(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
private:
|
||||
std::atomic_flag _isRunPending;
|
||||
};
|
||||
|
||||
// Class Description:
|
||||
// - Represents a function that takes arguments and whose invocation is
|
||||
// delayed by a specified duration and rate-limited such that if the code
|
||||
// tries to run the function while a call to the function is already
|
||||
// pending, then the previous call with the previous arguments will be
|
||||
// cancelled and the call will be made with the new arguments instead.
|
||||
// - The function will be run on the the specified dispatcher.
|
||||
template<bool leading, typename... Args>
|
||||
class ThrottledFunc : public std::enable_shared_from_this<ThrottledFunc<leading, Args...>>
|
||||
{
|
||||
public:
|
||||
using Func = std::function<void(Args...)>;
|
||||
|
||||
ThrottledFunc(winrt::Windows::UI::Core::CoreDispatcher dispatcher, winrt::Windows::Foundation::TimeSpan delay, Func func) :
|
||||
_dispatcher{ std::move(dispatcher) },
|
||||
_delay{ std::move(delay) },
|
||||
_func{ std::move(func) }
|
||||
{
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Runs the function later with the specified arguments, except if `Run`
|
||||
// is called again before with new arguments, in which case the new
|
||||
// arguments will be used instead.
|
||||
// - For more information, read the class' documentation.
|
||||
// - This method is always thread-safe. It can be called multiple times on
|
||||
// different threads.
|
||||
// Arguments:
|
||||
// - args: the arguments to pass to the function
|
||||
// Return Value:
|
||||
// - <none>
|
||||
template<typename... MakeArgs>
|
||||
void Run(MakeArgs&&... args)
|
||||
{
|
||||
if (!_storage.Emplace(std::forward<MakeArgs>(args)...))
|
||||
{
|
||||
_Fire();
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Modifies the pending arguments for the next function invocation, if
|
||||
// there is one pending currently.
|
||||
// - Let's say that you just called the `Run` method with some arguments.
|
||||
// After the delay specified in the constructor, the function specified
|
||||
// in the constructor will be called with these arguments.
|
||||
// - By using this method, you can modify the arguments before the function
|
||||
// is called.
|
||||
// - You pass a function to this method which will take references to
|
||||
// the arguments (one argument corresponds to one reference to an
|
||||
// argument) and will modify them.
|
||||
// - When there is no pending invocation of the function, this method will
|
||||
// not do anything.
|
||||
// - This method is always thread-safe. It can be called multiple times on
|
||||
// different threads.
|
||||
// Arguments:
|
||||
// - f: the function to call with references to the arguments
|
||||
// Return Value:
|
||||
// - <none>
|
||||
template<typename F>
|
||||
void ModifyPending(F f)
|
||||
{
|
||||
_storage.ModifyPending(f);
|
||||
}
|
||||
|
||||
private:
|
||||
winrt::fire_and_forget _Fire()
|
||||
{
|
||||
const auto dispatcher = _dispatcher;
|
||||
auto weakSelf = this->weak_from_this();
|
||||
|
||||
if constexpr (leading)
|
||||
{
|
||||
co_await winrt::resume_foreground(dispatcher);
|
||||
|
||||
if (auto self{ weakSelf.lock() })
|
||||
{
|
||||
self->_func();
|
||||
}
|
||||
else
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
co_await winrt::resume_after(_delay);
|
||||
|
||||
if (auto self{ weakSelf.lock() })
|
||||
{
|
||||
self->_storage.Reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
co_await winrt::resume_after(_delay);
|
||||
co_await winrt::resume_foreground(dispatcher);
|
||||
|
||||
if (auto self{ weakSelf.lock() })
|
||||
{
|
||||
std::apply(self->_func, self->_storage.Extract());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Core::CoreDispatcher _dispatcher;
|
||||
winrt::Windows::Foundation::TimeSpan _delay;
|
||||
Func _func;
|
||||
|
||||
ThrottledFuncStorage<Args...> _storage;
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
using ThrottledFuncTrailing = ThrottledFunc<false, Args...>;
|
||||
using ThrottledFuncLeading = ThrottledFunc<true>;
|
|
@ -58,3 +58,5 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalControlProvider);
|
|||
#include <telemetry/ProjectTelemetry.h>
|
||||
|
||||
#include "til.h"
|
||||
|
||||
#include "ThrottledFunc.h"
|
||||
|
|
|
@ -733,6 +733,10 @@ bool TerminalDispatch::HardReset() noexcept
|
|||
// Cursor to 1,1 - the Soft Reset guarantees this is absolute
|
||||
success = CursorPosition(1, 1) && success;
|
||||
|
||||
// Reset the mouse mode
|
||||
success = EnableSGRExtendedMouseMode(false);
|
||||
success = EnableAnyEventMouseMode(false);
|
||||
|
||||
// Delete all current tab stops and reapply
|
||||
_ResetTabStops();
|
||||
|
||||
|
|
|
@ -241,16 +241,12 @@
|
|||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="ButtonForeground"
|
||||
Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver"
|
||||
Color="{StaticResource SystemAccentColor}" />
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed"
|
||||
Color="{StaticResource SystemAccentColor}" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="ButtonForeground"
|
||||
Color="White" />
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver"
|
||||
Color="{StaticResource SystemAccentColor}" />
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed"
|
||||
|
|
|
@ -11,6 +11,26 @@
|
|||
<ResourceDictionary Source="SettingContainerStyle.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Style x:Key="SecondaryTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumColor}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Style x:Key="SecondaryTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumColor}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<Style x:Key="SecondaryTextBlockStyle"
|
||||
TargetType="TextBlock" />
|
||||
<!-- Do not mess with the foreground color for High Contrast. Let it ride as is. -->
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
<x:Double x:Key="StandardIconSize">14.0</x:Double>
|
||||
<Thickness x:Key="StandardIndentMargin">13,0,0,0</Thickness>
|
||||
<Thickness x:Key="StandardControlMargin">0,24,0,0</Thickness>
|
||||
|
|
|
@ -39,6 +39,11 @@ namespace Microsoft.Terminal.Settings.Editor
|
|||
PercentageConverter();
|
||||
};
|
||||
|
||||
runtimeclass PercentageSignConverter : [default] Windows.UI.Xaml.Data.IValueConverter
|
||||
{
|
||||
PercentageSignConverter();
|
||||
};
|
||||
|
||||
runtimeclass StringIsEmptyConverter : [default] Windows.UI.Xaml.Data.IValueConverter
|
||||
{
|
||||
StringIsEmptyConverter();
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
INITIALIZE_BINDABLE_ENUM_SETTING(LaunchMode, LaunchMode, LaunchMode, L"Globals_LaunchMode", L"Content");
|
||||
INITIALIZE_BINDABLE_ENUM_SETTING(WindowingBehavior, WindowingMode, WindowingMode, L"Globals_WindowingBehavior", L"Content");
|
||||
|
||||
#if 0
|
||||
// BODGY
|
||||
// Xaml code generator for x:Bind to this will fail to find UnloadObject() on Launch class.
|
||||
// To work around, check it ourselves on construction and FindName to force load.
|
||||
|
@ -28,6 +29,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
{
|
||||
FindName(L"DefaultTerminalDropdown");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Launch::OnNavigatedTo(const NavigationEventArgs& e)
|
||||
|
|
|
@ -114,12 +114,12 @@
|
|||
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Foreground="{StaticResource SystemBaseMediumColor}"
|
||||
Style="{ThemeResource SecondaryTextBlockStyle}"
|
||||
Text="{x:Bind Author}" />
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Foreground="{StaticResource SystemBaseMediumColor}"
|
||||
Style="{ThemeResource SecondaryTextBlockStyle}"
|
||||
Text="{x:Bind Version}" />
|
||||
|
||||
</Grid>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Interaction.h"
|
||||
#include "Rendering.h"
|
||||
#include "Actions.h"
|
||||
#include "ReadOnlyActions.h"
|
||||
#include "Profiles.h"
|
||||
#include "GlobalAppearance.h"
|
||||
#include "ColorSchemes.h"
|
||||
|
@ -65,13 +66,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
// - settings - the new settings source
|
||||
// Return value:
|
||||
// - <none>
|
||||
fire_and_forget MainPage::UpdateSettings(Model::CascadiaSettings settings)
|
||||
void MainPage::UpdateSettings(const Model::CascadiaSettings& settings)
|
||||
{
|
||||
_settingsSource = settings;
|
||||
_settingsClone = settings.Copy();
|
||||
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
// Deduce information about the currently selected item
|
||||
IInspectable selectedItemTag;
|
||||
auto menuItems{ SettingsNav().MenuItems() };
|
||||
|
@ -83,34 +82,43 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
}
|
||||
}
|
||||
|
||||
// remove all profile-related NavViewItems by populating a std::vector
|
||||
// with the ones we want to keep.
|
||||
// NOTE: menuItems.Remove() causes an out-of-bounds crash. Using ReplaceAll()
|
||||
// gets around this crash.
|
||||
std::vector<IInspectable> menuItemsSTL;
|
||||
for (const auto& item : menuItems)
|
||||
{
|
||||
if (const auto& navViewItem{ item.try_as<MUX::Controls::NavigationViewItem>() })
|
||||
{
|
||||
if (const auto& tag{ navViewItem.Tag() })
|
||||
{
|
||||
if (tag.try_as<Editor::ProfileViewModel>())
|
||||
// We'll remove a bunch of items and iterate over it twice.
|
||||
// --> Copy it into an STL vector to simplify our code and reduce COM overhead.
|
||||
std::vector<IInspectable> menuItemsSTL(menuItems.Size(), nullptr);
|
||||
menuItems.GetMany(0, menuItemsSTL);
|
||||
|
||||
// We want to refresh the list of profiles in the NavigationView.
|
||||
// In order to add profiles we can use _InitializeProfilesList();
|
||||
// But before we can do that we have to remove existing profiles first of course.
|
||||
// This "erase-remove" idiom will achieve just that.
|
||||
menuItemsSTL.erase(
|
||||
std::remove_if(
|
||||
menuItemsSTL.begin(),
|
||||
menuItemsSTL.end(),
|
||||
[](const auto& item) -> bool {
|
||||
if (const auto& navViewItem{ item.try_as<MUX::Controls::NavigationViewItem>() })
|
||||
{
|
||||
// don't add NavViewItem pointing to a Profile
|
||||
continue;
|
||||
}
|
||||
else if (const auto& stringTag{ tag.try_as<hstring>() })
|
||||
{
|
||||
if (stringTag == addProfileTag)
|
||||
if (const auto& tag{ navViewItem.Tag() })
|
||||
{
|
||||
// don't add the "Add Profile" item
|
||||
continue;
|
||||
if (tag.try_as<Editor::ProfileViewModel>())
|
||||
{
|
||||
// remove NavViewItem pointing to a Profile
|
||||
return true;
|
||||
}
|
||||
if (const auto& stringTag{ tag.try_as<hstring>() })
|
||||
{
|
||||
if (stringTag == addProfileTag)
|
||||
{
|
||||
// remove the "Add Profile" item
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
menuItemsSTL.emplace_back(item);
|
||||
}
|
||||
return false;
|
||||
}),
|
||||
menuItemsSTL.end());
|
||||
|
||||
menuItems.ReplaceAll(menuItemsSTL);
|
||||
|
||||
// Repopulate profile-related menu items
|
||||
|
@ -138,7 +146,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
// found the one that was selected before the refresh
|
||||
SettingsNav().SelectedItem(item);
|
||||
_Navigate(*stringTag);
|
||||
co_return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +159,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
// found the one that was selected before the refresh
|
||||
SettingsNav().SelectedItem(item);
|
||||
_Navigate(*profileTag);
|
||||
co_return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,14 +168,12 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
}
|
||||
}
|
||||
|
||||
// couldn't find the selected item,
|
||||
// fallback to first menu item
|
||||
const auto& firstItem{ menuItems.GetAt(0) };
|
||||
// Couldn't find the selected item, fallback to first menu item
|
||||
// This happens when the selected item was a profile which doesn't exist in the new configuration
|
||||
// We can use menuItemsSTL here because the only things they miss are profile entries.
|
||||
const auto& firstItem{ menuItemsSTL.at(0).as<MUX::Controls::NavigationViewItem>() };
|
||||
SettingsNav().SelectedItem(firstItem);
|
||||
if (const auto& tag{ SettingsNav().SelectedItem().try_as<MUX::Controls::NavigationViewItem>().Tag() })
|
||||
{
|
||||
_Navigate(unbox_value<hstring>(tag));
|
||||
}
|
||||
_Navigate(unbox_value<hstring>(firstItem.Tag()));
|
||||
}
|
||||
|
||||
void MainPage::SetHostingWindow(uint64_t hostingWindow) noexcept
|
||||
|
@ -286,7 +292,21 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
}
|
||||
else if (clickedItemTag == actionsTag)
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Editor::Actions>(), winrt::make<ActionsPageNavigationState>(_settingsClone));
|
||||
if constexpr (Feature_EditableActionsPage::IsEnabled())
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Editor::Actions>(), winrt::make<ActionsPageNavigationState>(_settingsClone));
|
||||
}
|
||||
else
|
||||
{
|
||||
auto actionsState{ winrt::make<ReadOnlyActionsPageNavigationState>(_settingsClone) };
|
||||
actionsState.OpenJson([weakThis = get_weak()](auto&&, auto&& arg) {
|
||||
if (auto self{ weakThis.get() })
|
||||
{
|
||||
self->_OpenJsonHandlers(nullptr, arg);
|
||||
}
|
||||
});
|
||||
contentFrame().Navigate(xaml_typename<Editor::ReadOnlyActions>(), actionsState);
|
||||
}
|
||||
}
|
||||
else if (clickedItemTag == colorSchemesTag)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
MainPage() = delete;
|
||||
MainPage(const Model::CascadiaSettings& settings);
|
||||
|
||||
fire_and_forget UpdateSettings(Model::CascadiaSettings settings);
|
||||
void UpdateSettings(const Model::CascadiaSettings& settings);
|
||||
|
||||
void OpenJsonKeyDown(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& args);
|
||||
void OpenJsonTapped(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs const& args);
|
||||
|
|
|
@ -107,8 +107,9 @@
|
|||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Frame x:Name="contentFrame"
|
||||
Grid.Row="0" />
|
||||
<ScrollViewer Grid.Row="0">
|
||||
<Frame x:Name="contentFrame" />
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="1"
|
||||
Height="100"
|
||||
BorderBrush="{ThemeResource SystemBaseLowColor}"
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
<ClInclude Include="InvertedBooleanToVisibilityConverter.h">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PercentageSignConverter.h">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StringIsEmptyConverter.h">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
|
@ -96,6 +99,9 @@
|
|||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ReadOnlyActions.h">
|
||||
<DependentUpon>ReadOnlyActions.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Rendering.h">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
|
@ -134,6 +140,9 @@
|
|||
<Page Include="Profiles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ReadOnlyActions.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Rendering.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
@ -167,6 +176,9 @@
|
|||
<ClCompile Include="InvertedBooleanToVisibilityConverter.cpp">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PercentageSignConverter.cpp">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StringIsEmptyConverter.cpp">
|
||||
<DependentUpon>Converters.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
|
@ -203,6 +215,9 @@
|
|||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ReadOnlyActions.cpp">
|
||||
<DependentUpon>ReadOnlyActions.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Rendering.cpp">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
|
@ -242,6 +257,10 @@
|
|||
<DependentUpon>Interaction.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="ReadOnlyActions.idl">
|
||||
<DependentUpon>ReadOnlyActions.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="Rendering.idl">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
|
|
@ -10,10 +10,16 @@
|
|||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
<ClCompile Include="Utils.cpp" />
|
||||
<ClCompile Include="PercentageSignConverter.cpp">
|
||||
<Filter>Converters</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Utils.h" />
|
||||
<ClInclude Include="PercentageSignConverter.h">
|
||||
<Filter>Converters</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="EnumEntry.idl" />
|
||||
|
@ -43,4 +49,4 @@
|
|||
<UniqueIdentifier>{00f725c8-41b4-40a8-995e-8ee2e49a4a4c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "PercentageSignConverter.h"
|
||||
#include "PercentageSignConverter.g.cpp"
|
||||
|
||||
using namespace winrt::Windows;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Foundation::IInspectable PercentageSignConverter::Convert(Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /* parameter */,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
const auto number{ winrt::unbox_value<double>(value) };
|
||||
return winrt::box_value(to_hstring((int)number) + L"%");
|
||||
}
|
||||
|
||||
Foundation::IInspectable PercentageSignConverter::ConvertBack(Foundation::IInspectable const& /*value*/,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /*parameter*/,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PercentageSignConverter.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
DECLARE_CONVERTER(winrt::Microsoft::Terminal::Settings::Editor, PercentageSignConverter);
|
|
@ -35,6 +35,7 @@
|
|||
</DataTemplate>
|
||||
<local:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||
<local:PercentageConverter x:Key="PercentageConverter" />
|
||||
<local:PercentageSignConverter x:Key="PercentageSignConverter" />
|
||||
<local:FontWeightConverter x:Key="FontWeightConverter" />
|
||||
<local:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter" />
|
||||
<local:StringIsEmptyConverter x:Key="StringIsEmptyConverter" />
|
||||
|
@ -626,7 +627,7 @@
|
|||
Value="{x:Bind State.Profile.BackgroundImageOpacity, Converter={StaticResource PercentageConverter}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Style="{StaticResource SliderValueLabelStyle}"
|
||||
Text="{Binding ElementName=BIOpacitySlider, Path=Value, Mode=OneWay}" />
|
||||
Text="{Binding ElementName=BIOpacitySlider, Path=Value, Mode=OneWay, Converter={StaticResource PercentageSignConverter}}" />
|
||||
</Grid>
|
||||
</local:SettingContainer>
|
||||
</StackPanel>
|
||||
|
@ -664,7 +665,7 @@
|
|||
Value="{x:Bind State.Profile.AcrylicOpacity, Converter={StaticResource PercentageConverter}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Style="{StaticResource SliderValueLabelStyle}"
|
||||
Text="{Binding ElementName=AcrylicOpacitySlider, Path=Value, Mode=OneWay}" />
|
||||
Text="{Binding ElementName=AcrylicOpacitySlider, Path=Value, Mode=OneWay, Converter={StaticResource PercentageSignConverter}}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</local:SettingContainer>
|
||||
|
|
64
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.cpp
Normal file
64
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "ReadOnlyActions.h"
|
||||
#include "ReadOnlyActions.g.cpp"
|
||||
#include "ReadOnlyActionsPageNavigationState.g.cpp"
|
||||
#include "EnumEntry.h"
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml::Navigation;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
ReadOnlyActions::ReadOnlyActions()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_filteredActions = winrt::single_threaded_observable_vector<Command>();
|
||||
}
|
||||
|
||||
void ReadOnlyActions::OnNavigatedTo(const NavigationEventArgs& e)
|
||||
{
|
||||
_State = e.Parameter().as<Editor::ReadOnlyActionsPageNavigationState>();
|
||||
|
||||
std::vector<Command> keyBindingList;
|
||||
for (const auto& [_, command] : _State.Settings().GlobalSettings().ActionMap().NameMap())
|
||||
{
|
||||
// Filter out nested commands, and commands that aren't bound to a
|
||||
// key. This page is currently just for displaying the actions that
|
||||
// _are_ bound to keys.
|
||||
if (command.HasNestedCommands() || !command.Keys())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
keyBindingList.push_back(command);
|
||||
}
|
||||
std::sort(begin(keyBindingList), end(keyBindingList), CommandComparator{});
|
||||
_filteredActions = single_threaded_observable_vector<Command>(std::move(keyBindingList));
|
||||
}
|
||||
|
||||
Collections::IObservableVector<Command> ReadOnlyActions::FilteredActions()
|
||||
{
|
||||
return _filteredActions;
|
||||
}
|
||||
|
||||
void ReadOnlyActions::_OpenSettingsClick(const IInspectable& /*sender*/,
|
||||
const Windows::UI::Xaml::RoutedEventArgs& /*eventArgs*/)
|
||||
{
|
||||
const CoreWindow window = CoreWindow::GetForCurrentThread();
|
||||
const auto rAltState = window.GetKeyState(VirtualKey::RightMenu);
|
||||
const auto lAltState = window.GetKeyState(VirtualKey::LeftMenu);
|
||||
const bool altPressed = WI_IsFlagSet(lAltState, CoreVirtualKeyStates::Down) ||
|
||||
WI_IsFlagSet(rAltState, CoreVirtualKeyStates::Down);
|
||||
|
||||
const auto target = altPressed ? SettingsTarget::DefaultsFile : SettingsTarget::SettingsFile;
|
||||
|
||||
_State.RequestOpenJson(target);
|
||||
}
|
||||
|
||||
}
|
57
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.h
Normal file
57
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ReadOnlyActions.g.h"
|
||||
#include "ReadOnlyActionsPageNavigationState.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct CommandComparator
|
||||
{
|
||||
bool operator()(const Model::Command& lhs, const Model::Command& rhs) const
|
||||
{
|
||||
return lhs.Name() < rhs.Name();
|
||||
}
|
||||
};
|
||||
|
||||
struct ReadOnlyActionsPageNavigationState : ReadOnlyActionsPageNavigationStateT<ReadOnlyActionsPageNavigationState>
|
||||
{
|
||||
public:
|
||||
ReadOnlyActionsPageNavigationState(const Model::CascadiaSettings& settings) :
|
||||
_Settings{ settings } {}
|
||||
|
||||
void RequestOpenJson(const Model::SettingsTarget target)
|
||||
{
|
||||
_OpenJsonHandlers(nullptr, target);
|
||||
}
|
||||
|
||||
WINRT_PROPERTY(Model::CascadiaSettings, Settings, nullptr)
|
||||
TYPED_EVENT(OpenJson, Windows::Foundation::IInspectable, Model::SettingsTarget);
|
||||
};
|
||||
|
||||
struct ReadOnlyActions : ReadOnlyActionsT<ReadOnlyActions>
|
||||
{
|
||||
public:
|
||||
ReadOnlyActions();
|
||||
|
||||
void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e);
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Model::Command> FilteredActions();
|
||||
|
||||
WINRT_PROPERTY(Editor::ReadOnlyActionsPageNavigationState, State, nullptr);
|
||||
|
||||
private:
|
||||
friend struct ReadOnlyActionsT<ReadOnlyActions>; // for Xaml to bind events
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Model::Command> _filteredActions{ nullptr };
|
||||
|
||||
void _OpenSettingsClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ReadOnlyActions);
|
||||
}
|
23
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.idl
Normal file
23
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.idl
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "EnumEntry.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass ReadOnlyActionsPageNavigationState
|
||||
{
|
||||
Microsoft.Terminal.Settings.Model.CascadiaSettings Settings;
|
||||
void RequestOpenJson(Microsoft.Terminal.Settings.Model.SettingsTarget target);
|
||||
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Settings.Model.SettingsTarget> OpenJson;
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass ReadOnlyActions : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
ReadOnlyActions();
|
||||
ReadOnlyActionsPageNavigationState State { get; };
|
||||
|
||||
IObservableVector<Microsoft.Terminal.Settings.Model.Command> FilteredActions { get; };
|
||||
|
||||
}
|
||||
}
|
225
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.xaml
Normal file
225
src/cascadia/TerminalSettingsEditor/ReadOnlyActions.xaml
Normal file
|
@ -0,0 +1,225 @@
|
|||
<!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information.
|
||||
-->
|
||||
<Page x:Class="Microsoft.Terminal.Settings.Editor.ReadOnlyActions"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="CommonResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<local:StringIsEmptyConverter x:Key="CommandKeyChordVisibilityConverter" />
|
||||
|
||||
<!--
|
||||
Template for actions. This is _heavily_ copied from the command
|
||||
palette, with modifications:
|
||||
* We don't need to use a HighlightedTextControl, because we're
|
||||
not filtering this list
|
||||
* We don't need the chevron for nested commands
|
||||
* We're not displaying the icon
|
||||
* We're binding directly to a Command, not a FilteredCommand
|
||||
|
||||
If we wanted to reuse the command palette's list more directly,
|
||||
that's theoretically possible, but then it would need to be
|
||||
lifted out of TerminalApp and either moved into the
|
||||
TerminalSettingsEditor or moved to it's own project consumed by
|
||||
both TSE and TerminalApp.
|
||||
-->
|
||||
<DataTemplate x:Key="GeneralItemTemplate"
|
||||
x:DataType="SettingsModel:Command">
|
||||
|
||||
<!--
|
||||
This HorizontalContentAlignment="Stretch" is important
|
||||
to make sure it takes the entire width of the line
|
||||
-->
|
||||
<ListViewItem HorizontalContentAlignment="Stretch"
|
||||
AutomationProperties.AcceleratorKey="{x:Bind KeyChordText, Mode=OneWay}"
|
||||
AutomationProperties.Name="{x:Bind Name, Mode=OneWay}">
|
||||
|
||||
<Grid HorizontalAlignment="Stretch"
|
||||
ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<!-- command label -->
|
||||
<ColumnDefinition Width="*" />
|
||||
<!-- key chord -->
|
||||
<ColumnDefinition Width="32" />
|
||||
<!-- gutter for scrollbar -->
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{x:Bind Name, Mode=OneWay}" />
|
||||
|
||||
<!--
|
||||
Inexplicably, we don't need to set the
|
||||
AutomationProperties to Raw here, unlike in the
|
||||
CommandPalette. We're not quite sure why.
|
||||
-->
|
||||
<Border Grid.Column="1"
|
||||
Padding="2,0,2,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Style="{ThemeResource KeyChordBorderStyle}">
|
||||
|
||||
<TextBlock FontSize="12"
|
||||
Style="{ThemeResource KeyChordTextBlockStyle}"
|
||||
Text="{x:Bind KeyChordText, Mode=OneWay}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</ListViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- These resources again, HEAVILY copied from the command palette -->
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<!-- TextBox colors ! -->
|
||||
<SolidColorBrush x:Key="TextControlBackground"
|
||||
Color="#333333" />
|
||||
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush"
|
||||
Color="#B5B5B5" />
|
||||
<SolidColorBrush x:Key="TextControlForeground"
|
||||
Color="#B5B5B5" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrush"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForeground"
|
||||
Color="#B5B5B5" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundPointerOver"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlForegroundPointerOver"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver"
|
||||
Color="#FF4343" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundFocused"
|
||||
Color="#333333" />
|
||||
<SolidColorBrush x:Key="TextControlForegroundFocused"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushFocused"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPressed"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed"
|
||||
Color="#FF4343" />
|
||||
|
||||
<!-- KeyChordText styles -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="KeyChordTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<!-- TextBox colors ! -->
|
||||
<SolidColorBrush x:Key="TextControlBackground"
|
||||
Color="#CCCCCC" />
|
||||
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrush"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForeground"
|
||||
Color="#636363" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundPointerOver"
|
||||
Color="#DADADA" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver"
|
||||
Color="#FF4343" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundFocused"
|
||||
Color="#CCCCCC" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushFocused"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPressed"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed"
|
||||
Color="#FF4343" />
|
||||
|
||||
<!-- KeyChordText styles -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="KeyChordTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
|
||||
<!-- KeyChordText styles (use XAML defaults for High Contrast theme) -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
TargetType="Border" />
|
||||
<Style x:Key="KeyChordTextBlockStyle"
|
||||
TargetType="TextBlock" />
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
||||
<TextBlock x:Uid="Globals_KeybindingsDisclaimer"
|
||||
Style="{StaticResource DisclaimerStyle}" />
|
||||
|
||||
<!--
|
||||
The Nav_OpenJSON resource just so happens to have a .Content
|
||||
and .Tooltip that are _exactly_ what we're looking for here.
|
||||
-->
|
||||
|
||||
<HyperlinkButton x:Uid="Nav_OpenJSON"
|
||||
Click="_OpenSettingsClick" />
|
||||
|
||||
<!-- Keybindings -->
|
||||
|
||||
<!--
|
||||
NOTE: Globals_Keybindings.Header is not defined, because that
|
||||
would result in the page having "Keybindings" displayed twice, which
|
||||
looks quite redundant
|
||||
-->
|
||||
<ContentPresenter x:Uid="Globals_Keybindings"
|
||||
Margin="0">
|
||||
|
||||
<ListView HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
CanReorderItems="False"
|
||||
IsItemClickEnabled="False"
|
||||
ItemTemplate="{StaticResource GeneralItemTemplate}"
|
||||
ItemsSource="{x:Bind FilteredActions, Mode=OneWay}"
|
||||
SelectionMode="None" />
|
||||
|
||||
</ContentPresenter>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</ScrollViewer>
|
||||
</Page>
|
|
@ -587,6 +587,14 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
|
||||
winrt::hstring GlobalSummonArgs::GenerateName() const
|
||||
{
|
||||
// GH#10210 - Is this action literally the same thing as the `quakeMode`
|
||||
// action? That has a special name.
|
||||
static const auto quakeModeArgs{ std::get<0>(GlobalSummonArgs::QuakeModeFromJson(Json::Value::null)) };
|
||||
if (quakeModeArgs.Equals(*this))
|
||||
{
|
||||
return RS_(L"QuakeModeCommandKey");
|
||||
}
|
||||
|
||||
std::wstringstream ss;
|
||||
ss << std::wstring_view(RS_(L"GlobalSummonCommandKey"));
|
||||
|
||||
|
|
|
@ -68,6 +68,15 @@ constexpr size_t Microsoft::Terminal::Settings::Model::HashUtils::HashProperty(c
|
|||
return gsl::narrow_cast<size_t>(args.Hash());
|
||||
}
|
||||
|
||||
// Retrieves the hash value for an empty-constructed object.
|
||||
template<typename T>
|
||||
static size_t EmptyHash()
|
||||
{
|
||||
// cache the value of the empty hash
|
||||
static const size_t cachedHash = winrt::make_self<T>()->Hash();
|
||||
return cachedHash;
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
using namespace ::Microsoft::Terminal::Settings::Model;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "AllShortcutActions.h"
|
||||
#include "ActionMap.h"
|
||||
|
||||
#include "ActionMap.g.cpp"
|
||||
|
@ -18,18 +19,36 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
size_t hashedArgs{};
|
||||
if (const auto& args{ actionAndArgs.Args() })
|
||||
{
|
||||
// Args are defined, so hash them
|
||||
hashedArgs = gsl::narrow_cast<size_t>(args.Hash());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::hash<IActionArgs> argsHash;
|
||||
hashedArgs = argsHash(nullptr);
|
||||
// Args are not defined.
|
||||
// Check if the ShortcutAction supports args.
|
||||
switch (actionAndArgs.Action())
|
||||
{
|
||||
#define ON_ALL_ACTIONS_WITH_ARGS(action) \
|
||||
case ShortcutAction::action: \
|
||||
/* If it does, hash the default values for the args.*/ \
|
||||
hashedArgs = EmptyHash<implementation::action##Args>(); \
|
||||
break;
|
||||
ALL_SHORTCUT_ACTIONS_WITH_ARGS
|
||||
#undef ON_ALL_ACTIONS_WITH_ARGS
|
||||
default:
|
||||
{
|
||||
// Otherwise, hash nullptr.
|
||||
std::hash<IActionArgs> argsHash;
|
||||
hashedArgs = argsHash(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return hashedAction ^ hashedArgs;
|
||||
}
|
||||
|
||||
ActionMap::ActionMap() :
|
||||
_NestedCommands{ single_threaded_map<hstring, Model::Command>() }
|
||||
_NestedCommands{ single_threaded_map<hstring, Model::Command>() },
|
||||
_IterableCommands{ single_threaded_vector<Model::Command>() }
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -87,7 +106,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
{
|
||||
// populate _NameMapCache
|
||||
std::unordered_map<hstring, Model::Command> nameMap{};
|
||||
_PopulateNameMapWithNestedCommands(nameMap);
|
||||
_PopulateNameMapWithSpecialCommands(nameMap);
|
||||
_PopulateNameMapWithStandardCommands(nameMap);
|
||||
|
||||
_NameMapCache = single_threaded_map<hstring, Model::Command>(std::move(nameMap));
|
||||
|
@ -96,18 +115,19 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
}
|
||||
|
||||
// Method Description:
|
||||
// - Populates the provided nameMap with all of our nested commands and our parents nested commands
|
||||
// - Performs a top-down approach by going to the root first, then recursively adding the nested commands layer-by-layer
|
||||
// - Populates the provided nameMap with all of our special commands and our parent's special commands.
|
||||
// - Special commands include nested and iterable commands.
|
||||
// - Performs a top-down approach by going to the root first, then recursively adding the nested commands layer-by-layer.
|
||||
// Arguments:
|
||||
// - nameMap: the nameMap we're populating. This maps the name (hstring) of a command to the command itself.
|
||||
void ActionMap::_PopulateNameMapWithNestedCommands(std::unordered_map<hstring, Model::Command>& nameMap) const
|
||||
void ActionMap::_PopulateNameMapWithSpecialCommands(std::unordered_map<hstring, Model::Command>& nameMap) const
|
||||
{
|
||||
// Update NameMap with our parents.
|
||||
// Starting with this means we're doing a top-down approach.
|
||||
FAIL_FAST_IF(_parents.size() > 1);
|
||||
for (const auto& parent : _parents)
|
||||
{
|
||||
parent->_PopulateNameMapWithNestedCommands(nameMap);
|
||||
parent->_PopulateNameMapWithSpecialCommands(nameMap);
|
||||
}
|
||||
|
||||
// Add NestedCommands to NameMap _after_ we handle our parents.
|
||||
|
@ -125,6 +145,12 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
nameMap.erase(name);
|
||||
}
|
||||
}
|
||||
|
||||
// Add IterableCommands to NameMap
|
||||
for (const auto& cmd : _IterableCommands)
|
||||
{
|
||||
nameMap.insert_or_assign(cmd.Name(), cmd);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
@ -291,6 +317,12 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
actionMap->_NestedCommands.Insert(name, *(get_self<Command>(cmd)->Copy()));
|
||||
}
|
||||
|
||||
// copy _IterableCommands
|
||||
for (const auto& cmd : _IterableCommands)
|
||||
{
|
||||
actionMap->_IterableCommands.Append(*(get_self<Command>(cmd)->Copy()));
|
||||
}
|
||||
|
||||
// repeat this for each of our parents
|
||||
FAIL_FAST_IF(_parents.size() > 1);
|
||||
for (const auto& parent : _parents)
|
||||
|
@ -331,6 +363,13 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
return;
|
||||
}
|
||||
|
||||
// Handle iterable commands
|
||||
if (cmdImpl->IterateOn() != ExpandCommandType::None)
|
||||
{
|
||||
_IterableCommands.Append(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
// General Case:
|
||||
// Add the new command to the KeyMap.
|
||||
// This map directs you to an entry in the ActionMap.
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
std::optional<Model::Command> _GetActionByID(const InternalActionID actionID) const;
|
||||
std::optional<Model::Command> _GetActionByKeyChordInternal(Control::KeyChord const& keys) const;
|
||||
|
||||
void _PopulateNameMapWithNestedCommands(std::unordered_map<hstring, Model::Command>& nameMap) const;
|
||||
void _PopulateNameMapWithSpecialCommands(std::unordered_map<hstring, Model::Command>& nameMap) const;
|
||||
void _PopulateNameMapWithStandardCommands(std::unordered_map<hstring, Model::Command>& nameMap) const;
|
||||
void _PopulateKeyBindingMapWithStandardCommands(std::unordered_map<Control::KeyChord, Model::Command, KeyChordHash, KeyChordEquality>& keyBindingsMap, std::unordered_set<Control::KeyChord, KeyChordHash, KeyChordEquality>& unboundKeys) const;
|
||||
std::vector<Model::Command> _GetCumulativeActions() const noexcept;
|
||||
|
@ -94,6 +94,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
Windows::Foundation::Collections::IMap<Control::KeyChord, Model::Command> _GlobalHotkeysCache{ nullptr };
|
||||
Windows::Foundation::Collections::IMap<Control::KeyChord, Model::Command> _KeyBindingMapCache{ nullptr };
|
||||
Windows::Foundation::Collections::IMap<hstring, Model::Command> _NestedCommands{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<Model::Command> _IterableCommands{ nullptr };
|
||||
std::unordered_map<Control::KeyChord, InternalActionID, KeyChordHash, KeyChordEquality> _KeyMap;
|
||||
std::unordered_map<InternalActionID, Model::Command> _ActionMap;
|
||||
|
||||
|
|
|
@ -60,34 +60,40 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
{
|
||||
Json::Value actionList{ Json::ValueType::arrayValue };
|
||||
|
||||
// Serialize all standard Command objects in the current layer
|
||||
for (const auto& [_, cmd] : _ActionMap)
|
||||
{
|
||||
// Command serializes to an array of JSON objects.
|
||||
// This is because a Command may have multiple key chords associated with it.
|
||||
// The name and icon are only serialized in the first object.
|
||||
// Example:
|
||||
// { "name": "Custom Copy", "command": "copy", "keys": "ctrl+c" }
|
||||
// { "command": "copy", "keys": "ctrl+shift+c" }
|
||||
// { "command": "copy", "keys": "ctrl+ins" }
|
||||
// Command serializes to an array of JSON objects.
|
||||
// This is because a Command may have multiple key chords associated with it.
|
||||
// The name and icon are only serialized in the first object.
|
||||
// Example:
|
||||
// { "name": "Custom Copy", "command": "copy", "keys": "ctrl+c" }
|
||||
// { "command": "copy", "keys": "ctrl+shift+c" }
|
||||
// { "command": "copy", "keys": "ctrl+ins" }
|
||||
auto toJson = [&actionList](const Model::Command& cmd) {
|
||||
const auto cmdImpl{ winrt::get_self<implementation::Command>(cmd) };
|
||||
const auto& cmdJsonArray{ cmdImpl->ToJson() };
|
||||
for (const auto& cmdJson : cmdJsonArray)
|
||||
{
|
||||
actionList.append(cmdJson);
|
||||
}
|
||||
};
|
||||
|
||||
// Serialize all standard Command objects in the current layer
|
||||
for (const auto& [_, cmd] : _ActionMap)
|
||||
{
|
||||
toJson(cmd);
|
||||
}
|
||||
|
||||
// Serialize all nested Command objects added in the current layer
|
||||
for (const auto& [_, cmd] : _NestedCommands)
|
||||
{
|
||||
const auto cmdImpl{ winrt::get_self<implementation::Command>(cmd) };
|
||||
const auto& cmdJsonArray{ cmdImpl->ToJson() };
|
||||
for (const auto& cmdJson : cmdJsonArray)
|
||||
{
|
||||
actionList.append(cmdJson);
|
||||
}
|
||||
toJson(cmd);
|
||||
}
|
||||
|
||||
// Serialize all iterable Command objects added in the current layer
|
||||
for (const auto& cmd : _IterableCommands)
|
||||
{
|
||||
toJson(cmd);
|
||||
}
|
||||
|
||||
return actionList;
|
||||
}
|
||||
|
||||
|
|
|
@ -545,14 +545,20 @@ void CascadiaSettings::_ParseAndLayerFragmentFiles(const std::unordered_set<std:
|
|||
auto matchingProfile = _FindMatchingProfile(profileStub);
|
||||
if (matchingProfile)
|
||||
{
|
||||
// We found a matching profile, create a child of it and put the modifications there
|
||||
// (we add a new inheritance layer)
|
||||
auto childImpl{ matchingProfile->CreateChild() };
|
||||
childImpl->LayerJson(profileStub);
|
||||
childImpl->Origin(OriginTag::Fragment);
|
||||
try
|
||||
{
|
||||
// We found a matching profile, create a child of it and put the modifications there
|
||||
// (we add a new inheritance layer)
|
||||
auto childImpl{ matchingProfile->CreateChild() };
|
||||
childImpl->LayerJson(profileStub);
|
||||
childImpl->Origin(OriginTag::Fragment);
|
||||
|
||||
// replace parent in _profiles with child
|
||||
_allProfiles.SetAt(_FindMatchingProfileIndex(matchingProfile->ToJson()).value(), *childImpl);
|
||||
// replace parent in _profiles with child
|
||||
_allProfiles.SetAt(_FindMatchingProfileIndex(matchingProfile->ToJson()).value(), *childImpl);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -561,13 +567,19 @@ void CascadiaSettings::_ParseAndLayerFragmentFiles(const std::unordered_set<std:
|
|||
// (it must have at least a name)
|
||||
if (profileStub.isMember(JsonKey(NameKey)))
|
||||
{
|
||||
auto newProfile = Profile::FromJson(profileStub);
|
||||
// Make sure to give the new profile a source, then we add it to our list of profiles
|
||||
// We don't make modifications to the user's settings file yet, that will happen when
|
||||
// _AppendDynamicProfilesToUserSettings() is called later
|
||||
newProfile->Source(source);
|
||||
newProfile->Origin(OriginTag::Fragment);
|
||||
_allProfiles.Append(*newProfile);
|
||||
try
|
||||
{
|
||||
auto newProfile = Profile::FromJson(profileStub);
|
||||
// Make sure to give the new profile a source, then we add it to our list of profiles
|
||||
// We don't make modifications to the user's settings file yet, that will happen when
|
||||
// _AppendDynamicProfilesToUserSettings() is called later
|
||||
newProfile->Source(source);
|
||||
newProfile->Origin(OriginTag::Fragment);
|
||||
_allProfiles.Append(*newProfile);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -394,10 +394,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
{
|
||||
Json::Value cmdList{ Json::ValueType::arrayValue };
|
||||
|
||||
if (_nestedCommand)
|
||||
if (_nestedCommand || _IterateOn != ExpandCommandType::None)
|
||||
{
|
||||
// handle nested command
|
||||
// For nested commands, we can trust _originalJson to be correct.
|
||||
// handle special commands
|
||||
// For these, we can trust _originalJson to be correct.
|
||||
// In fact, we _need_ to use it here because we don't actually deserialize `iterateOn`
|
||||
// until we expand the command.
|
||||
cmdList.append(_originalJson);
|
||||
|
|
|
@ -11,7 +11,7 @@ using namespace winrt::Microsoft::Terminal::Settings;
|
|||
using namespace winrt::Microsoft::Terminal::Settings::Model::implementation;
|
||||
|
||||
winrt::Windows::Foundation::Collections::IVector<Model::DefaultTerminal> DefaultTerminal::_available = winrt::single_threaded_vector<Model::DefaultTerminal>();
|
||||
std::optional<Model::DefaultTerminal> DefaultTerminal::_current;
|
||||
Model::DefaultTerminal DefaultTerminal::_current = nullptr;
|
||||
|
||||
DefaultTerminal::DefaultTerminal(DelegationConfig::DelegationPackage pkg) :
|
||||
_pkg(pkg)
|
||||
|
@ -81,7 +81,10 @@ Model::DefaultTerminal DefaultTerminal::Current()
|
|||
{
|
||||
Refresh();
|
||||
}
|
||||
return _current.value();
|
||||
|
||||
// The potential of returning nullptr feels weird, but XAML can handle that appropriately
|
||||
// and will select nothing as current in the dropdown.
|
||||
return _current;
|
||||
}
|
||||
|
||||
void DefaultTerminal::Current(const Model::DefaultTerminal& term)
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||
private:
|
||||
DelegationConfig::DelegationPackage _pkg;
|
||||
static Windows::Foundation::Collections::IVector<Model::DefaultTerminal> _available;
|
||||
static std::optional<Model::DefaultTerminal> _current;
|
||||
static Model::DefaultTerminal _current;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="ScopedResourceLoader.h" />
|
||||
<ClInclude Include="inc\LibraryResources.h" />
|
||||
<ClInclude Include="inc\ThrottledFunc.h" />
|
||||
<ClInclude Include="inc\Utils.h" />
|
||||
<ClInclude Include="inc\WtExeUtils.h" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="ScopedResourceLoader.h" />
|
||||
<ClInclude Include="inc\LibraryResources.h" />
|
||||
<ClInclude Include="inc\ThrottledFunc.h" />
|
||||
<ClInclude Include="inc\Utils.h" />
|
||||
<ClInclude Include="inc\WtExeUtils.h" />
|
||||
</ItemGroup>
|
||||
|
|
141
src/cascadia/WinRTUtils/inc/ThrottledFunc.h
Normal file
141
src/cascadia/WinRTUtils/inc/ThrottledFunc.h
Normal file
|
@ -0,0 +1,141 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "til/throttled_func.h"
|
||||
|
||||
// ThrottledFunc is a copy of til::throttled_func,
|
||||
// specialized for the use with a WinRT Dispatcher.
|
||||
template<bool leading, typename... Args>
|
||||
class ThrottledFunc : public std::enable_shared_from_this<ThrottledFunc<leading, Args...>>
|
||||
{
|
||||
public:
|
||||
using filetime_duration = std::chrono::duration<int64_t, std::ratio<1, 10000000>>;
|
||||
using function = std::function<void(Args...)>;
|
||||
|
||||
// Throttles invocations to the given `func` to not occur more often than `delay`.
|
||||
//
|
||||
// If this is a:
|
||||
// * ThrottledFuncLeading: `func` will be invoked immediately and
|
||||
// further invocations prevented until `delay` time has passed.
|
||||
// * ThrottledFuncTrailing: On the first invocation a timer of `delay` time will
|
||||
// be started. After the timer has expired `func` will be invoked just once.
|
||||
//
|
||||
// After `func` was invoked the state is reset and this cycle is repeated again.
|
||||
ThrottledFunc(
|
||||
winrt::Windows::UI::Core::CoreDispatcher dispatcher,
|
||||
filetime_duration delay,
|
||||
function func) :
|
||||
_dispatcher{ std::move(dispatcher) },
|
||||
_func{ std::move(func) },
|
||||
_timer{ _create_timer() }
|
||||
{
|
||||
const auto d = -delay.count();
|
||||
if (d >= 0)
|
||||
{
|
||||
throw std::invalid_argument("non-positive delay specified");
|
||||
}
|
||||
|
||||
memcpy(&_delay, &d, sizeof(d));
|
||||
}
|
||||
|
||||
// ThrottledFunc uses its `this` pointer when creating _timer.
|
||||
// Since the timer cannot be recreated, instances cannot be moved either.
|
||||
ThrottledFunc(const ThrottledFunc&) = delete;
|
||||
ThrottledFunc& operator=(const ThrottledFunc&) = delete;
|
||||
ThrottledFunc(ThrottledFunc&&) = delete;
|
||||
ThrottledFunc& operator=(ThrottledFunc&&) = delete;
|
||||
|
||||
// Throttles the invocation of the function passed to the constructor.
|
||||
// If this is a trailing_throttled_func:
|
||||
// If you call this function again before the underlying
|
||||
// timer has expired, the new arguments will be used.
|
||||
template<typename... MakeArgs>
|
||||
void Run(MakeArgs&&... args)
|
||||
{
|
||||
if (!_storage.emplace(std::forward<MakeArgs>(args)...))
|
||||
{
|
||||
_leading_edge();
|
||||
}
|
||||
}
|
||||
|
||||
// Modifies the pending arguments for the next function
|
||||
// invocation, if there is one pending currently.
|
||||
//
|
||||
// `func` will be invoked as func(Args...). Make sure to bind any
|
||||
// arguments in `func` by reference if you'd like to modify them.
|
||||
template<typename F>
|
||||
void ModifyPending(F func)
|
||||
{
|
||||
_storage.modify_pending(func);
|
||||
}
|
||||
|
||||
private:
|
||||
static void __stdcall _timer_callback(PTP_CALLBACK_INSTANCE /*instance*/, PVOID context, PTP_TIMER /*timer*/) noexcept
|
||||
{
|
||||
static_cast<ThrottledFunc*>(context)->_trailing_edge();
|
||||
}
|
||||
|
||||
void _leading_edge()
|
||||
{
|
||||
if constexpr (leading)
|
||||
{
|
||||
_dispatcher.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [weakSelf = this->weak_from_this()]() {
|
||||
if (auto self{ weakSelf.lock() })
|
||||
{
|
||||
try
|
||||
{
|
||||
self->_func();
|
||||
}
|
||||
CATCH_LOG();
|
||||
|
||||
SetThreadpoolTimerEx(self->_timer.get(), &self->_delay, 0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
SetThreadpoolTimerEx(_timer.get(), &_delay, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void _trailing_edge()
|
||||
{
|
||||
if constexpr (leading)
|
||||
{
|
||||
_storage.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
_dispatcher.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [weakSelf = this->weak_from_this()]() {
|
||||
if (auto self{ weakSelf.lock() })
|
||||
{
|
||||
try
|
||||
{
|
||||
std::apply(self->_func, self->_storage.take());
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
inline wil::unique_threadpool_timer _create_timer()
|
||||
{
|
||||
wil::unique_threadpool_timer timer{ CreateThreadpoolTimer(&_timer_callback, this, nullptr) };
|
||||
THROW_LAST_ERROR_IF(!timer);
|
||||
return timer;
|
||||
}
|
||||
|
||||
FILETIME _delay;
|
||||
winrt::Windows::UI::Core::CoreDispatcher _dispatcher;
|
||||
function _func;
|
||||
|
||||
wil::unique_threadpool_timer _timer;
|
||||
til::details::throttled_func_storage<Args...> _storage;
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
using ThrottledFuncTrailing = ThrottledFunc<false, Args...>;
|
||||
using ThrottledFuncLeading = ThrottledFunc<true>;
|
|
@ -266,6 +266,7 @@ void AppHost::Initialize()
|
|||
_logic.RenameWindowRequested({ this, &AppHost::_RenameWindowRequested });
|
||||
_logic.SettingsChanged({ this, &AppHost::_HandleSettingsChanged });
|
||||
_logic.IsQuakeWindowChanged({ this, &AppHost::_IsQuakeWindowChanged });
|
||||
_logic.SummonWindowRequested({ this, &AppHost::_SummonWindowRequested });
|
||||
|
||||
_window->UpdateTitle(_logic.Title());
|
||||
|
||||
|
@ -586,16 +587,17 @@ bool AppHost::HasWindow()
|
|||
// - args: the bundle of a commandline and working directory to use for this invocation.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void AppHost::_DispatchCommandline(winrt::Windows::Foundation::IInspectable /*sender*/,
|
||||
void AppHost::_DispatchCommandline(winrt::Windows::Foundation::IInspectable sender,
|
||||
Remoting::CommandlineArgs args)
|
||||
{
|
||||
const Remoting::SummonWindowBehavior summonArgs{};
|
||||
summonArgs.MoveToCurrentDesktop(false);
|
||||
summonArgs.DropdownDuration(0);
|
||||
summonArgs.ToMonitor(Remoting::MonitorBehavior::InPlace);
|
||||
summonArgs.ToggleVisibility(false); // Do not toggle, just make visible.
|
||||
// Summon the window whenever we dispatch a commandline to it. This will
|
||||
// make it obvious when a new tab/pane is created in a window.
|
||||
_window->SummonWindow(summonArgs);
|
||||
_HandleSummon(sender, summonArgs);
|
||||
_logic.ExecuteCommandline(args.Commandline(), args.CurrentDirectory());
|
||||
}
|
||||
|
||||
|
@ -925,3 +927,15 @@ void AppHost::_IsQuakeWindowChanged(const winrt::Windows::Foundation::IInspectab
|
|||
{
|
||||
_window->IsQuakeWindow(_logic.IsQuakeWindow());
|
||||
}
|
||||
|
||||
void AppHost::_SummonWindowRequested(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Windows::Foundation::IInspectable&)
|
||||
|
||||
{
|
||||
const Remoting::SummonWindowBehavior summonArgs{};
|
||||
summonArgs.MoveToCurrentDesktop(false);
|
||||
summonArgs.DropdownDuration(0);
|
||||
summonArgs.ToMonitor(Remoting::MonitorBehavior::InPlace);
|
||||
summonArgs.ToggleVisibility(false); // Do not toggle, just make visible.
|
||||
_HandleSummon(sender, summonArgs);
|
||||
}
|
||||
|
|
|
@ -82,4 +82,7 @@ private:
|
|||
|
||||
void _IsQuakeWindowChanged(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Windows::Foundation::IInspectable& args);
|
||||
|
||||
void _SummonWindowRequested(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Windows::Foundation::IInspectable& args);
|
||||
};
|
||||
|
|
|
@ -1023,7 +1023,15 @@ winrt::fire_and_forget IslandWindow::SummonWindow(Remoting::SummonWindowBehavior
|
|||
{
|
||||
// On the foreground thread:
|
||||
co_await winrt::resume_foreground(_rootGrid.Dispatcher());
|
||||
_summonWindowRoutineBody(args);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - As above.
|
||||
// BODGY: ARM64 BUILD FAILED WITH fatal error C1001: Internal compiler error
|
||||
// when this was part of the coroutine body.
|
||||
void IslandWindow::_summonWindowRoutineBody(Remoting::SummonWindowBehavior args)
|
||||
{
|
||||
uint32_t actualDropdownDuration = args.DropdownDuration();
|
||||
// If the user requested an animation, let's check if animations are enabled in the OS.
|
||||
if (args.DropdownDuration() > 0)
|
||||
|
|
|
@ -111,6 +111,8 @@ protected:
|
|||
bool _isQuakeWindow{ false };
|
||||
void _enterQuakeMode();
|
||||
|
||||
void _summonWindowRoutineBody(winrt::Microsoft::Terminal::Remoting::SummonWindowBehavior args);
|
||||
|
||||
private:
|
||||
// This minimum width allows for width the tabs fit
|
||||
static constexpr long minimumWidth = 460L;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CA5CAD1A-1754-4A9D-93D7-857A9D17CB1B}</ProjectGuid>
|
||||
|
@ -111,15 +111,15 @@
|
|||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets'))" />
|
||||
</Target>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.2" targetFramework="native" />
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
||||
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.Windows.Terminal.ThemeHelpers" version="0.3.210521003" targetFramework="native" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" />
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
|
@ -88,15 +88,15 @@
|
|||
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.2" targetFramework="native" />
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
|
||||
</packages>
|
|
@ -96,6 +96,8 @@ namespace WpfTerminalTestNetCore
|
|||
{
|
||||
DefaultBackground = 0x0c0c0c,
|
||||
DefaultForeground = 0xcccccc,
|
||||
DefaultSelectionBackground = 0xcccccc,
|
||||
SelectionBackgroundAlpha = 0.5f,
|
||||
CursorStyle = CursorStyle.BlinkingBar,
|
||||
// This is Campbell.
|
||||
ColorTable = new uint[] { 0x0C0C0C, 0x1F0FC5, 0x0EA113, 0x009CC1, 0xDA3700, 0x981788, 0xDD963A, 0xCCCCCC, 0x767676, 0x5648E7, 0x0CC616, 0xA5F1F9, 0xFF783B, 0x9E00B4, 0xD6D661, 0xF2F2F2 },
|
||||
|
|
|
@ -64,4 +64,21 @@
|
|||
<Touch Files="@(_PCHFileToCleanWithTimestamp)" Time="%(LastWriteTime)" AlwaysCreate="true" />
|
||||
<Message Text="PCH and Precomp object @(_PCHFileToCleanWithTimestamp) has been deleted for $(ProjectName)." />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuildDependsOn>
|
||||
OCCallFeatureFlagGenerator;
|
||||
$(BuildDependsOn)
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="OCCallFeatureFlagGenerator">
|
||||
<MSBuild Projects="$(SolutionDir)\build\rules\GenerateFeatureFlags.proj" />
|
||||
</Target>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<ForcedIncludeFiles>$(SolutionDir)\bin\$(Configuration)\inc\TilFeatureStaging.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
|
|
10
src/features.xml
Normal file
10
src/features.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<featureStaging xmlns="http://microsoft.com/TilFeatureStaging-Schema.xsd">
|
||||
<!-- See doc/feature_flags.md for more info. -->
|
||||
<feature>
|
||||
<name>Feature_EditableActionsPage</name>
|
||||
<description>The Actions page in the settings UI should allow users to edit actions.</description>
|
||||
<stage>AlwaysEnabled</stage>
|
||||
<alwaysDisabledReleaseTokens/>
|
||||
</feature>
|
||||
</featureStaging>
|
|
@ -70,7 +70,7 @@ void CursorBlinker::TimerRoutine(SCREEN_INFORMATION& ScreenInfo)
|
|||
auto& buffer = ScreenInfo.GetTextBuffer();
|
||||
auto& cursor = buffer.GetCursor();
|
||||
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
auto* const _pAccessibilityNotifier = ServiceLocator::LocateAccessibilityNotifier();
|
||||
auto* const pAccessibilityNotifier = ServiceLocator::LocateAccessibilityNotifier();
|
||||
|
||||
if (!WI_IsFlagSet(gci.Flags, CONSOLE_HAS_FOCUS))
|
||||
{
|
||||
|
@ -78,7 +78,8 @@ void CursorBlinker::TimerRoutine(SCREEN_INFORMATION& ScreenInfo)
|
|||
}
|
||||
|
||||
// Update the cursor pos in USER so accessibility will work.
|
||||
if (cursor.HasMoved())
|
||||
// Don't do all this work or send events if we don't have a notifier target.
|
||||
if (pAccessibilityNotifier && cursor.HasMoved())
|
||||
{
|
||||
// Convert the buffer position to the equivalent screen coordinates
|
||||
// required by the notifier, taking line rendition into account.
|
||||
|
@ -93,7 +94,7 @@ void CursorBlinker::TimerRoutine(SCREEN_INFORMATION& ScreenInfo)
|
|||
rc.right = rc.left + fontSize.X;
|
||||
rc.bottom = rc.top + fontSize.Y;
|
||||
|
||||
_pAccessibilityNotifier->NotifyConsoleCaretEvent(rc);
|
||||
pAccessibilityNotifier->NotifyConsoleCaretEvent(rc);
|
||||
|
||||
// Send accessibility information
|
||||
{
|
||||
|
@ -109,7 +110,7 @@ void CursorBlinker::TimerRoutine(SCREEN_INFORMATION& ScreenInfo)
|
|||
flags = IAccessibilityNotifier::ConsoleCaretEventFlags::CaretVisible;
|
||||
}
|
||||
|
||||
_pAccessibilityNotifier->NotifyConsoleCaretEvent(flags, MAKELONG(position.X, position.Y));
|
||||
pAccessibilityNotifier->NotifyConsoleCaretEvent(flags, MAKELONG(position.X, position.Y));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -224,10 +224,13 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
|||
|
||||
cellsModified = done.GetCellDistance(it);
|
||||
|
||||
// Notify accessibility
|
||||
auto endingCoordinate = startingCoordinate;
|
||||
bufferSize.MoveInBounds(cellsModified, endingCoordinate);
|
||||
screenBuffer.NotifyAccessibilityEventing(startingCoordinate.X, startingCoordinate.Y, endingCoordinate.X, endingCoordinate.Y);
|
||||
if (screenBuffer.HasAccessibilityEventing())
|
||||
{
|
||||
// Notify accessibility
|
||||
auto endingCoordinate = startingCoordinate;
|
||||
bufferSize.MoveInBounds(cellsModified, endingCoordinate);
|
||||
screenBuffer.NotifyAccessibilityEventing(startingCoordinate.X, startingCoordinate.Y, endingCoordinate.X, endingCoordinate.Y);
|
||||
}
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
|
@ -284,9 +287,12 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
|||
cellsModified = done.GetInputDistance(it);
|
||||
|
||||
// Notify accessibility
|
||||
auto endingCoordinate = startingCoordinate;
|
||||
bufferSize.MoveInBounds(cellsModified, endingCoordinate);
|
||||
screenInfo.NotifyAccessibilityEventing(startingCoordinate.X, startingCoordinate.Y, endingCoordinate.X, endingCoordinate.Y);
|
||||
if (screenInfo.HasAccessibilityEventing())
|
||||
{
|
||||
auto endingCoordinate = startingCoordinate;
|
||||
bufferSize.MoveInBounds(cellsModified, endingCoordinate);
|
||||
screenInfo.NotifyAccessibilityEventing(startingCoordinate.X, startingCoordinate.Y, endingCoordinate.X, endingCoordinate.Y);
|
||||
}
|
||||
|
||||
// GH#3126 - This is a shim for powershell's `Clear-Host` function. In
|
||||
// the vintage console, `Clear-Host` is supposed to clear the entire
|
||||
|
|
|
@ -557,7 +557,10 @@ constexpr unsigned int LOCAL_BUFFER_SIZE = 100;
|
|||
const auto itEnd = screenInfo.Write(it);
|
||||
|
||||
// Notify accessibility
|
||||
screenInfo.NotifyAccessibilityEventing(CursorPosition.X, CursorPosition.Y, CursorPosition.X + gsl::narrow<SHORT>(i - 1), CursorPosition.Y);
|
||||
if (screenInfo.HasAccessibilityEventing())
|
||||
{
|
||||
screenInfo.NotifyAccessibilityEventing(CursorPosition.X, CursorPosition.Y, CursorPosition.X + gsl::narrow<SHORT>(i - 1), CursorPosition.Y);
|
||||
}
|
||||
|
||||
// The number of "spaces" or "cells" we have consumed needs to be reported and stored for later
|
||||
// when/if we need to erase the command line.
|
||||
|
|
|
@ -376,7 +376,10 @@ std::vector<OutputCell>::const_iterator ConsoleImeInfo::_WriteConversionArea(con
|
|||
area.Paint();
|
||||
|
||||
// Notify accessibility that we have updated the text in this display region within the viewport.
|
||||
screenInfo.NotifyAccessibilityEventing(insertionPos.X, insertionPos.Y, gsl::narrow<SHORT>(insertionPos.X + lineVec.size() - 1), insertionPos.Y);
|
||||
if (screenInfo.HasAccessibilityEventing())
|
||||
{
|
||||
screenInfo.NotifyAccessibilityEventing(insertionPos.X, insertionPos.Y, gsl::narrow<SHORT>(insertionPos.X + lineVec.size() - 1), insertionPos.Y);
|
||||
}
|
||||
|
||||
// Hand back the iterator representing the end of what we used to be fed into the beginning of the next call.
|
||||
return lineEnd;
|
||||
|
|
|
@ -2210,10 +2210,14 @@ void DoSrvPrivateMoveToBottom(SCREEN_INFORMATION& screenInfo)
|
|||
screenInfo.Write(fillData, startPosition, false);
|
||||
|
||||
// Notify accessibility
|
||||
auto endPosition = startPosition;
|
||||
const auto bufferSize = screenInfo.GetBufferSize();
|
||||
bufferSize.MoveInBounds(fillLength - 1, endPosition);
|
||||
screenInfo.NotifyAccessibilityEventing(startPosition.X, startPosition.Y, endPosition.X, endPosition.Y);
|
||||
if (screenInfo.HasAccessibilityEventing())
|
||||
{
|
||||
auto endPosition = startPosition;
|
||||
const auto bufferSize = screenInfo.GetBufferSize();
|
||||
bufferSize.MoveInBounds(fillLength - 1, endPosition);
|
||||
screenInfo.NotifyAccessibilityEventing(startPosition.X, startPosition.Y, endPosition.X, endPosition.Y);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue