Compare commits

..

10 Commits

Author SHA1 Message Date
Dustin L. Howett
dedbffe84d more horrors from beyond the edge of the universe 2024-03-12 15:48:05 -05:00
Dustin L. Howett
5aa26349fa remove ARM build configs 2024-03-12 14:09:54 -05:00
Dustin L. Howett
2dbc5f09b5 Merge remote-tracking branch 'origin/main' into dev/duhowett/interface-projects 2024-03-12 14:09:25 -05:00
Dustin L. Howett
7ba92193a9 Merge remote-tracking branch 'origin/main' into dev/duhowett/interface-projects 2024-02-19 13:36:39 -06:00
Dustin L. Howett
6524eb7012 Merge remote-tracking branch 'origin/main' into dev/duhowett/interface-projects 2023-11-01 22:15:23 -05:00
Dustin L. Howett
22a304454b Merge remote-tracking branch 'origin/main' into dev/duhowett/interface-projects 2023-08-20 23:17:37 -05:00
Dustin L. Howett
ce907ce4cd Merge remote-tracking branch 'origin/main' into dev/duhowett/interface-projects 2023-04-02 14:23:04 -05:00
Dustin Howett
2eb4b2876c Move M.T.Core's *interfaces* to a separate project 2023-02-10 14:00:24 -06:00
Dustin Howett
0420bb21e6 Move M.T.TerminalConnection's *interfaces* to a separate project
This leverages Microsoft.Windows.MidlRT to have a project that only
produces a .winmd file, plus a custom MSBuild target that allows for the
TerminalConnection *DLL* project to statically "link" and re-emit the
interface WinMD as its own.
2023-02-10 13:57:46 -06:00
Dustin Howett
8594e9d751 nuget: add M.W.MidlRT, governed by TerminalMidlRT 2023-02-09 17:05:20 -06:00
582 changed files with 27969 additions and 28935 deletions

View File

@@ -80,7 +80,6 @@ mnt
mru
nje
noreply
notwrapped
ogonek
ok'd
overlined

View File

@@ -1,8 +1,6 @@
ACLs
ADMINS
advapi
akv
AKV
altform
altforms
appendwttlogging
@@ -16,7 +14,6 @@ autoexec
backplating
bitmaps
BOMs
checkcflags
COMPUTERNAME
CPLs
cpptools
@@ -35,7 +32,6 @@ DWINRT
enablewttlogging
HOMESHARE
Intelli
issecret
IVisual
libucrt
libucrtd
@@ -78,7 +74,6 @@ sid
Skype
SRW
sxs
symbolrequestprod
Sysinternals
sysnative
systemroot
@@ -104,4 +99,3 @@ wtl
wtt
wttlog
Xamarin
xfgcheck

View File

@@ -1,3 +1,4 @@
AAAa
AAAAA
AAAAAAAAAAAAA
AAAAAABBBBBBCCC

View File

@@ -1,4 +1,3 @@
aaaaabbb
aabbcc
ABANDONFONT
abbcc
@@ -10,7 +9,6 @@ ACCESSTOKEN
acidev
ACIOSS
ACover
acp
actctx
ACTCTXW
ADDALIAS
@@ -68,10 +66,10 @@ ASBSET
asdfghjkl
ASetting
ASingle
ASYNCDONTCARE
ASYNCWINDOWPOS
atch
ATest
ATTRCOLOR
aumid
Authenticode
AUTOBUDDY
@@ -93,9 +91,8 @@ backgrounding
backported
backstory
barbaz
Batang
Bazz
bbb
bbccb
BBDM
bbwe
bcount
@@ -125,6 +122,8 @@ Blt
BLUESCROLL
BODGY
BOLDFONT
BOOLIFY
bools
Borland
boutput
boxheader
@@ -155,6 +154,7 @@ cazamor
CBash
cbiex
CBN
CBoolean
cbt
CCCBB
cch
@@ -162,9 +162,12 @@ CCHAR
CCmd
ccolor
CCom
CComp
CConsole
CConversion
CCRT
cdd
CEdit
CELLSIZE
cfae
cfie
@@ -174,17 +177,19 @@ CFuzz
cgscrn
chafa
changelists
chaof
charinfo
CHARSETINFO
chcbpat
chh
chshdng
CHT
Cic
CLASSSTRING
CLE
cleartype
CLICKACTIVE
clickdown
CLIENTID
clipbrd
CLIPCHILDREN
CLIPSIBLINGS
@@ -193,6 +198,7 @@ cloudconsole
cloudvault
CLSCTX
clsids
CLUSTERMAP
cmatrix
cmder
CMDEXT
@@ -208,6 +214,7 @@ codepages
codepath
coinit
colorizing
COLORMATRIX
COLORREFs
colorschemes
colorspec
@@ -215,6 +222,7 @@ colortable
colortbl
colortest
colortool
COLR
combaseapi
comctl
commandline
@@ -223,6 +231,7 @@ commdlg
COMMITID
componentization
conapi
conareainfo
conattrs
conbufferout
concfg
@@ -233,7 +242,8 @@ condrv
conechokey
conemu
conhost
CONIME
conime
conimeinfo
conintegrity
conintegrityuwp
coninteractivitybase
@@ -245,7 +255,6 @@ CONKBD
conlibk
conmsgl
CONNECTINFO
connyection
CONOUT
conprops
conpropsp
@@ -272,6 +281,7 @@ contentfiles
conterm
contsf
contypes
convarea
conwinuserrefs
coordnew
COPYCOLOR
@@ -306,6 +316,7 @@ csrutil
CSTYLE
CSwitch
CTerminal
CText
ctl
ctlseqs
CTRLEVENT
@@ -313,7 +324,7 @@ CTRLFREQUENCY
CTRLKEYSHORTCUTS
Ctrls
CTRLVOLUME
CUAS
Ctxt
CUF
cupxy
CURRENTFONT
@@ -356,9 +367,11 @@ DBGFONTS
DBGOUTPUT
dbh
dblclk
DBlob
DColor
DCOLORVALUE
dcommon
dcompile
dcompiler
DComposition
dde
@@ -466,6 +479,7 @@ depersist
deprioritized
deserializers
desktopwindowxamlsource
DESTINATIONNAME
devicecode
Dext
DFactory
@@ -477,6 +491,7 @@ DISABLEDELAYEDEXPANSION
DISABLENOSCROLL
DISPATCHNOTIFY
DISPLAYATTRIBUTE
DISPLAYATTRIBUTEPROPERTY
DISPLAYCHANGE
distros
dlg
@@ -524,6 +539,7 @@ DWORDs
dwrite
dxgi
dxgidwm
dxguid
dxinterop
dxsm
dxttbmp
@@ -552,6 +568,7 @@ entrypoints
ENU
ENUMLOGFONT
ENUMLOGFONTEX
enumranges
EOK
EPres
EQU
@@ -589,9 +606,8 @@ FECF
FEEF
fesb
FFAF
ffd
FFDE
FFFDb
FFrom
fgbg
FGCOLOR
FGHIJ
@@ -610,6 +626,7 @@ FINDDOWN
FINDSTRINGEXACT
FINDUP
FIter
FIXEDCONVERTED
FIXEDFILEINFO
Flg
flyouts
@@ -702,6 +719,7 @@ GETWAITTOKILLTIMEOUT
GETWHEELSCROLLCHARACTERS
GETWHEELSCROLLCHARS
GETWHEELSCROLLLINES
GFEh
Gfun
gfx
GGI
@@ -724,8 +742,9 @@ Greyscale
gridline
gset
gsl
GTP
guc
GUIDATOM
guidatom
GValue
GWL
GWLP
@@ -748,7 +767,6 @@ hdr
HDROP
hdrstop
HEIGHTSCROLL
hfind
hfont
hfontresource
hglobal
@@ -824,6 +842,7 @@ IEnd
IEnum
IFACEMETHODIMP
ification
IGNOREEND
IGNORELANGUAGE
IHosted
iid
@@ -847,6 +866,8 @@ inkscape
INLINEPREFIX
inproc
Inputkeyinfo
INPUTPROCESSORPROFILE
inputrc
Inputreadhandledata
INSERTMODE
INTERACTIVITYBASE
@@ -858,7 +879,9 @@ INVALIDARG
INVALIDATERECT
Ioctl
ipch
ipp
IProperty
IPSINK
ipsp
IShell
ISwap
@@ -878,12 +901,17 @@ JOBOBJECT
JOBOBJECTINFOCLASS
JPN
jsoncpp
Jsons
jsprovider
jumplist
KAttrs
kawa
Kazu
kazum
kcub
kcud
kcuf
kcuu
kernelbase
kernelbasestaging
KEYBDINPUT
@@ -895,6 +923,7 @@ Keymapping
keyscan
keystate
keyups
khome
KILLACTIVE
KILLFOCUS
kinda
@@ -907,7 +936,6 @@ KLMNOPQRSTY
KOK
KPRIORITY
KVM
kyouhaishaheiku
langid
LANGUAGELIST
lasterror
@@ -970,6 +998,7 @@ lpdw
lpelfe
lpfn
LPFNADDPROPSHEETPAGE
lpl
LPMEASUREITEMSTRUCT
LPMINMAXINFO
lpmsg
@@ -1032,6 +1061,7 @@ MBUTTON
MBUTTONDBLCLK
MBUTTONDOWN
MBUTTONUP
Mbxy
mdmerge
MDs
MEASUREITEM
@@ -1045,7 +1075,6 @@ MENUITEMINFO
MENUSELECT
messageext
metaproj
Mgrs
microsoftpublicsymbols
midl
mii
@@ -1057,6 +1086,7 @@ minkernel
MINMAXINFO
minwin
minwindef
Mip
MMBB
mmcc
MMCPL
@@ -1093,13 +1123,14 @@ msix
msrc
MSVCRTD
MTSM
Munged
munges
Munged
murmurhash
muxes
myapplet
mybranch
mydir
MYMAX
Mypair
Myval
NAMELENGTH
@@ -1142,8 +1173,6 @@ NOCONTEXTHELP
NOCOPYBITS
NODUP
noexcepts
NOFONT
NOHIDDENTEXT
NOINTEGRALHEIGHT
NOINTERFACE
NOLINKINFO
@@ -1167,7 +1196,6 @@ NORMALDISPLAY
NOSCRATCH
NOSEARCH
noselect
NOSELECTION
NOSENDCHANGING
NOSIZE
NOSNAPSHOT
@@ -1193,6 +1221,7 @@ ntdll
ntifs
ntlpcapi
ntm
nto
ntrtl
ntstatus
NTSYSCALLAPI
@@ -1258,7 +1287,6 @@ packageuwp
PACKAGEVERSIONNUMBER
PACKCOORD
PACKVERSION
pacp
pagedown
pageup
PAINTPARAMS
@@ -1269,7 +1297,9 @@ parentable
parms
PATCOPY
pathcch
Pathto
PATTERNID
pcat
pcb
pcch
PCCHAR
@@ -1293,9 +1323,9 @@ PCSTR
PCWCH
PCWCHAR
PCWSTR
pda
pdbs
pdbstr
pdcs
PDPs
pdtobj
pdw
@@ -1325,7 +1355,6 @@ PIDLIST
pids
pii
piml
pimpl
pinvoke
pipename
pipestr
@@ -1357,6 +1386,7 @@ POSXSCROLL
POSYSCROLL
PPEB
ppf
ppguid
ppidl
PPROC
ppropvar
@@ -1386,7 +1416,7 @@ PROCESSINFOCLASS
PRODEXT
PROPERTYID
PROPERTYKEY
propertyval
PROPERTYVAL
propsheet
PROPSHEETHEADER
PROPSHEETPAGE
@@ -1418,17 +1448,15 @@ ptch
ptsz
PTYIn
PUCHAR
pvar
pwch
PWDDMCONSOLECONTEXT
Pwease
pweview
pws
pwstr
pwsz
pythonw
Qaabbcc
QUERYOPEN
QUESTIONMARK
quickedit
QUZ
QWER
@@ -1461,6 +1489,8 @@ READCONSOLE
READCONSOLEOUTPUT
READCONSOLEOUTPUTSTRING
READMODE
reallocs
reamapping
rectread
redef
redefinable
@@ -1488,6 +1518,7 @@ repositorypath
Requiresx
rerasterize
rescap
Resequence
RESETCONTENT
resheader
resmimetype
@@ -1506,7 +1537,6 @@ rgn
rgp
rgpwsz
rgrc
rguid
rgw
RIGHTALIGN
RIGHTBUTTON
@@ -1514,7 +1544,6 @@ riid
RIS
roadmap
robomac
rodata
rosetta
RRF
rrr
@@ -1522,6 +1551,7 @@ RRRGGGBB
rsas
rtcore
RTEXT
RTFTo
RTLREADING
Rtn
ruleset
@@ -1637,6 +1667,7 @@ sidebyside
SIF
SIGDN
Signtool
SINGLEFLAG
SINGLETHREADED
siup
sixel
@@ -1668,6 +1699,7 @@ srcsrv
SRCSRVTRG
srctool
srect
srv
srvinit
srvpipe
ssa
@@ -1699,6 +1731,7 @@ SUA
subcompartment
subkeys
SUBLANG
subresource
subsystemconsole
subsystemwindows
swapchain
@@ -1709,7 +1742,6 @@ SYMED
SYNCPAINT
syscalls
SYSCHAR
SYSCOLOR
SYSCOMMAND
SYSDEADCHAR
SYSKEYDOWN
@@ -1721,7 +1753,6 @@ sysparams
sysparamsext
SYSTEMHAND
SYSTEMMENU
SYSTEMTIME
tabview
TAdd
taef
@@ -1776,6 +1807,7 @@ TEXTMETRIC
TEXTMETRICW
textmode
texttests
TFCAT
TFunction
THUMBPOSITION
THUMBTRACK
@@ -1803,15 +1835,18 @@ tosign
touchpad
Tpp
Tpqrst
tracelog
tracelogging
traceviewpp
trackbar
TRACKCOMPOSITION
trackpad
transitioning
Trd
TREX
triaged
triaging
TRIANGLESTRIP
Tribool
TRIMZEROHEADINGS
trx
@@ -1829,6 +1864,8 @@ TTM
TTo
tvpp
tvtseq
Txtev
typechecked
TYUI
UAC
uap
@@ -1846,11 +1883,13 @@ UIACCESS
uiacore
uiautomationcore
uielem
UIELEMENTENABLEDONLY
UINTs
ul
ulcch
uld
uldash
uldb
uldash
ulwave
Unadvise
unattend
@@ -1861,6 +1900,7 @@ unhosted
UNICODETEXT
UNICRT
Unintense
Uniscribe
unittesting
unittests
unk
@@ -1872,6 +1912,7 @@ untextured
UPDATEDISPLAY
UPDOWN
UPKEY
UPSS
upss
uregex
URegular
@@ -1901,7 +1942,6 @@ UVWXY
UVWXYZ
uwa
uwp
uwu
uxtheme
Vanara
vararg
@@ -1942,6 +1982,7 @@ vstest
VSTS
VSTT
vswhere
vtapi
vtapp
VTE
VTID
@@ -1955,6 +1996,7 @@ VTRGBTo
vtseq
vtterm
vttest
waitable
WANSUNG
WANTARROWS
WANTTAB
@@ -1975,7 +2017,6 @@ wdm
webpage
websites
wekyb
wewoad
wex
wextest
wextestclass
@@ -2005,6 +2046,7 @@ WINDOWALPHA
windowdpiapi
WINDOWEDGE
windowext
windowime
WINDOWINFO
windowio
windowmetrics
@@ -2055,6 +2097,7 @@ WNDCLASSW
Wndproc
WNegative
WNull
wnwb
workarea
WOutside
WOWARM
@@ -2078,6 +2121,7 @@ wrkstr
wrl
wrp
WRunoff
WScript
wsl
WSLENV
wstr
@@ -2093,6 +2137,7 @@ WTs
WTSOFTFONT
wtw
wtypes
Wubi
WUX
WVerify
WWith
@@ -2111,17 +2156,22 @@ XBUTTONDOWN
XBUTTONUP
XCast
XCENTER
XColors
xcopy
XCount
xdy
XEncoding
xes
xff
XFG
XFile
XFORM
XIn
xin
xinchaof
xinxinchaof
XManifest
XMath
XMFLOAT
xorg
XResource
xsi

View File

@@ -13,7 +13,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.1
- uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/microsoft/projects/159
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

View File

@@ -13,8 +13,7 @@ jobs:
- id: getBody
uses: craigloewen-msft/GitGudSimilarIssues@main
with:
issueTitle: ${{ github.event.issue.title }}
issueBody: ${{ github.event.issue.body }}
issuetitle: ${{ github.event.issue.title }}
repo: ${{ github.repository }}
similaritytolerance: "0.75"
add-comment:

31
.vscode/settings.json vendored
View File

@@ -1,28 +1,8 @@
{
"C_Cpp.default.browse.databaseFilename": "${workspaceFolder}\\.vscode\\.BROWSE.VC.DB",
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
"C_Cpp.default.browse.path": [
"${workspaceFolder}"
],
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.defines": [
"_DEBUG",
"_UNICODE",
"BUILD_ONECORE_INTERACTIVITY",
"DBG",
"NT_SUCCESS",
"UNICODE",
"UNIT_TESTING",
"INLINE_TEST_METHOD_MARKUP",
],
"C_Cpp.default.includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/**/Generated Files",
"${workspaceFolder}/**/inc",
"${workspaceFolder}/**/include",
"${workspaceFolder}/**/Include"
],
"C_Cpp.loggingLevel": "None",
"files.associations": {
"xstring": "cpp",
@@ -118,13 +98,14 @@
"coroutine": "cpp",
"format": "cpp",
"forward_list": "cpp",
"latch": "cpp",
"gsl_assert": "cpp"
"latch": "cpp"
},
"files.exclude": {
"**/bin/**": true,
"**/Generated Files/**": true,
"**/obj/**": true,
"**/packages/**": true,
"**/Generated Files/**": true
},
}
"search.exclude": {
"**/packages/**": true
}
}

View File

@@ -171,7 +171,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Control.Lib", "src\cascadia\TerminalControl\TerminalControlLib.vcxproj", "{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}"
ProjectSection(ProjectDependencies) = postProject
{1CF55140-EF6A-4736-A403-957E4F7430BB} = {1CF55140-EF6A-4736-A403-957E4F7430BB}
{2FD12FBB-1DDB-46D8-B818-1023C624CACA} = {2FD12FBB-1DDB-46D8-B818-1023C624CACA}
{48D21369-3D7B-4431-9967-24E81292CF63} = {48D21369-3D7B-4431-9967-24E81292CF63}
{8222900C-8B6C-452A-91AC-BE95DB04B95F} = {8222900C-8B6C-452A-91AC-BE95DB04B95F}
{AF0A096A-8B3A-4949-81EF-7DF8F0FEE91F} = {AF0A096A-8B3A-4949-81EF-7DF8F0FEE91F}
@@ -411,9 +410,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MidiAudio", "src\audio\midi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TerminalStress", "src\tools\TerminalStress\TerminalStress.csproj", "{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Interfaces", "Interfaces", "{6F4CC67D-6FC5-435E-885D-9FC3624BDF2F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Connection.Interfaces", "src\cascadia\ITerminalConnection\ITerminalConnection.vcxproj", "{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Core.Interfaces", "src\cascadia\ITerminalCore\ITerminalCore.vcxproj", "{40503EDC-E3E4-46AB-BC26-D293B956CAE8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderingTests", "src\tools\RenderingTests\RenderingTests.vcxproj", "{37C995E0-2349-4154-8E77-4A52C0C7F46D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.UI", "src\cascadia\UIHelpers\UIHelpers.vcxproj", "{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UIHelpers", "src\cascadia\UIHelpers\UIHelpers.vcxproj", "{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchcat", "src\tools\benchcat\benchcat.vcxproj", "{2C836962-9543-4CE5-B834-D28E1F124B66}"
EndProject
@@ -478,7 +483,6 @@ Global
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|ARM64.Build.0 = Debug|ARM64
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|x64.ActiveCfg = Debug|x64
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|x64.Build.0 = Debug|x64
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|x64.Deploy.0 = Debug|x64
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|x86.ActiveCfg = Debug|Win32
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Debug|x86.Build.0 = Debug|Win32
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
@@ -2344,6 +2348,56 @@ Global
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|x64.ActiveCfg = Release|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|x64.Build.0 = Release|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|x86.ActiveCfg = Release|Any CPU
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|Any CPU.ActiveCfg = AuditMode|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|x64.ActiveCfg = AuditMode|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|x64.Build.0 = AuditMode|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|x86.ActiveCfg = AuditMode|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.AuditMode|x86.Build.0 = AuditMode|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|Any CPU.ActiveCfg = Debug|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|ARM64.ActiveCfg = Debug|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|ARM64.Build.0 = Debug|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|x64.ActiveCfg = Debug|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|x64.Build.0 = Debug|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|x86.ActiveCfg = Debug|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Debug|x86.Build.0 = Debug|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|Any CPU.ActiveCfg = Release|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|ARM64.ActiveCfg = Release|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|ARM64.Build.0 = Release|ARM64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|x64.ActiveCfg = Release|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|x64.Build.0 = Release|x64
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|x86.ActiveCfg = Release|Win32
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}.Release|x86.Build.0 = Release|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|Any CPU.ActiveCfg = AuditMode|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|x64.ActiveCfg = AuditMode|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|x64.Build.0 = AuditMode|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|x86.ActiveCfg = AuditMode|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.AuditMode|x86.Build.0 = AuditMode|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|Any CPU.ActiveCfg = Debug|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|ARM64.Build.0 = Debug|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|x64.ActiveCfg = Debug|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|x64.Build.0 = Debug|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|x86.ActiveCfg = Debug|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Debug|x86.Build.0 = Debug|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|Any CPU.ActiveCfg = Release|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|ARM64.ActiveCfg = Release|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|ARM64.Build.0 = Release|ARM64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|x64.ActiveCfg = Release|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|x64.Build.0 = Release|x64
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|x86.ActiveCfg = Release|Win32
{40503EDC-E3E4-46AB-BC26-D293B956CAE8}.Release|x86.Build.0 = Release|Win32
{37C995E0-2349-4154-8E77-4A52C0C7F46D}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
{37C995E0-2349-4154-8E77-4A52C0C7F46D}.AuditMode|ARM64.ActiveCfg = Release|ARM64
{37C995E0-2349-4154-8E77-4A52C0C7F46D}.AuditMode|x64.ActiveCfg = Release|x64
@@ -2445,7 +2499,7 @@ Global
{345FD5A4-B32B-4F29-BD1C-B033BD2C35CC} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
{4C8E6BB0-4713-4ADB-BD04-81628ECEAF20} = {81C352DB-1818-45B7-A284-18E259F1CC87}
{D57841D1-8294-4F2B-BB8B-D2A35738DECD} = {81C352DB-1818-45B7-A284-18E259F1CC87}
{2FD12FBB-1DDB-46D8-B818-1023C624CACA} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
{2FD12FBB-1DDB-46D8-B818-1023C624CACA} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
{3AE13314-1939-4DFA-9C14-38CA0834050C} = {F1995847-4AE5-479A-BBAF-382E51A63532}
{DCF55140-EF6A-4736-A403-957E4F7430BB} = {F1995847-4AE5-479A-BBAF-382E51A63532}
{1CF55140-EF6A-4736-A403-957E4F7430BB} = {F1995847-4AE5-479A-BBAF-382E51A63532}
@@ -2537,6 +2591,9 @@ Global
{40BD8415-DD93-4200-8D82-498DDDC08CC8} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
{3C67784E-1453-49C2-9660-483E2CC7F7AD} = {40BD8415-DD93-4200-8D82-498DDDC08CC8}
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4} = {A10C4720-DCA4-4640-9749-67F4314F527C}
{6F4CC67D-6FC5-435E-885D-9FC3624BDF2F} = {59840756-302F-44DF-AA47-441A9D673202}
{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17} = {6F4CC67D-6FC5-435E-885D-9FC3624BDF2F}
{40503EDC-E3E4-46AB-BC26-D293B956CAE8} = {6F4CC67D-6FC5-435E-885D-9FC3624BDF2F}
{37C995E0-2349-4154-8E77-4A52C0C7F46D} = {A10C4720-DCA4-4640-9749-67F4314F527C}
{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F} = {61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}
{2C836962-9543-4CE5-B834-D28E1F124B66} = {A10C4720-DCA4-4640-9749-67F4314F527C}

View File

@@ -4,7 +4,6 @@ trigger:
include:
- main
- feature/*
- gh-readonly-queue/*
paths:
exclude:
- doc/*

View File

@@ -75,7 +75,6 @@ steps:
rm LocOutputMunged.tar
rm -r -fo LocOutput
& ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
& ./build/scripts/Generate-PseudoLocalizations.ps1
displayName: Move Loc files to the right places
- pwsh: |-

View File

@@ -30,18 +30,9 @@ extends:
buildTerminal: true
pgoBuildMode: Optimize
codeSign: true
signingIdentity:
serviceName: $(SigningServiceName)
appId: $(SigningAppId)
tenantId: $(SigningTenantId)
akvName: $(SigningAKVName)
authCertName: $(SigningAuthCertName)
signCertName: $(SigningSignCertName)
publishSymbolsToPublic: true
publishVpackToWindows: false
symbolExpiryTime: 15
symbolPublishingSubscription: $(SymbolPublishingServiceConnection)
symbolPublishingProject: $(SymbolPublishingProject)
${{ if eq(true, parameters.publishToAzure) }}:
extraPublishJobs:
- template: build/pipelines/templates-v2/job-deploy-to-azure-storage.yml@self

View File

@@ -78,15 +78,6 @@ extends:
buildConfigurations: ${{ parameters.buildConfigurations }}
buildPlatforms: ${{ parameters.buildPlatforms }}
codeSign: true
signingIdentity:
serviceName: $(SigningServiceName)
appId: $(SigningAppId)
tenantId: $(SigningTenantId)
akvName: $(SigningAKVName)
authCertName: $(SigningAuthCertName)
signCertName: $(SigningSignCertName)
terminalInternalPackageVersion: ${{ parameters.terminalInternalPackageVersion }}
publishSymbolsToPublic: ${{ parameters.publishSymbolsToPublic }}
publishVpackToWindows: ${{ parameters.publishVpackToWindows }}
symbolPublishingSubscription: $(SymbolPublishingServiceConnection)
symbolPublishingProject: $(SymbolPublishingProject)

View File

@@ -27,9 +27,6 @@ parameters:
- name: publishArtifacts
type: boolean
default: true
- name: signingIdentity
type: object
default: {}
jobs:
- job: ${{ parameters.jobName }}
@@ -100,15 +97,10 @@ jobs:
flattenFolders: true
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
- task: EsrpCodeSigning@3
displayName: Submit *.nupkg to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true

View File

@@ -65,9 +65,6 @@ parameters:
- name: removeAllNonSignedFiles
type: boolean
default: false
- name: signingIdentity
type: object
default: {}
jobs:
- job: ${{ parameters.jobName }}
@@ -145,10 +142,6 @@ jobs:
- template: .\steps-restore-nuget.yml
- pwsh: |-
.\build\scripts\Set-LatestVCToolsVersion.ps1
displayName: Work around DD-1541167 (VCToolsVersion)
- ${{ parameters.beforeBuildSteps }}
- task: VSBuild@1
@@ -242,15 +235,10 @@ jobs:
# Code-sign everything we just put together.
# We run the signing in Terminal.BinDir, because all of the signing batches are relative to the final architecture/configuration output folder.
- task: EsrpCodeSigning@5
- task: EsrpCodeSigning@3
displayName: Submit Signing Request
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
FolderPath: '$(Terminal.BinDir)'
signType: batchSigning
batchSignPolicyFile: '$(Build.SourcesDirectory)/ESRPSigningConfig.json'

View File

@@ -80,7 +80,7 @@ jobs:
Install-Module -Verbose -AllowClobber -Force Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute
displayName: Install Azure Module Dependencies
- task: AzureFileCopy@6
- task: AzureFileCopy@5
displayName: Publish to Storage Account
inputs:
sourcePath: _out/*

View File

@@ -32,9 +32,6 @@ parameters:
- name: afterBuildSteps
type: stepList
default: []
- name: signingIdentity
type: object
default: {}
jobs:
- job: ${{ parameters.jobName }}
@@ -97,15 +94,10 @@ jobs:
displayName: Create msixbundle
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
- task: EsrpCodeSigning@3
displayName: Submit *.msixbundle to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
FolderPath: $(System.ArtifactsDirectory)\bundle
Pattern: $(BundleStemName)*.msixbundle
UseMinimatch: true

View File

@@ -27,9 +27,6 @@ parameters:
- name: publishArtifacts
type: boolean
default: true
- name: signingIdentity
type: object
default: {}
jobs:
- job: ${{ parameters.jobName }}
@@ -85,15 +82,10 @@ jobs:
versionEnvVar: XES_PACKAGEVERSIONNUMBER
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
- task: EsrpCodeSigning@3
displayName: Submit *.nupkg to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true

View File

@@ -1,117 +0,0 @@
parameters:
- name: includePublicSymbolServer
type: boolean
default: false
- name: pool
type: object
default: []
- name: dependsOn
type: object
default: null
- name: artifactStem
type: string
default: ''
- name: jobName
type: string
default: PublishSymbols
- name: symbolExpiryTime
type: string
default: 36530 # This is the default from PublishSymbols@2
- name: variables
type: object
default: {}
- name: subscription
type: string
- name: symbolProject
type: string
jobs:
- job: ${{ parameters.jobName }}
${{ if ne(length(parameters.pool), 0) }}:
pool: ${{ parameters.pool }}
${{ if eq(parameters.includePublicSymbolServer, true) }}:
displayName: Publish Symbols to Internal and MSDL
${{ else }}:
displayName: Publish Symbols Internally
dependsOn: ${{ parameters.dependsOn }}
variables:
${{ insert }}: ${{ parameters.variables }}
steps:
- checkout: self
clean: true
fetchDepth: 1
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- task: DownloadPipelineArtifact@2
displayName: Download all PDBs from all prior build phases
inputs:
itemPattern: '**/*.pdb'
targetPath: '$(Build.SourcesDirectory)/bin'
- powershell: |-
Get-PackageProvider -Name NuGet -ForceBootstrap
Install-Module -Verbose -AllowClobber -Force Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute
displayName: Install Azure Module Dependencies
# Transit the Azure token from the Service Connection into a secret variable for the rest of the pipeline to use.
- task: AzurePowerShell@5
displayName: Generate an Azure Token
inputs:
azureSubscription: ${{ parameters.subscription }}
azurePowerShellVersion: LatestVersion
pwsh: true
ScriptType: InlineScript
Inline: |-
$AzToken = (Get-AzAccessToken -ResourceUrl api://30471ccf-0966-45b9-a979-065dbedb24c1).Token
Write-Host "##vso[task.setvariable variable=SymbolAccessToken;issecret=true]$AzToken"
- task: PublishSymbols@2
displayName: Publish Symbols (to current Azure DevOps tenant)
continueOnError: True
inputs:
SymbolsFolder: '$(Build.SourcesDirectory)/bin'
SearchPattern: '**/*.pdb'
IndexSources: false
DetailedLog: true
SymbolsMaximumWaitTime: 30
SymbolServerType: 'TeamServices'
SymbolsProduct: 'Windows Terminal Converged Symbols'
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
SymbolsArtifactName: 'WindowsTerminal_$(XES_APPXMANIFESTVERSION)'
SymbolExpirationInDays: ${{ parameters.symbolExpiryTime }}
env:
LIB: $(Build.SourcesDirectory)
- pwsh: |-
# Prepare the defaults for IRM
$PSDefaultParameterValues['Invoke-RestMethod:Headers'] = @{ Authorization = "Bearer $(SymbolAccessToken)" }
$PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = "application/json"
$PSDefaultParameterValues['Invoke-RestMethod:Method'] = "POST"
$BaseUri = "https://symbolrequestprod.trafficmanager.net/projects/${{ parameters.symbolProject }}/requests"
# Prepare the request
$expiration = (Get-Date).Add([TimeSpan]::FromDays(${{ parameters.symbolExpiryTime }}))
$createRequestBody = @{
requestName = "WindowsTerminal_$(XES_APPXMANIFESTVERSION)";
expirationTime = $expiration.ToString();
}
Write-Host "##[debug]Starting request $($createRequestBody.requestName) with expiration date of $($createRequestBody.expirationTime)"
Invoke-RestMethod -Uri "$BaseUri" -Body ($createRequestBody | ConvertTo-Json -Compress) -Verbose
# Request symbol publication
$publishRequestBody = @{
publishToInternalServer = $true;
publishToPublicServer = $${{ parameters.includePublicSymbolServer }};
}
Write-Host "##[debug]Submitting request $($createRequestBody.requestName) ($($publishRequestBody | ConvertTo-Json -Compress))"
Invoke-RestMethod -Uri "$BaseUri/$($createRequestBody.requestName)" -Body ($publishRequestBody | ConvertTo-Json -Compress) -Verbose
displayName: Publish Symbols using internal REST API

View File

@@ -33,7 +33,7 @@ parameters:
- arm64
- name: codeSign
type: boolean
default: false
default: true
- name: generateSbom
type: boolean
default: true

View File

@@ -52,17 +52,10 @@ parameters:
- name: publishVpackToWindows
type: boolean
default: false
- name: symbolPublishingSubscription
type: string
- name: symbolPublishingProject
type: string
- name: extraPublishJobs
type: object
default: []
- name: signingIdentity
type: object
default: {}
resources:
repositories:
@@ -85,7 +78,6 @@ extends:
cloudvault: # https://aka.ms/obpipelines/cloudvault
enabled: false
globalSdl: # https://aka.ms/obpipelines/sdl
enableCheckCFlags: false # CheckCFlags is broken and exploding our builds; to remove, :g/BAD-FLAGS/d
asyncSdl:
enabled: true
tsaOptionsFile: 'build/config/tsa.json'
@@ -111,8 +103,6 @@ extends:
parameters:
pool: { type: windows }
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(JobOutputDirectory)
@@ -128,7 +118,6 @@ extends:
generateSbom: false # this is handled by onebranch
removeAllNonSignedFiles: true # appease the overlords
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
beforeBuildSteps: # Right before we build, lay down the universal package and localizations
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
@@ -148,8 +137,6 @@ extends:
parameters:
pool: { type: windows }
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(JobOutputDirectory)
@@ -165,7 +152,6 @@ extends:
generateSbom: false # this is handled by onebranch
removeAllNonSignedFiles: true # appease the overlords
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
beforeBuildSteps:
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
@@ -182,8 +168,6 @@ extends:
parameters:
pool: { type: windows }
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(JobOutputDirectory)
@@ -219,7 +203,6 @@ extends:
buildPlatforms: ${{ parameters.buildPlatforms }}
generateSbom: false # Handled by onebranch
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
afterBuildSteps:
# This directory has to exist, even if we aren't using createvpack, because the Guardian rules demand it.
- pwsh: |-
@@ -236,8 +219,6 @@ extends:
parameters:
pool: { type: windows }
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(JobOutputDirectory)
@@ -247,15 +228,12 @@ extends:
buildPlatforms: ${{ parameters.buildPlatforms }}
generateSbom: false # this is handled by onebranch
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
- ${{ if eq(parameters.buildWPF, true) }}:
- template: ./build/pipelines/templates-v2/job-build-package-wpf.yml@self
parameters:
pool: { type: windows }
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(JobOutputDirectory)
@@ -265,22 +243,18 @@ extends:
buildPlatforms: ${{ parameters.buildPlatforms }}
generateSbom: false # this is handled by onebranch
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
- stage: Publish
displayName: Publish
dependsOn: [Build]
jobs:
- template: ./build/pipelines/templates-v2/job-publish-symbols-using-symbolrequestprod-api.yml@self
- template: ./build/pipelines/templates-v2/job-publish-symbols.yml@self
parameters:
pool: { type: windows }
includePublicSymbolServer: ${{ parameters.publishSymbolsToPublic }}
symbolPatGoesInTaskInputs: true # onebranch tries to muck with the PAT variable, so we need to change how it get the PAT
symbolExpiryTime: ${{ parameters.symbolExpiryTime }}
subscription: ${{ parameters.symbolPublishingSubscription }}
symbolProject: ${{ parameters.symbolPublishingProject }}
variables:
ob_sdl_checkcflags_enabled: false # BAD-FLAGS
ob_sdl_xfgcheck_enabled: false # BAD-FLAGS
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: $(Build.ArtifactStagingDirectory)

View File

@@ -1,2 +1,2 @@
variables:
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:1.0.02566.28'
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'

View File

@@ -0,0 +1,49 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OpenConsoleGetUtilityProjectWinMDReferencesDependsOn></OpenConsoleGetUtilityProjectWinMDReferencesDependsOn>
<OpenConsoleGetUtilityProjectWinMDReferencesDependsOn Condition="'$(TerminalCppWinRT)'=='true'">
GetCppWinRTProjectWinMDReferences;
$(OpenConsoleGetUtilityProjectWinMDReferencesDependsOn)
</OpenConsoleGetUtilityProjectWinMDReferencesDependsOn>
<OpenConsoleGetUtilityProjectWinMDReferencesDependsOn Condition="'$(TerminalMidlRT)'=='true'">
GetMidlRTProjectWinMDReferences;
$(OpenConsoleGetUtilityProjectWinMDReferencesDependsOn)
</OpenConsoleGetUtilityProjectWinMDReferencesDependsOn>
<CppWinRTResolveReferencesDependsOn>$(CppWinRTResolveReferencesDependsOn);OpenConsoleSwitchUpMergeInputs;</CppWinRTResolveReferencesDependsOn>
<MidlRTResolveReferencesDependsOn>$(MidlRTResolveReferencesDependsOn);OpenConsoleSwitchUpMergeInputs;</MidlRTResolveReferencesDependsOn>
</PropertyGroup>
<Target Name="OpenConsoleGetUtilityProjectWinMDReferences"
DependsOnTargets="ResolveProjectReferences;$(OpenConsoleGetUtilityProjectWinMDReferencesDependsOn)"
Returns="@(OpenConsoleUtilityProjectWinMDReferences)">
<ItemGroup>
<_OpenConsoleUtilityProjectReferences Remove="@(_OpenConsoleUtilityProjectReferences)"/>
<_OpenConsoleUtilityProjectReferences Include="@(_ResolvedProjectReferencePaths)"
Condition= "'%(_ResolvedProjectReferencePaths.ProjectType)'=='Utility' AND
'%(_ResolvedProjectReferencePaths.WinMDFile)' == 'true' AND
'%(_ResolvedProjectReferencePaths.OpenConsoleImplementInterface)' == 'true'"/>
</ItemGroup>
<ItemGroup>
<OpenConsoleUtilityProjectWinMDReferences Remove="@(OpenConsoleUtilityProjectWinMDReferences)" />
<OpenConsoleUtilityProjectWinMDReferences Include="@(_OpenConsoleUtilityProjectReferences)">
<WinMDPath>%(FullPath)</WinMDPath>
</OpenConsoleUtilityProjectWinMDReferences>
</ItemGroup>
</Target>
<!-- Calculates the input files and metadata directories to be passed to MdMerge -->
<Target Name="OpenConsoleSwitchUpMergeInputs"
DependsOnTargets="OpenConsoleGetUtilityProjectWinMDReferences">
<ItemGroup>
<!-- Utility projects should be consumed statically, not as dynamic references. -->
<CppWinRTDynamicProjectWinMDReferences Remove="@(OpenConsoleUtilityProjectWinMDReferences)" />
<CppWinRTStaticProjectWinMDReferences Include="@(OpenConsoleUtilityProjectWinMDReferences)" />
<MidlRTDynamicProjectWinMDReferences Remove="@(OpenConsoleUtilityProjectWinMDReferences)" />
<MidlRTStaticProjectWinMDReferences Include="@(OpenConsoleUtilityProjectWinMDReferences)" />
</ItemGroup>
</Target>
</Project>

View File

@@ -1,16 +0,0 @@
Get-ChildItem -Recurse -Filter *.resw
| Where-Object { $_.Directory.Name.StartsWith("qps-ploc") }
| ForEach-Object {
$source = Join-Path $_.Directory "../en-US/$($_.Name)"
$target = $_
$ploc = ./tools/ConvertTo-PseudoLocalization.ps1 -Path $source
$writerSettings = [System.Xml.XmlWriterSettings]::new()
$writerSettings.NewLineChars = "`r`n"
$writerSettings.Indent = $true
$writer = [System.Xml.XmlWriter]::Create($target, $writerSettings)
$ploc.Save($writer)
$writer.Flush()
$writer.Close()
}

View File

@@ -1,8 +0,0 @@
$VSInstances = ([xml](& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -include packages -format xml))
$VSPackages = $VSInstances.instances.instance.packages.package
$LatestVCPackage = ($VSInstances.instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.CRT.Source" })
$LatestVCToolsVersion = $LatestVCPackage.version;
Write-Output "Latest VCToolsVersion: $LatestVCToolsVersion"
Write-Output "Updating VCToolsVersion environment variable for job"
Write-Output "##vso[task.setvariable variable=VCToolsVersion]$LatestVCToolsVersion"

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# CLI11
Taken from [release v2.4.1](https://github.com/CLIUtils/CLI11/releases/tag/v2.4.1), source commit
[f4d0731](https://github.com/CLIUtils/CLI11/commit/f4d0731cebb123ff0ace712c099dffbcd2c58e5a)
Taken from [release v1.9.1](https://github.com/CLIUtils/CLI11/releases/tag/v1.9.1), source commit
[5cb3efa](https://github.com/CLIUtils/CLI11/commit/5cb3efabce007c3a0230e4cc2e27da491c646b6c)

View File

@@ -6,7 +6,7 @@
"type": "git",
"git": {
"repositoryUrl": "https://github.com/CLIUtils/CLI11",
"commitHash": "88e9bb17418ee730817d5942894d99a4bdd78fb3"
"commitHash": "5cb3efabce007c3a0230e4cc2e27da491c646b6c"
}
}
}

View File

@@ -10,6 +10,7 @@
<package id="Microsoft.UI.Xaml" version="2.8.4" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1661.34" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.240122.1" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.Windows.MidlRT" version="2.0.200924.1" targetFramework="native" />
<!-- Managed packages -->
<package id="Appium.WebDriver" version="3.0.0.2" targetFramework="net45" />

View File

@@ -65,6 +65,9 @@
* `clipboard.cpp`
* Handles the command prompt line as you see in CMD.exe (known as the processed input line… most other shells handle this themselves with raw input and dont use ours. This is a legacy of bad architectural design, putting stuff in conhost not in CMD)
* `cmdline.cpp`
* Handles shunting IME data back and forth to the TSF library and to and from the various buffers
* `Conimeinfo.cpp`
* `Convarea.cpp`
* Contains the global state for the entire console application
* `consoleInformation.cpp`
* Stuff related to the low-level server communication over our protocol with the driver

View File

@@ -154,47 +154,3 @@ popd
The `bx` will build just the Terminal package, critically, populating the `CascadiaPackage.build.appxrecipe` file. Once that's been built, then the `DeployAppRecipe.exe` command can be used to deploy a loose layout in the same way that Visual Studio does.
Notably, this method of building the Terminal package can't leverage the FastUpToDate check in Visual Studio, so the builds end up being considerably slower for the whole package, as cppwinrt does a lot of work before confirming that it's up to date and doing nothing.
### Are you seeing `DEP0700: Registration of the app failed`?
Once in a blue moon, I get a `DEP0700: Registration of the app failed.
[0x80073CF6] error 0x80070020: Windows cannot register the package because of an
internal error or low memory.` when trying to deploy in VS. For us, that can
happen if the `OpenConsoleProxy.dll` gets locked up, in use by some other
terminal package.
Doing the equivalent command in powershell can give us more info:
```pwsh
Add-AppxPackage -register "Z:\dev\public\OpenConsole\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\AppxManifest.xml"
```
That'll suggest `NOTE: For additional information, look for [ActivityId]
dbf551f1-83d0-0007-43e7-9cded083da01 in the Event Log or use the command line
Get-AppPackageLog -ActivityID dbf551f1-83d0-0007-43e7-9cded083da01`. So do that:
```pwsh
Get-AppPackageLog -ActivityID dbf551f1-83d0-0007-43e7-9cded083da01
```
which will give you a lot of info. In my case, that revealed that the platform
couldn't delete the packaged com entries. The key line was: `AppX Deployment
operation failed with error 0x0 from API Logging data because access was denied
for file:
C:\ProgramData\Microsoft\Windows\AppRepository\Packages\WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe,
user SID: S-1-5-18`
Take that path, and
```pwsh
sudo start C:\ProgramData\Microsoft\Windows\AppRepository\Packages\WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe
```
(use `sudo`, since the path is otherwise locked down). From there, go into the
`PackagedCom` folder, and open [File
Locksmith](https://learn.microsoft.com/en-us/windows/powertoys/file-locksmith)
(or Process Explorer, if you're more familiar with that) on
`OpenConsoleProxy.dll`. Just go ahead and immediately re-launch it as admin,
too. That should list off a couple terminal processes that are just hanging
around. Go ahead and end them all. You should be good to deploy again after
that.

View File

@@ -349,7 +349,7 @@
"description": "Sets the DWrite font features for the given font. For example, { \"ss01\": 1, \"liga\":0 } will enable ss01 and disable ligatures.",
"type": "object",
"patternProperties": {
"^[\\x20-\\x7E]{4}$": {
"^(([A-Za-z0-9]){4})$": {
"type": "integer"
}
},
@@ -359,7 +359,7 @@
"description": "Sets the DWrite font axes for the given font. For example, { \"wght\": 200 } will set the font weight to 200.",
"type": "object",
"patternProperties": {
"^[\\x20-\\x7E]{4}$": {
"^([A-Za-z]{4})$": {
"type": "number"
}
},
@@ -1501,10 +1501,8 @@
"const": "multipleActions"
},
"actions": {
"$ref": "#/$defs/ShortcutAction",
"type": "array",
"items": {
"$ref": "#/$defs/ShortcutAction"
},
"minItems": 1,
"description": "A list of other actions."
}
@@ -1893,14 +1891,6 @@
],
"type": "string"
},
"IconStyle": {
"enum": [
"default",
"hidden",
"monochrome"
],
"type": "string"
},
"ThemeColor": {
"description": "A special kind of color for use in themes. Can be an #rrggbb color, #rrggbbaa color, or a special value. 'accent' is evaluated as the user's selected Accent color in the OS, and 'terminalBackground' will be evaluated as the background color of the active terminal pane.",
"oneOf": [
@@ -1938,10 +1928,6 @@
"showCloseButton": {
"description": "Controls the visibility of the close button on the tab",
"$ref": "#/$defs/ShowCloseButton"
},
"iconStyle": {
"description": "Controls the appearance of a tab's icon",
"$ref": "#/$defs/IconStyle"
}
}
},
@@ -2079,9 +2065,6 @@
{
"$ref": "#/$defs/SwitchToTabAction"
},
{
"$ref": "#/$defs/ScrollToMarkAction"
},
{
"$ref": "#/$defs/MoveFocusAction"
},
@@ -2217,10 +2200,6 @@
}
}
},
"id": {
"description": "The ID of this command. If one isn't provided, we will generate one internally.",
"type": "string"
},
"iterateOn": {
"type": "string",
"description": "Used to create iterable commands based on other objects in your settings. Possible values:\n- \"profiles\" \n- \"schemes\"",
@@ -2232,15 +2211,7 @@
"commands": {
"description": "List of commands to execute",
"items": {
"type": "object",
"properties": {
"command": {
"$ref": "#/$defs/Keybinding/properties/command"
},
"name": {
"$ref": "#/$defs/Keybinding/properties/name"
}
}
"$ref": "#/$defs/Keybinding/properties/command"
},
"minItems": 1,
"type": "array"
@@ -2361,20 +2332,12 @@
},
"type": "array"
},
"rendering.graphicsAPI": {
"description": "Direct3D 11 provides a more performant and feature-rich experience, whereas Direct2D is more stable. The default option \"Automatic\" will pick the API that best fits your graphics hardware. If you experience significant issues, consider using Direct2D.",
"type": "string",
"enum": [
"direct2d",
"direct3d11"
]
},
"rendering.disablePartialInvalidation": {
"description": "By default, the text renderer uses a FLIP_SEQUENTIAL Swap Chain and declares dirty rectangles via the Present1 API. When this setting is enabled, a FLIP_DISCARD Swap Chain will be used instead, and no dirty rectangles will be declared. Whether one or the other is better depends on your hardware and various other factors.",
"experimental.rendering.forceFullRepaint": {
"description": "When set to true, we will redraw the entire screen each frame. When set to false, we will render only the updates to the screen between frames.",
"type": "boolean"
},
"rendering.software": {
"description": "When enabled, the terminal will use a software rasterizer (WARP). This setting should be left disabled under almost all circumstances.",
"experimental.rendering.software": {
"description": "When set to true, we will use the software renderer (a.k.a. WARP) instead of the hardware one.",
"type": "boolean"
},
"experimental.input.forceVT": {
@@ -2801,14 +2764,13 @@
"type": "string"
}
},
"autoMarkPrompts": {
"experimental.autoMarkPrompts": {
"default": false,
"description": "When set to true, prompts will automatically be marked.",
"type": "boolean"
},
"experimental.autoMarkPrompts": {
"deprecated": true,
"description": "This has been replaced by autoMarkPrompts in 1.21",
"experimental.connection.passthroughMode": {
"description": "When set to true, directs the PTY for this connection to use pass-through mode instead of the original Conhost PTY simulation engine. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "boolean"
},
"experimental.retroTerminalEffect": {
@@ -2816,20 +2778,10 @@
"type": "boolean"
},
"experimental.showMarksOnScrollbar": {
"deprecated": true,
"description": "This has been replaced by showMarksOnScrollbar in 1.21",
"type": "boolean"
},
"showMarksOnScrollbar": {
"default": false,
"description": "When set to true, marks added to the buffer via the addMark action will appear on the scrollbar.",
"type": "boolean"
},
"experimental.rightClickContextMenu": {
"default": false,
"description": "When set to true, right-clicking on the terminal will show a context menu. When set to false, right-click will copy",
"type": "boolean"
},
"experimental.repositionCursorWithMouse": {
"default": false,
"description": "When set to true, you can move the text cursor by clicking with the mouse on the current commandline. This is an experimental feature - there are lots of edge cases where this will not work as expected.",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -8,5 +8,5 @@ Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadi
### Fonts Included
* Cascadia Code, Cascadia Mono (2404.23)
* from microsoft/cascadia-code@1034791e5fc6e060a448d2b29cd94a6c683edb36
* Cascadia Code, Cascadia Mono (2111.01)
* from microsoft/cascadia-code@de36d62e777d34d3bed92a7e23988e5d61e0ba02

View File

@@ -118,6 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppDescription" xml:space="preserve">
<value>Ά śςґàτсн ąρφ ƒоř ΧΆΜĻ Ìŝļàиđś τёşτś !!! !!! !!! !</value>
<value>А şςѓάţćћ ǻрр ƒθŗ χÂΜĿ Íŝĺąήðş ŧеšτş !!! !!! !!! !</value>
</data>
</root>

View File

@@ -118,6 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppDescription" xml:space="preserve">
<value>Ά śςґàτсн ąρφ ƒоř ΧΆΜĻ Ìŝļàиđś τёşτś !!! !!! !!! !</value>
<value>Ă šςґаτćĥ àρφ ƒǿя ЖΆΜĹ Іѕℓаñďş ťêšţŝ !!! !!! !!! !</value>
</data>
</root>

View File

@@ -118,6 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppDescription" xml:space="preserve">
<value>Ά śςґàτсн ąρφ ƒоř ΧΆΜĻ Ìŝļàиđś τёşτś !!! !!! !!! !</value>
<value>Ă śćяǻт¢н ãрρ ƒσг ХĂМĽ Īşłдήďѕ ťέśτş !!! !!! !!! !</value>
</data>
</root>

View File

@@ -11,7 +11,7 @@ Licensed under the MIT license.
#include <conattrs.hpp>
#include "MySettings.g.h"
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, uint32_t>;
using IFontAxesMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
namespace winrt::SampleApp::implementation

View File

@@ -23,24 +23,21 @@ enum class LineRendition : uint8_t
constexpr til::inclusive_rect ScreenToBufferLine(const til::inclusive_rect& line, const LineRendition lineRendition)
{
// Use shift right to quickly divide the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.left >> scale, line.top, line.right >> scale, line.bottom };
}
constexpr til::point ScreenToBufferLineInclusive(const til::point& line, const LineRendition lineRendition)
constexpr til::point ScreenToBufferLine(const til::point& line, const LineRendition lineRendition)
{
// Use shift right to quickly divide the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.x >> scale, line.y };
}
constexpr til::rect BufferToScreenLine(const til::rect& line, const LineRendition lineRendition)
{
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.left << scale, line.top, line.right << scale, line.bottom };
}
constexpr til::inclusive_rect BufferToScreenLine(const til::inclusive_rect& line, const LineRendition lineRendition)
{
// Use shift left to quickly multiply the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.left << scale, line.top, (line.right << scale) + scale, line.bottom };
}

View File

@@ -1,91 +0,0 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- marks.hpp
Abstract:
- Definitions for types that are used for "scroll marks" and shell integration
in the buffer.
- Scroll marks are identified by the existence of "ScrollbarData" on a ROW in the buffer.
- Shell integration will then also markup the buffer with special
TextAttributes, to identify regions of text as the Prompt, the Command, the
Output, etc.
- MarkExtents are used to abstract away those regions of text, so a caller
doesn't need to iterate over the buffer themselves.
--*/
#pragma once
enum class MarkCategory : uint8_t
{
Default = 0,
Error = 1,
Warning = 2,
Success = 3,
Prompt = 4
};
// This is the data that's stored on each ROW, to suggest that there's something
// interesting on this row to show in the scrollbar. Also used in conjunction
// with shell integration - when a prompt is added through shell integration,
// we'll also add a scrollbar mark as a quick "bookmark" to the start of that
// command.
struct ScrollbarData
{
MarkCategory category{ MarkCategory::Default };
// Scrollbar marks may have been given a color, or not.
std::optional<til::color> color;
// Prompts without an exit code haven't had a matching FTCS CommandEnd
// called yet. Any value other than 0 is an error.
std::optional<uint32_t> exitCode;
// Future consideration: stick the literal command as a string on here, if
// we were given it with the 633;E sequence.
};
// Helper struct for describing the bounds of a command and it's output,
// * The Prompt is between the start & end
// * The Command is between the end & commandEnd
// * The Output is between the commandEnd & outputEnd
//
// These are not actually stored in the buffer. The buffer can produce them for
// callers, to make reasoning about regions of the buffer easier.
struct MarkExtents
{
// Data from the row
ScrollbarData data;
til::point start;
til::point end; // exclusive
std::optional<til::point> commandEnd;
std::optional<til::point> outputEnd;
// MarkCategory category{ MarkCategory::Info };
// Other things we may want to think about in the future are listed in
// GH#11000
bool HasCommand() const noexcept
{
return commandEnd.has_value() && *commandEnd != end;
}
bool HasOutput() const noexcept
{
return outputEnd.has_value() && *outputEnd != *commandEnd;
}
std::pair<til::point, til::point> GetExtent() const
{
til::point realEnd{ til::coalesce_value(outputEnd, commandEnd, end) };
return std::make_pair(start, realEnd);
}
};
// Another helper, for when callers would like to know just about the data of
// the scrollbar, but don't actually need all the extents of prompts.
struct ScrollMark
{
til::CoordType row{ 0 };
ScrollbarData data;
};

View File

@@ -29,8 +29,7 @@ OutputCellView::OutputCellView(const std::wstring_view view,
// - Reference to UTF-16 character data
// C26445 - suppressed to enable the `TextBufferTextIterator::operator->` method which needs a non-temporary memory location holding the wstring_view.
// TODO: GH 2681 - remove this suppression by reconciling the probably bad design of the iterators that leads to this being required.
GSL_SUPPRESS(26445)
const std::wstring_view& OutputCellView::Chars() const noexcept
[[gsl::suppress(26445)]] const std::wstring_view& OutputCellView::Chars() const noexcept
{
return _view;
}

View File

@@ -230,7 +230,6 @@ void ROW::Reset(const TextAttribute& attr) noexcept
_lineRendition = LineRendition::SingleWidth;
_wrapForced = false;
_doubleBytePadded = false;
_promptData = std::nullopt;
_init();
}
@@ -349,6 +348,12 @@ void ROW::_init() noexcept
#pragma warning(push)
}
void ROW::TransferAttributes(const til::small_rle<TextAttribute, uint16_t, 1>& attr, til::CoordType newWidth)
{
_attr = attr;
_attr.resize_trailing_extent(gsl::narrow<uint16_t>(newWidth));
}
void ROW::CopyFrom(const ROW& source)
{
_lineRendition = source._lineRendition;
@@ -360,8 +365,7 @@ void ROW::CopyFrom(const ROW& source)
};
CopyTextFrom(state);
_attr = source.Attributes();
_attr.resize_trailing_extent(_columnCount);
TransferAttributes(source.Attributes(), _columnCount);
}
// Returns the previous possible cursor position, preceding the given column.
@@ -914,7 +918,7 @@ const til::small_rle<TextAttribute, uint16_t, 1>& ROW::Attributes() const noexce
TextAttribute ROW::GetAttrByColumn(const til::CoordType column) const
{
return _attr.at(_clampedColumn(column));
return _attr.at(_clampedUint16(column));
}
std::vector<uint16_t> ROW::GetHyperlinks() const
@@ -1097,6 +1101,12 @@ DelimiterClass ROW::DelimiterClassAt(til::CoordType column, const std::wstring_v
}
}
template<typename T>
constexpr uint16_t ROW::_clampedUint16(T v) noexcept
{
return static_cast<uint16_t>(clamp(v, 0, 65535));
}
template<typename T>
constexpr uint16_t ROW::_clampedColumn(T v) const noexcept
{
@@ -1171,45 +1181,3 @@ CharToColumnMapper ROW::_createCharToColumnMapper(ptrdiff_t offset) const noexce
const auto guessedColumn = gsl::narrow_cast<til::CoordType>(clamp(offset, 0, _columnCount));
return CharToColumnMapper{ _chars.data(), _charOffsets.data(), lastChar, guessedColumn };
}
const std::optional<ScrollbarData>& ROW::GetScrollbarData() const noexcept
{
return _promptData;
}
void ROW::SetScrollbarData(std::optional<ScrollbarData> data) noexcept
{
_promptData = data;
}
void ROW::StartPrompt() noexcept
{
if (!_promptData.has_value())
{
// You'd be tempted to write:
//
// _promptData = ScrollbarData{
// .category = MarkCategory::Prompt,
// .color = std::nullopt,
// .exitCode = std::nullopt,
// };
//
// But that's not very optimal! Read this thread for a breakdown of how
// weird std::optional can be some times:
//
// https://github.com/microsoft/terminal/pull/16937#discussion_r1553660833
_promptData.emplace(MarkCategory::Prompt);
}
}
void ROW::EndOutput(std::optional<unsigned int> error) noexcept
{
if (_promptData.has_value())
{
_promptData->exitCode = error;
if (error.has_value())
{
_promptData->category = *error == 0 ? MarkCategory::Success : MarkCategory::Error;
}
}
}

View File

@@ -8,7 +8,6 @@
#include "LineRendition.hpp"
#include "OutputCell.hpp"
#include "OutputCellIterator.hpp"
#include "Marks.hpp"
class ROW;
class TextBuffer;
@@ -132,6 +131,7 @@ public:
til::CoordType GetReadableColumnCount() const noexcept;
void Reset(const TextAttribute& attr) noexcept;
void TransferAttributes(const til::small_rle<TextAttribute, uint16_t, 1>& attr, til::CoordType newWidth);
void CopyFrom(const ROW& source);
til::CoordType NavigateToPrevious(til::CoordType column) const noexcept;
@@ -167,11 +167,6 @@ public:
auto AttrBegin() const noexcept { return _attr.begin(); }
auto AttrEnd() const noexcept { return _attr.end(); }
const std::optional<ScrollbarData>& GetScrollbarData() const noexcept;
void SetScrollbarData(std::optional<ScrollbarData> data) noexcept;
void StartPrompt() noexcept;
void EndOutput(std::optional<unsigned int> error) noexcept;
#ifdef UNIT_TESTING
friend constexpr bool operator==(const ROW& a, const ROW& b) noexcept;
friend class RowTests;
@@ -230,6 +225,8 @@ private:
static constexpr uint16_t CharOffsetsTrailer = 0x8000;
static constexpr uint16_t CharOffsetsMask = 0x7fff;
template<typename T>
static constexpr uint16_t _clampedUint16(T v) noexcept;
template<typename T>
constexpr uint16_t _clampedColumn(T v) const noexcept;
template<typename T>
@@ -302,8 +299,6 @@ private:
bool _wrapForced = false;
// Occurs when the user runs out of text to support a double byte character and we're forced to the next line
bool _doubleBytePadded = false;
std::optional<ScrollbarData> _promptData = std::nullopt;
};
#ifdef UNIT_TESTING

View File

@@ -7,7 +7,7 @@
// Keeping TextColor compact helps us keeping TextAttribute compact,
// which in turn ensures that our buffer memory usage is low.
static_assert(sizeof(TextAttribute) == 18);
static_assert(sizeof(TextAttribute) == 16);
static_assert(alignof(TextAttribute) == 2);
// Ensure that we can memcpy() and memmove() the struct for performance.
static_assert(std::is_trivially_copyable_v<TextAttribute>);
@@ -434,5 +434,4 @@ void TextAttribute::SetStandardErase() noexcept
{
_attrs = CharacterAttributes::Normal;
_hyperlinkId = 0;
_markKind = MarkKind::None;
}

View File

@@ -38,15 +38,6 @@ enum class UnderlineStyle
Max = DashedUnderlined
};
// We only need a few bits, but uint8_t apparently doesn't satisfy std::has_unique_object_representations_v
enum class MarkKind : uint16_t
{
None = 0,
Prompt = 1,
Command = 2,
Output = 3,
};
class TextAttribute final
{
public:
@@ -55,8 +46,7 @@ public:
_foreground{},
_background{},
_hyperlinkId{ 0 },
_underlineColor{},
_markKind{ MarkKind::None }
_underlineColor{}
{
}
@@ -65,8 +55,7 @@ public:
_foreground{ gsl::at(s_legacyForegroundColorMap, wLegacyAttr & FG_ATTRS) },
_background{ gsl::at(s_legacyBackgroundColorMap, (wLegacyAttr & BG_ATTRS) >> 4) },
_hyperlinkId{ 0 },
_underlineColor{},
_markKind{ MarkKind::None }
_underlineColor{}
{
}
@@ -77,8 +66,7 @@ public:
_foreground{ rgbForeground },
_background{ rgbBackground },
_hyperlinkId{ 0 },
_underlineColor{ rgbUnderline },
_markKind{ MarkKind::None }
_underlineColor{ rgbUnderline }
{
}
@@ -87,8 +75,7 @@ public:
_foreground{ foreground },
_background{ background },
_hyperlinkId{ hyperlinkId },
_underlineColor{ underlineColor },
_markKind{ MarkKind::None }
_underlineColor{ underlineColor }
{
}
@@ -148,15 +135,6 @@ public:
return _attrs;
}
constexpr void SetMarkAttributes(const MarkKind attrs) noexcept
{
_markKind = attrs;
}
constexpr MarkKind GetMarkAttributes() const noexcept
{
return _markKind;
}
bool IsHyperlink() const noexcept;
TextColor GetForeground() const noexcept;
@@ -224,7 +202,6 @@ private:
TextColor _foreground; // sizeof: 4, alignof: 1
TextColor _background; // sizeof: 4, alignof: 1
TextColor _underlineColor; // sizeof: 4, alignof: 1
MarkKind _markKind; // sizeof: 2, alignof: 1
#ifdef UNIT_TESTING
friend class TextBufferTests;

View File

@@ -62,11 +62,6 @@ bool TextColor::CanBeBrightened() const noexcept
return IsIndex16() || IsDefault();
}
ColorType TextColor::GetType() const noexcept
{
return _meta;
}
bool TextColor::IsLegacy() const noexcept
{
return (IsIndex16() || IsIndex256()) && _index < 16;
@@ -207,7 +202,7 @@ COLORREF TextColor::GetColor(const std::array<COLORREF, TextColor::TABLE_SIZE>&
// the result will be something like 0b00100000.
// 5. Use BitScanForward (bsf) to find the index of the most significant 1 bit.
const auto haystack = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(colorTable.data())); // 1.
const auto needle = _mm256_set1_epi32(std::bit_cast<int>(defaultColor)); // 2.
const auto needle = _mm256_set1_epi32(til::bit_cast<int>(defaultColor)); // 2.
const auto result = _mm256_cmpeq_epi32(haystack, needle); // 3.
const auto mask = _mm256_movemask_ps(_mm256_castsi256_ps(result)); // 4.
unsigned long index;
@@ -224,7 +219,7 @@ COLORREF TextColor::GetColor(const std::array<COLORREF, TextColor::TABLE_SIZE>&
// --> the index returned by _BitScanForward must be divided by 2.
const auto haystack1 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(colorTable.data() + 0));
const auto haystack2 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(colorTable.data() + 4));
const auto needle = _mm_set1_epi32(std::bit_cast<int>(defaultColor));
const auto needle = _mm_set1_epi32(til::bit_cast<int>(defaultColor));
const auto result1 = _mm_cmpeq_epi32(haystack1, needle);
const auto result2 = _mm_cmpeq_epi32(haystack2, needle);
const auto result = _mm_packs_epi32(result1, result2); // 3.5
@@ -285,3 +280,15 @@ BYTE TextColor::GetLegacyIndex(const BYTE defaultIndex) const noexcept
return til::at(CompressedRgbToIndex16, compressedRgb);
}
}
// Method Description:
// - Return a COLORREF containing our stored value. Will return garbage if this
//attribute is not a RGB attribute.
// Arguments:
// - <none>
// Return Value:
// - a COLORREF containing our stored value
COLORREF TextColor::GetRGB() const noexcept
{
return RGB(_red, _green, _blue);
}

View File

@@ -119,7 +119,6 @@ public:
}
bool CanBeBrightened() const noexcept;
ColorType GetType() const noexcept;
bool IsLegacy() const noexcept;
bool IsIndex16() const noexcept;
bool IsIndex256() const noexcept;
@@ -134,11 +133,12 @@ public:
COLORREF GetColor(const std::array<COLORREF, TABLE_SIZE>& colorTable, const size_t defaultIndex, bool brighten = false) const noexcept;
BYTE GetLegacyIndex(const BYTE defaultIndex) const noexcept;
constexpr BYTE GetIndex() const noexcept { return _index; }
constexpr BYTE GetR() const noexcept { return _red; }
constexpr BYTE GetG() const noexcept { return _green; }
constexpr BYTE GetB() const noexcept { return _blue; }
constexpr COLORREF GetRGB() const noexcept { return RGB(_red, _green, _blue); }
constexpr BYTE GetIndex() const noexcept
{
return _index;
}
COLORREF GetRGB() const noexcept;
static constexpr BYTE TransposeLegacyIndex(const size_t index)
{

View File

@@ -6,87 +6,19 @@
#include "textBuffer.hpp"
// All of these are somewhat annoying when trying to implement RefcountBuffer.
// You can't stuff a unique_ptr into ut->q (= void*) after all.
#pragma warning(disable : 26402) // Return a scoped object instead of a heap-allocated if it has a move constructor (r.3).
#pragma warning(disable : 26403) // Reset or explicitly delete an owner<T> pointer '...' (r.3).
#pragma warning(disable : 26409) // Avoid calling new and delete explicitly, use std::make_unique<T> instead (r.11).
struct RowRange
{
til::CoordType begin;
til::CoordType end;
};
struct RefcountBuffer
{
size_t references;
size_t capacity;
wchar_t data[1];
static RefcountBuffer* EnsureCapacityForOverwrite(RefcountBuffer* buffer, size_t capacity)
{
// We must not just ensure that `buffer` has at least `capacity`, but also that its reference count is <= 1, because otherwise we would resize a shared buffer.
if (buffer != nullptr && buffer->references <= 1 && buffer->capacity >= capacity)
{
return buffer;
}
const auto oldCapacity = buffer ? buffer->capacity << 1 : 0;
const auto newCapacity = std::max(capacity + 128, oldCapacity);
const auto newBuffer = static_cast<RefcountBuffer*>(::operator new(sizeof(RefcountBuffer) - sizeof(data) + newCapacity * sizeof(wchar_t)));
if (!newBuffer)
{
return nullptr;
}
if (buffer)
{
buffer->Release();
}
// Copying the old buffer's data is not necessary because utextAccess() will scribble right over it.
newBuffer->references = 1;
newBuffer->capacity = newCapacity;
return newBuffer;
}
void AddRef() noexcept
{
// With our usage patterns, either of these two would indicate
// an unbalanced AddRef/Release or a memory corruption.
assert(references > 0 && references < 1000);
references++;
}
void Release() noexcept
{
// With our usage patterns, either of these two would indicate
// an unbalanced AddRef/Release or a memory corruption.
assert(references > 0 && references < 1000);
if (--references == 0)
{
::operator delete(this);
}
}
};
constexpr size_t& accessLength(UText* ut) noexcept
{
static_assert(sizeof(ut->p) == sizeof(size_t));
return *std::bit_cast<size_t*>(&ut->p);
}
constexpr RefcountBuffer*& accessBuffer(UText* ut) noexcept
{
static_assert(sizeof(ut->q) == sizeof(RefcountBuffer*));
return *std::bit_cast<RefcountBuffer**>(&ut->q);
}
constexpr RowRange& accessRowRange(UText* ut) noexcept
{
static_assert(sizeof(ut->a) == sizeof(RowRange));
return *std::bit_cast<RowRange*>(&ut->a);
}
@@ -124,16 +56,11 @@ static UText* U_CALLCONV utextClone(UText* dest, const UText* src, UBool deep, U
}
dest = utext_setup(dest, 0, status);
if (*status > U_ZERO_ERROR)
if (*status <= U_ZERO_ERROR)
{
return dest;
memcpy(dest, src, sizeof(UText));
}
memcpy(dest, src, sizeof(UText));
if (const auto buf = accessBuffer(dest))
{
buf->AddRef();
}
return dest;
}
@@ -155,9 +82,7 @@ try
for (til::CoordType y = range.begin; y < range.end; ++y)
{
const auto& row = textBuffer.GetRowByOffset(y);
// Later down below we'll add a newline to the text if !wasWrapForced, so we need to account for that here.
length += row.GetText().size() + !row.WasWrapForced();
length += textBuffer.GetRowByOffset(y).GetText().size();
}
accessLength(ut) = length;
@@ -201,13 +126,11 @@ try
const auto range = accessRowRange(ut);
auto start = ut->chunkNativeStart;
auto limit = ut->chunkNativeLimit;
auto y = accessCurrentRow(ut);
std::wstring_view text;
if (neededIndex < start || neededIndex >= limit)
{
auto y = accessCurrentRow(ut);
std::wstring_view text;
bool wasWrapForced = false;
if (neededIndex < start)
{
do
@@ -215,17 +138,12 @@ try
--y;
if (y < range.begin)
{
assert(false);
return false;
}
const auto& row = textBuffer.GetRowByOffset(y);
text = row.GetText();
wasWrapForced = row.WasWrapForced();
text = textBuffer.GetRowByOffset(y).GetText();
limit = start;
// Later down below we'll add a newline to the text if !wasWrapForced, so we need to account for that here.
start -= text.size() + !wasWrapForced;
start -= text.size();
} while (neededIndex < start);
}
else
@@ -235,32 +153,15 @@ try
++y;
if (y >= range.end)
{
assert(false);
return false;
}
const auto& row = textBuffer.GetRowByOffset(y);
text = row.GetText();
wasWrapForced = row.WasWrapForced();
text = textBuffer.GetRowByOffset(y).GetText();
start = limit;
// Later down below we'll add a newline to the text if !wasWrapForced, so we need to account for that here.
limit += text.size() + !wasWrapForced;
limit += text.size();
} while (neededIndex >= limit);
}
if (!wasWrapForced)
{
const auto newSize = text.size() + 1;
const auto buffer = RefcountBuffer::EnsureCapacityForOverwrite(accessBuffer(ut), newSize);
memcpy(&buffer->data[0], text.data(), text.size() * sizeof(wchar_t));
til::at(buffer->data, text.size()) = L'\n';
text = { &buffer->data[0], newSize };
accessBuffer(ut) = buffer;
}
accessCurrentRow(ut) = y;
ut->chunkNativeStart = start;
ut->chunkNativeLimit = limit;
@@ -355,32 +256,18 @@ catch (...)
return 0;
}
static void U_CALLCONV utextClose(UText* ut) noexcept
{
if (const auto buffer = accessBuffer(ut))
{
buffer->Release();
}
}
static constexpr UTextFuncs utextFuncs{
.tableSize = sizeof(UTextFuncs),
.clone = utextClone,
.nativeLength = utextNativeLength,
.access = utextAccess,
.close = utextClose,
};
// Creates a UText from the given TextBuffer that spans rows [rowBeg,RowEnd).
Microsoft::Console::ICU::unique_utext Microsoft::Console::ICU::UTextFromTextBuffer(const TextBuffer& textBuffer, til::CoordType rowBeg, til::CoordType rowEnd) noexcept
UText Microsoft::Console::ICU::UTextFromTextBuffer(const TextBuffer& textBuffer, til::CoordType rowBeg, til::CoordType rowEnd) noexcept
{
#pragma warning(suppress : 26477) // Use 'nullptr' rather than 0 or NULL (es.47).
unique_utext ut{ UTEXT_INITIALIZER };
UErrorCode status = U_ZERO_ERROR;
utext_setup(&ut, 0, &status);
FAIL_FAST_IF(status > U_ZERO_ERROR);
UText ut = UTEXT_INITIALIZER;
ut.providerProperties = (1 << UTEXT_PROVIDER_LENGTH_IS_EXPENSIVE) | (1 << UTEXT_PROVIDER_STABLE_CHUNKS);
ut.pFuncs = &utextFuncs;
ut.context = &textBuffer;

View File

@@ -10,9 +10,8 @@ class TextBuffer;
namespace Microsoft::Console::ICU
{
using unique_uregex = wistd::unique_ptr<URegularExpression, wil::function_deleter<decltype(&uregex_close), &uregex_close>>;
using unique_utext = wil::unique_struct<UText, decltype(&utext_close), &utext_close>;
unique_utext UTextFromTextBuffer(const TextBuffer& textBuffer, til::CoordType rowBeg, til::CoordType rowEnd) noexcept;
UText UTextFromTextBuffer(const TextBuffer& textBuffer, til::CoordType rowBeg, til::CoordType rowEnd) noexcept;
unique_uregex CreateRegex(const std::wstring_view& pattern, uint32_t flags, UErrorCode* status) noexcept;
til::point_span BufferRangeFromMatch(UText* ut, URegularExpression* re);
}

View File

@@ -188,7 +188,11 @@ void Cursor::_RedrawCursor() noexcept
// - <none>
void Cursor::_RedrawCursorAlways() noexcept
{
_parentBuffer.NotifyPaintFrame();
try
{
_parentBuffer.TriggerRedrawCursor(_cPosition);
}
CATCH_LOG();
}
void Cursor::SetPosition(const til::point cPosition) noexcept

View File

@@ -8,26 +8,28 @@
using namespace Microsoft::Console::Types;
bool Search::IsStale(const Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool caseInsensitive) const noexcept
{
return _renderData != &renderData ||
_needle != needle ||
_caseInsensitive != caseInsensitive ||
_lastMutationId != renderData.GetTextBuffer().GetLastMutationId();
}
bool Search::Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool caseInsensitive, bool reverse)
bool Search::ResetIfStale(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool reverse, bool caseInsensitive)
{
const auto& textBuffer = renderData.GetTextBuffer();
const auto lastMutationId = textBuffer.GetLastMutationId();
if (_needle == needle &&
_caseInsensitive == caseInsensitive &&
_lastMutationId == lastMutationId)
{
_step = reverse ? -1 : 1;
return false;
}
_renderData = &renderData;
_needle = needle;
_caseInsensitive = caseInsensitive;
_lastMutationId = textBuffer.GetLastMutationId();
_lastMutationId = lastMutationId;
_results = textBuffer.SearchText(needle, caseInsensitive);
_index = reverse ? gsl::narrow_cast<ptrdiff_t>(_results.size()) - 1 : 0;
_step = reverse ? -1 : 1;
return true;
}
@@ -91,9 +93,8 @@ void Search::MovePastPoint(const til::point anchor) noexcept
_index = (index + count) % count;
}
void Search::FindNext(bool reverse) noexcept
void Search::FindNext() noexcept
{
_step = reverse ? -1 : 1;
if (const auto count{ gsl::narrow_cast<ptrdiff_t>(_results.size()) })
{
_index = (_index + _step + count) % count;
@@ -110,6 +111,28 @@ const til::point_span* Search::GetCurrent() const noexcept
return nullptr;
}
void Search::HighlightResults() const
{
std::vector<til::inclusive_rect> toSelect;
const auto& textBuffer = _renderData->GetTextBuffer();
for (const auto& r : _results)
{
const auto rbStart = textBuffer.BufferToScreenPosition(r.start);
const auto rbEnd = textBuffer.BufferToScreenPosition(r.end);
til::inclusive_rect re;
re.top = rbStart.y;
re.bottom = rbEnd.y;
re.left = rbStart.x;
re.right = rbEnd.x;
toSelect.emplace_back(re);
}
_renderData->SelectSearchRegions(std::move(toSelect));
}
// Routine Description:
// - Takes the found word and selects it in the screen buffer
@@ -135,11 +158,6 @@ const std::vector<til::point_span>& Search::Results() const noexcept
return _results;
}
std::vector<til::point_span>&& Search::ExtractResults() noexcept
{
return std::move(_results);
}
ptrdiff_t Search::CurrentMatch() const noexcept
{
return _index;

View File

@@ -25,19 +25,18 @@ class Search final
public:
Search() = default;
bool IsStale(const Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool caseInsensitive) const noexcept;
bool Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool caseInsensitive, bool reverse);
bool ResetIfStale(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, bool reverse, bool caseInsensitive);
void MoveToCurrentSelection();
void MoveToPoint(til::point anchor) noexcept;
void MovePastPoint(til::point anchor) noexcept;
void FindNext(bool reverse) noexcept;
void FindNext() noexcept;
const til::point_span* GetCurrent() const noexcept;
void HighlightResults() const;
bool SelectCurrent() const;
const std::vector<til::point_span>& Results() const noexcept;
std::vector<til::point_span>&& ExtractResults() noexcept;
ptrdiff_t CurrentMatch() const noexcept;
private:

File diff suppressed because it is too large Load Diff

View File

@@ -49,6 +49,8 @@ filling in the last row, and updating the screen.
#pragma once
#include <vector>
#include "cursor.h"
#include "Row.hpp"
#include "TextAttribute.hpp"
@@ -64,6 +66,41 @@ namespace Microsoft::Console::Render
class Renderer;
}
enum class MarkCategory
{
Prompt = 0,
Error = 1,
Warning = 2,
Success = 3,
Info = 4
};
struct ScrollMark
{
std::optional<til::color> color;
til::point start;
til::point end; // exclusive
std::optional<til::point> commandEnd;
std::optional<til::point> outputEnd;
MarkCategory category{ MarkCategory::Info };
// Other things we may want to think about in the future are listed in
// GH#11000
bool HasCommand() const noexcept
{
return commandEnd.has_value() && *commandEnd != end;
}
bool HasOutput() const noexcept
{
return outputEnd.has_value() && *outputEnd != *commandEnd;
}
std::pair<til::point, til::point> GetExtent() const
{
til::point realEnd{ til::coalesce_value(outputEnd, commandEnd, end) };
return std::make_pair(til::point{ start }, realEnd);
}
};
class TextBuffer final
{
public:
@@ -105,8 +142,7 @@ public:
til::point NavigateCursor(til::point position, til::CoordType distance) const;
// Text insertion functions
void Replace(til::CoordType row, const TextAttribute& attributes, RowWriteState& state);
void Insert(til::CoordType row, const TextAttribute& attributes, RowWriteState& state);
void Write(til::CoordType row, const TextAttribute& attributes, RowWriteState& state);
void FillRect(const til::rect& rect, const std::wstring_view& fill, const TextAttribute& attributes);
OutputCellIterator Write(const OutputCellIterator givenIt);
@@ -167,8 +203,8 @@ public:
Microsoft::Console::Render::Renderer& GetRenderer() noexcept;
void NotifyPaintFrame() noexcept;
void TriggerRedraw(const Microsoft::Console::Types::Viewport& viewport);
void TriggerRedrawCursor(const til::point position);
void TriggerRedrawAll();
void TriggerScroll();
void TriggerScroll(const til::point delta);
@@ -196,7 +232,7 @@ public:
size_t SpanLength(const til::point coordStart, const til::point coordEnd) const;
std::wstring GetPlainText(til::point start, til::point end) const;
std::wstring GetPlainText(const til::point& start, const til::point& end) const;
struct CopyRequest
{
@@ -283,8 +319,6 @@ public:
const bool isIntenseBold,
std::function<std::tuple<COLORREF, COLORREF, COLORREF>(const TextAttribute&)> GetAttributeColors) const noexcept;
void Serialize(const wchar_t* destination) const;
struct PositionInformation
{
til::CoordType mutableViewportTop{ 0 };
@@ -296,19 +330,16 @@ public:
std::vector<til::point_span> SearchText(const std::wstring_view& needle, bool caseInsensitive) const;
std::vector<til::point_span> SearchText(const std::wstring_view& needle, bool caseInsensitive, til::CoordType rowBeg, til::CoordType rowEnd) const;
// Mark handling
std::vector<ScrollMark> GetMarkRows() const;
std::vector<MarkExtents> GetMarkExtents(size_t limit = SIZE_T_MAX) const;
const std::vector<ScrollMark>& GetMarks() const noexcept;
void ClearMarksInRange(const til::point start, const til::point end);
void ClearAllMarks();
std::wstring CurrentCommand() const;
std::vector<std::wstring> Commands() const;
void StartPrompt();
bool StartCommand();
bool StartOutput();
void EndCurrentCommand(std::optional<unsigned int> error);
void SetScrollbarData(ScrollbarData mark, til::CoordType y);
void ManuallyMarkRowAsPrompt(til::CoordType y);
void ClearAllMarks() noexcept;
void ScrollMarks(const int delta);
void StartPromptMark(const ScrollMark& m);
void AddMark(const ScrollMark& m);
void SetCurrentPromptEnd(const til::point pos) noexcept;
void SetCurrentCommandEnd(const til::point pos) noexcept;
void SetCurrentOutputEnd(const til::point pos, ::MarkCategory category) noexcept;
std::wstring_view CurrentCommand() const;
private:
void _reserve(til::size screenBufferSize, const TextAttribute& defaultAttributes);
@@ -333,11 +364,7 @@ private:
til::point _GetWordEndForAccessibility(const til::point target, const std::wstring_view wordDelimiters, const til::point limit) const;
til::point _GetWordEndForSelection(const til::point target, const std::wstring_view wordDelimiters) const;
void _PruneHyperlinks();
std::wstring _commandForRow(const til::CoordType rowOffset, const til::CoordType bottomInclusive) const;
MarkExtents _scrollMarkExtentForRow(const til::CoordType rowOffset, const til::CoordType bottomInclusive) const;
bool _createPromptMarkIfNeeded();
void _trimMarksOutsideBuffer();
std::tuple<til::CoordType, til::CoordType, bool> _RowCopyHelper(const CopyRequest& req, const til::CoordType iRow, const ROW& row) const;
static void _AppendRTFText(std::string& contentBuilder, const std::wstring_view& text);
@@ -410,6 +437,7 @@ private:
uint64_t _lastMutationId = 0;
Cursor _cursor;
std::vector<ScrollMark> _marks;
bool _isActiveBuffer = false;
#ifdef UNIT_TESTING

View File

@@ -25,8 +25,7 @@ TextBufferTextIterator::TextBufferTextIterator(const TextBufferCellIterator& cel
// Return Value:
// - Read only UTF-16 text data
// TODO GH 2682, fix design so this doesn't have to be suppressed.
GSL_SUPPRESS(26434)
const std::wstring_view TextBufferTextIterator::operator*() const noexcept
[[gsl::suppress(26434)]] const std::wstring_view TextBufferTextIterator::operator*() const noexcept
{
return _view.Chars();
}
@@ -36,8 +35,7 @@ const std::wstring_view TextBufferTextIterator::operator*() const noexcept
// Return Value:
// - Read only UTF-16 text data
// TODO GH 2682, fix design so this doesn't have to be suppressed.
GSL_SUPPRESS(26434)
const std::wstring_view* TextBufferTextIterator::operator->() const noexcept
[[gsl::suppress(26434)]] const std::wstring_view* TextBufferTextIterator::operator->() const noexcept
{
return &_view.Chars();
}

View File

@@ -41,7 +41,7 @@ class UTextAdapterTests
RowWriteState state{
.text = L"abc 𝒶𝒷𝒸 abc ネコちゃん",
};
buffer.Replace(0, TextAttribute{}, state);
buffer.Write(0, TextAttribute{}, state);
VERIFY_IS_TRUE(state.text.empty());
static constexpr auto s = [](til::CoordType beg, til::CoordType end) -> til::point_span {

View File

@@ -166,7 +166,7 @@
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>Τĥз Йéщ Ẃįńđôẃѕ Тéѓmĩиâļ !!! !!! !</value>
<value>Τнĕ Ņëω Ẅίηđŏẃś Ťėŗmįйάĺ !!! !!! !</value>
</data>
<data name="AppDescriptionDev" xml:space="preserve">
<value>The Windows Terminal, but Unofficial</value>
@@ -177,22 +177,22 @@
<comment>{Locked}</comment>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Щΐňδόŵѕ Ŧęřмĭʼnäℓ ẅîťħ à φřеνίëẃ θƒ џрсøмΐʼnğ ƒĕāŧųřэś !!! !!! !!! !!! !!! </value>
<value>Ŵíňďōẁŝ Тєřмīπǻļ ωїτĥ å ρѓēνіéŵ θƒ ũφсőмϊπġ ƒєąτΰґёѕ !!! !!! !!! !!! !!! </value>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
<value>Open in Terminal (&amp;Dev)</value>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Canary" xml:space="preserve">
<value>Θρēņ ïη Ţéгmĭηäŀ (&amp;Çäņдѓγ) !!! !!! !</value>
<value>Ŏрέи ìη Тèřmīŋªŀ (&amp;Cãńãґγ) !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Όрèп ìņ Ţêŕmїʼnåļ &amp;Рѓзνι℮ω !!! !!! !</value>
<value>Φφєň ΐñ Ŧéгмϊñаľ &amp;Pŕėνĭώ !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
<value>Óрêп ìл &amp;Ťěѓmιиåĺ !!! !!</value>
<value>Ωρєⁿ ïπ &amp;Těѓmĭñäĺ !!! !!</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
</root>

View File

@@ -166,7 +166,7 @@
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>Τĥз Йéщ Ẃįńđôẃѕ Тéѓmĩиâļ !!! !!! !</value>
<value>Ťĥё Ñēщ Шίⁿðоẅś Ťėгмîήāľ !!! !!! !</value>
</data>
<data name="AppDescriptionDev" xml:space="preserve">
<value>The Windows Terminal, but Unofficial</value>
@@ -177,22 +177,22 @@
<comment>{Locked}</comment>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Щΐňδόŵѕ Ŧęřмĭʼnäℓ ẅîťħ à φřеνίëẃ θƒ џрсøмΐʼnğ ƒĕāŧųřэś !!! !!! !!! !!! !!! </value>
<value>Шίηđóŵš Ŧĕяmїйà ẁітħ ª φяęνîёщ όƒ ûφĉбмíήĝ ƒêåťµřεŝ !!! !!! !!! !!! !!! </value>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
<value>Open in Terminal (&amp;Dev)</value>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Canary" xml:space="preserve">
<value>Θρēņ ïη Ţéгmĭηäŀ (&amp;Çäņдѓγ) !!! !!! !</value>
<value>Óрëπ íи Ťēяmілǻŀ (&amp;Cäηàřÿ) !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Όрèп ìņ Ţêŕmїʼnåļ &amp;Рѓзνι℮ω !!! !!! !</value>
<value>Óрзń ΐή Ŧěґмιлāℓ &amp;Pѓéνīĕω !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
<value>Óрêп ìл &amp;Ťěѓmιиåĺ !!! !!</value>
<value>Ôрëη ïп &amp;Tēѓмϊŋãł !!! !!</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
</root>

View File

@@ -166,7 +166,7 @@
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>Τĥз Йéщ Ẃįńđôẃѕ Тéѓmĩиâļ !!! !!! !</value>
<value>Тĥё Ńēẁ Шіπđοωš Тěřмιňαŀ !!! !!! !</value>
</data>
<data name="AppDescriptionDev" xml:space="preserve">
<value>The Windows Terminal, but Unofficial</value>
@@ -177,22 +177,22 @@
<comment>{Locked}</comment>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Щΐňδόŵѕ Ŧęřмĭʼnäℓ ẅîťħ à φřеνίëẃ θƒ џрсøмΐʼnğ ƒĕāŧųřэś !!! !!! !!! !!! !!! </value>
<value>Шίήďŏшś Ŧêямĩňāľ ŵíτн ă ρѓëνιêω øƒ ũρčŏмįηğ ƒєáţũŗêš !!! !!! !!! !!! !!! </value>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
<value>Open in Terminal (&amp;Dev)</value>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Canary" xml:space="preserve">
<value>Θρēņ ïη Ţéгmĭηäŀ (&amp;Çäņдѓγ) !!! !!! !</value>
<value>Фφěй ĩń Тêřmιπâł (&amp;Cãⁿǻřу) !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Όрèп ìņ Ţêŕmїʼnåļ &amp;Рѓзνι℮ω !!! !!! !</value>
<value>Óφ℮ʼn ΐŋ Τėřmīйäĺ &amp;Pяєνϊëẃ !!! !!! !</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
<value>Óрêп ìл &amp;Ťěѓmιиåĺ !!! !!</value>
<value>Ορέл ϊŋ &amp;Téŕmįñā !!! !!</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
</root>

View File

@@ -30,4 +30,15 @@ namespace Microsoft.Terminal.TerminalConnection
Guid SessionId { get; };
ConnectionState State { get; };
};
interface ITerminalConnectionWithWindow
{
void ShowHide(Boolean show);
void ReparentWindow(UInt64 newParent);
};
interface ITerminalConnectionWithBufferState
{
void ClearBuffer();
};
}

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{EFC0B7EF-BB0D-44EC-BFC9-772AE4391D17}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>Microsoft.Terminal.Connection.Interfaces</ProjectName>
<TargetName>Microsoft.Terminal.Connection.Interfaces</TargetName>
<ConfigurationType>Utility</ConfigurationType>
<RootNamespace>Microsoft.Terminal.TerminalConnection</RootNamespace>
<TerminalMidlRT>true</TerminalMidlRT>
<!-- Force our output directory -->
<OpenConsoleCppWinRTProject>true</OpenConsoleCppWinRTProject>
</PropertyGroup>
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
<Import Project="$(OpenConsoleDir)src\common.build.pre.props" />
<ItemGroup>
<Midl Include="ITerminalConnection.idl" />
</ItemGroup>
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(OpenConsoleDir)src\common.build.post.props" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
</Project>

View File

@@ -59,10 +59,10 @@ namespace Microsoft.Terminal.Core
// Same thing here, but with padding. Can't use Windows.UI.Thickness, so
// we'll declare our own.
struct Padding {
Single Left;
Single Top;
Single Right;
Single Bottom;
Double Left;
Double Top;
Double Right;
Double Bottom;
};
// This is a projection of Microsoft::Terminal::Core::ControlKeyStates,

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "..\ICoreAppearance.idl";
import "ICoreAppearance.idl";
namespace Microsoft.Terminal.Core
{
@@ -22,6 +22,7 @@ namespace Microsoft.Terminal.Core
Boolean ForceVTInput;
Boolean TrimBlockSelection;
Boolean DetectURLs;
Boolean VtPassthrough;
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> TabColor;
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> StartingTabColor;

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{40503EDC-E3E4-46AB-BC26-D293B956CAE8}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>Microsoft.Terminal.Core.Interfaces</ProjectName>
<TargetName>Microsoft.Terminal.Core.Interfaces</TargetName>
<ConfigurationType>Utility</ConfigurationType>
<RootNamespace>Microsoft.Terminal.Core</RootNamespace>
<TerminalMidlRT>true</TerminalMidlRT>
<!-- Force our output directory -->
<OpenConsoleCppWinRTProject>true</OpenConsoleCppWinRTProject>
</PropertyGroup>
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
<Import Project="$(OpenConsoleDir)src\common.build.pre.props" />
<ItemGroup>
<Midl Include="ICoreSettings.idl" />
<Midl Include="ICoreAppearance.idl" />
</ItemGroup>
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(OpenConsoleDir)src\common.build.post.props" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
</Project>

View File

@@ -381,15 +381,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
auto myCommand = terminalArgs.Commandline();
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
auto myCommand = myArgs.TerminalArgs().Commandline();
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg \"", myCommand);
}
{
@@ -398,15 +397,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
auto myCommand = terminalArgs.Commandline();
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
auto myCommand = myArgs.TerminalArgs().Commandline();
VERIFY_ARE_EQUAL(L"\" with spaces\"", myCommand);
}
}
@@ -423,15 +421,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
auto myCommand = terminalArgs.Commandline();
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
auto myCommand = myArgs.TerminalArgs().Commandline();
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg ; with spaces\"", myCommand);
}
}
@@ -471,15 +468,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -493,16 +489,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -516,16 +511,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_FALSE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"c:\\Foo", terminalArgs.StartingDirectory());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_FALSE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"c:\\Foo", myArgs.TerminalArgs().StartingDirectory());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -539,16 +533,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", terminalArgs.Commandline());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", myArgs.TerminalArgs().Commandline());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -562,17 +555,16 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
auto myCommand = terminalArgs.Commandline();
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
auto myCommand = myArgs.TerminalArgs().Commandline();
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg with spaces\"", myCommand);
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -586,17 +578,16 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
auto myCommand = terminalArgs.Commandline();
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
auto myCommand = myArgs.TerminalArgs().Commandline();
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg with spaces\" another-arg \"more spaces in this one\"", myCommand);
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -610,16 +601,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"Windows PowerShell", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"Windows PowerShell", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -633,15 +623,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", terminalArgs.Commandline());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", myArgs.TerminalArgs().Commandline());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -655,17 +644,16 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"1", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"1", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -681,16 +669,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NOT_NULL(terminalArgs.TabColor());
VERIFY_ARE_EQUAL(til::color(terminalArgs.TabColor().Value()), expectedColor);
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_ARE_EQUAL(til::color(myArgs.TerminalArgs().TabColor().Value()), expectedColor);
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -706,16 +693,15 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_FALSE(terminalArgs.ColorScheme().empty());
VERIFY_ARE_EQUAL(expectedScheme, terminalArgs.ColorScheme());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_IS_FALSE(myArgs.TerminalArgs().ColorScheme().empty());
VERIFY_ARE_EQUAL(expectedScheme, myArgs.TerminalArgs().ColorScheme());
}
}
@@ -746,8 +732,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(SplitType::Manual, myArgs.SplitMode());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -767,8 +752,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Down, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(SplitType::Manual, myArgs.SplitMode());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -790,8 +774,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Right, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(SplitType::Manual, myArgs.SplitMode());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -812,8 +795,7 @@ namespace TerminalAppLocalTests
auto myArgs = actionAndArgs.Args().try_as<SplitPaneArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitType::Duplicate, myArgs.SplitMode());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -833,17 +815,16 @@ namespace TerminalAppLocalTests
auto myArgs = actionAndArgs.Args().try_as<SplitPaneArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"1", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"1", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -863,17 +844,16 @@ namespace TerminalAppLocalTests
auto myArgs = actionAndArgs.Args().try_as<SplitPaneArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Down, myArgs.SplitDirection());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"1", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"1", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -893,17 +873,16 @@ namespace TerminalAppLocalTests
auto myArgs = actionAndArgs.Args().try_as<SplitPaneArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine -H", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"1", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"wsl -d Alpine -H", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"1", myArgs.TerminalArgs().Profile());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ColorScheme().empty());
}
}
@@ -944,14 +923,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
}
{
AppCommandlineArgs appArgs{};
@@ -965,15 +943,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", myArgs.TerminalArgs().Profile());
}
{
AppCommandlineArgs appArgs{};
@@ -987,15 +964,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_FALSE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"c:\\Foo", terminalArgs.StartingDirectory());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_FALSE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"c:\\Foo", myArgs.TerminalArgs().StartingDirectory());
}
{
AppCommandlineArgs appArgs{};
@@ -1009,15 +985,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", myArgs.TerminalArgs().Commandline());
}
{
AppCommandlineArgs appArgs{};
@@ -1031,15 +1006,14 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg with spaces\"", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe \"This is an arg with spaces\"", myArgs.TerminalArgs().Commandline());
}
}
@@ -1495,38 +1469,32 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(2u, appArgs._startupActions.size());
{
auto actionAndArgs = appArgs._startupActions.at(0);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
}
auto actionAndArgs = appArgs._startupActions.at(0);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
{
auto actionAndArgs = appArgs._startupActions.at(1);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"slpit-pane", terminalArgs.Commandline());
}
actionAndArgs = appArgs._startupActions.at(1);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"slpit-pane", myArgs.TerminalArgs().Commandline());
}
{
@@ -1543,9 +1511,8 @@ namespace TerminalAppLocalTests
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_ARE_EQUAL(L"slpit-pane -H", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_ARE_EQUAL(L"slpit-pane -H", myArgs.TerminalArgs().Commandline());
}
}
@@ -1563,10 +1530,9 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_ARE_EQUAL(L"wsl -d Alpine", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"C:\\", terminalArgs.StartingDirectory());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_ARE_EQUAL(L"wsl -d Alpine", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"C:\\", myArgs.TerminalArgs().StartingDirectory());
}
{ // two parsing terminators, new-tab command
AppCommandlineArgs appArgs{};
@@ -1580,10 +1546,9 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_ARE_EQUAL(L"wsl -d Alpine -- sleep 10", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"C:\\", terminalArgs.StartingDirectory());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_ARE_EQUAL(L"wsl -d Alpine -- sleep 10", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"C:\\", myArgs.TerminalArgs().StartingDirectory());
}
{ // two parsing terminators, *no* command
AppCommandlineArgs appArgs{};
@@ -1597,10 +1562,9 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_ARE_EQUAL(L"wsl -d Alpine -- sleep 10", terminalArgs.Commandline());
VERIFY_ARE_EQUAL(L"C:\\", terminalArgs.StartingDirectory());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_ARE_EQUAL(L"wsl -d Alpine -- sleep 10", myArgs.TerminalArgs().Commandline());
VERIFY_ARE_EQUAL(L"C:\\", myArgs.TerminalArgs().StartingDirectory());
}
}
@@ -1614,14 +1578,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
}
void CommandlineTest::TestMultipleCommandExecuteCommandlineAction()
@@ -1635,14 +1598,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
}
{
auto actionAndArgs = actions.at(1);
@@ -1650,14 +1612,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<SplitPaneArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_NULL(myArgs.TerminalArgs().TabColor());
VERIFY_IS_NULL(myArgs.TerminalArgs().ProfileIndex());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
}
}
@@ -1778,14 +1739,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_TRUE(terminalArgs.ProfileIndex() == nullptr);
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_TRUE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ProfileIndex() == nullptr);
VERIFY_IS_FALSE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"cmd", myArgs.TerminalArgs().Profile());
}
{
Log::Comment(NoThrowString().Format(L"Pass a launch mode and command line"));
@@ -1803,14 +1763,13 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_TRUE(terminalArgs.ProfileIndex() == nullptr);
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
VERIFY_IS_FALSE(myArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_TRUE(myArgs.TerminalArgs().ProfileIndex() == nullptr);
VERIFY_IS_TRUE(myArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"powershell.exe", myArgs.TerminalArgs().Commandline());
}
}
@@ -1841,8 +1800,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.5f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -1862,8 +1820,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.3f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
AppCommandlineArgs appArgs{};
@@ -1884,8 +1841,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.3f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
auto actionAndArgs = appArgs._startupActions.at(2);
@@ -1895,8 +1851,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.5f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
}
{
@@ -1918,8 +1873,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.3f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
{
auto actionAndArgs = appArgs._startupActions.at(2);
@@ -1929,8 +1883,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(SplitDirection::Automatic, myArgs.SplitDirection());
VERIFY_ARE_EQUAL(0.7f, myArgs.SplitSize());
auto terminalArgs{ myArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_NOT_NULL(myArgs.TerminalArgs());
}
}
}

View File

@@ -176,13 +176,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
@@ -202,13 +201,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
}
{
@@ -222,13 +220,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", realArgs.TerminalArgs().Profile());
}
{
@@ -242,13 +239,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
}
}
@@ -306,13 +302,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
@@ -333,13 +328,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
}
{
@@ -354,13 +348,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", realArgs.TerminalArgs().Profile());
}
{
@@ -375,13 +368,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
}
}
@@ -441,13 +433,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
@@ -468,13 +459,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
}
{
@@ -489,13 +479,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1\"", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1\"", realArgs.TerminalArgs().Profile());
}
{
@@ -510,13 +499,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
}
}
@@ -704,13 +692,12 @@ namespace TerminalAppLocalTests
const auto& realArgs = childActionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"ssh me@first.com", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"ssh me@first.com", realArgs.TerminalArgs().Commandline());
VERIFY_IS_FALSE(child.HasNestedCommands());
}
@@ -725,13 +712,12 @@ namespace TerminalAppLocalTests
const auto& realArgs = childActionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_FALSE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_TRUE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"ssh me@second.com", terminalArgs.Commandline());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"ssh me@second.com", realArgs.TerminalArgs().Commandline());
VERIFY_IS_FALSE(child.HasNestedCommands());
}
@@ -832,13 +818,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -854,13 +839,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Down, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -876,13 +860,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Right, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -968,13 +951,12 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(command.HasNestedCommands());
}
@@ -1087,13 +1069,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -1109,13 +1090,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Down, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -1131,13 +1111,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Right, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(name, terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(name, realArgs.TerminalArgs().Profile());
VERIFY_IS_FALSE(childCommand.HasNestedCommands());
}
@@ -1266,13 +1245,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"${scheme.name}", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"${scheme.name}", realArgs.TerminalArgs().Profile());
}
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
@@ -1296,13 +1274,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"Campbell", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"Campbell", realArgs.TerminalArgs().Profile());
}
{
@@ -1317,13 +1294,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"Campbell PowerShell", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"Campbell PowerShell", realArgs.TerminalArgs().Profile());
}
{
@@ -1338,13 +1314,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
VERIFY_ARE_EQUAL(SplitDirection::Automatic, realArgs.SplitDirection());
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"Vintage", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"Vintage", realArgs.TerminalArgs().Profile());
}
}
@@ -1410,16 +1385,15 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
VERIFY_IS_NULL(realArgs.TerminalArgs().Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
@@ -1433,16 +1407,15 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", realArgs.TerminalArgs().Profile());
VERIFY_IS_NULL(realArgs.TerminalArgs().Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
@@ -1456,16 +1429,15 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
VERIFY_IS_NULL(realArgs.TerminalArgs().Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
@@ -1480,17 +1452,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
@@ -1504,17 +1475,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
@@ -1528,17 +1498,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
@@ -1553,17 +1522,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile0", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
@@ -1576,17 +1544,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile1", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
@@ -1600,17 +1567,16 @@ namespace TerminalAppLocalTests
const auto& realArgs = actionAndArgs.Args().try_as<NewTabArgs>();
VERIFY_IS_NOT_NULL(realArgs);
// Verify the args have the expected value
auto terminalArgs{ realArgs.ContentArgs().try_as<NewTerminalArgs>() };
VERIFY_IS_NOT_NULL(terminalArgs);
VERIFY_IS_TRUE(terminalArgs.Commandline().empty());
VERIFY_IS_TRUE(terminalArgs.StartingDirectory().empty());
VERIFY_IS_TRUE(terminalArgs.TabTitle().empty());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Commandline().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().StartingDirectory().empty());
VERIFY_IS_TRUE(realArgs.TerminalArgs().TabTitle().empty());
VERIFY_IS_FALSE(realArgs.TerminalArgs().Profile().empty());
VERIFY_ARE_EQUAL(L"profile2", realArgs.TerminalArgs().Profile());
VERIFY_IS_NOT_NULL(realArgs.TerminalArgs().Elevate());
VERIFY_IS_TRUE(realArgs.TerminalArgs().Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, realArgs.TerminalArgs(), nullptr);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());

View File

@@ -1326,7 +1326,7 @@ namespace TerminalAppLocalTests
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1344,7 +1344,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, controlSettings.DefaultBackground());
// And we should have stored a function to revert the change.
VERIFY_ARE_EQUAL(1u, page->_restorePreviewFuncs.size());
@@ -1366,7 +1366,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, controlSettings.DefaultBackground());
// After preview there should be no more restore functions to execute.
VERIFY_ARE_EQUAL(0u, page->_restorePreviewFuncs.size());
@@ -1394,7 +1394,7 @@ namespace TerminalAppLocalTests
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1412,7 +1412,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1428,7 +1428,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be the same as it originally was");
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, controlSettings.DefaultBackground());
});
Log::Comment(L"Sleep to let events propagate");
Sleep(250);
@@ -1450,7 +1450,7 @@ namespace TerminalAppLocalTests
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1467,7 +1467,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1484,7 +1484,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, controlSettings.DefaultBackground());
});
TestOnUIThread([&page]() {
@@ -1503,7 +1503,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed");
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, controlSettings.DefaultBackground());
});
Log::Comment(L"Sleep to let events propagate");
Sleep(250);

View File

@@ -56,8 +56,6 @@ Author(s):
#include <winrt/windows.applicationmodel.core.h>
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
#include <winrt/Microsoft.Terminal.Core.h>
#include <winrt/Microsoft.Terminal.Control.h>
#include <winrt/Microsoft.Terminal.Settings.Model.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>

View File

@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "GetWindowLayoutArgs.h"
#include "GetWindowLayoutArgs.g.cpp"

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Class Name:
- GetWindowLayoutArgs.h
Abstract:
- This is a helper class for getting the window layout from a peasant.
Depending on if we are running on the monarch or on a peasant we might need
to switch what thread we are executing on. This gives us the option of
either returning the json result synchronously, or as a promise.
--*/
#pragma once
#include "GetWindowLayoutArgs.g.h"
namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct GetWindowLayoutArgs : public GetWindowLayoutArgsT<GetWindowLayoutArgs>
{
WINRT_PROPERTY(winrt::hstring, WindowLayoutJson, L"");
WINRT_PROPERTY(winrt::Windows::Foundation::IAsyncOperation<winrt::hstring>, WindowLayoutJsonAsync, nullptr)
};
}
namespace winrt::Microsoft::Terminal::Remoting::factory_implementation
{
BASIC_FACTORY(GetWindowLayoutArgs);
}

View File

@@ -37,6 +37,12 @@
<ClInclude Include="WindowActivatedArgs.h">
<DependentUpon>Peasant.idl</DependentUpon>
</ClInclude>
<ClInclude Include="GetWindowLayoutArgs.h">
<DependentUpon>Peasant.idl</DependentUpon>
</ClInclude>
<ClInclude Include="QuitAllRequestedArgs.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="MonarchFactory.h" />
<ClInclude Include="Peasant.h">
@@ -72,6 +78,12 @@
<ClCompile Include="WindowActivatedArgs.cpp">
<DependentUpon>Peasant.idl</DependentUpon>
</ClCompile>
<ClCompile Include="GetWindowLayoutArgs.cpp">
<DependentUpon>Peasant.idl</DependentUpon>
</ClCompile>
<ClCompile Include="QuitAllRequestedArgs.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>

View File

@@ -6,6 +6,7 @@
#include "Monarch.h"
#include "CommandlineArgs.h"
#include "FindTargetWindowArgs.h"
#include "QuitAllRequestedArgs.h"
#include "ProposeCommandlineResult.h"
#include "Monarch.g.cpp"
@@ -94,8 +95,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
peasant.IdentifyWindowsRequested({ this, &Monarch::_identifyWindows });
peasant.RenameRequested({ this, &Monarch::_renameRequested });
peasant.ShowNotificationIconRequested([this](auto&&, auto&&) { ShowNotificationIconRequested.raise(*this, nullptr); });
peasant.HideNotificationIconRequested([this](auto&&, auto&&) { HideNotificationIconRequested.raise(*this, nullptr); });
peasant.ShowNotificationIconRequested([this](auto&&, auto&&) { _ShowNotificationIconRequestedHandlers(*this, nullptr); });
peasant.HideNotificationIconRequested([this](auto&&, auto&&) { _HideNotificationIconRequestedHandlers(*this, nullptr); });
peasant.QuitAllRequested({ this, &Monarch::_handleQuitAll });
{
@@ -110,7 +111,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
WindowCreated.raise(nullptr, nullptr);
_WindowCreatedHandlers(nullptr, nullptr);
return newPeasantsId;
}
catch (...)
@@ -134,13 +135,21 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// - <none> used
// Return Value:
// - <none>
void Monarch::_handleQuitAll(const winrt::Windows::Foundation::IInspectable& /*sender*/, const winrt::Windows::Foundation::IInspectable& /*args*/)
winrt::fire_and_forget Monarch::_handleQuitAll(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Windows::Foundation::IInspectable& /*args*/)
{
if (_quitting.exchange(true, std::memory_order_relaxed))
// Let the process hosting the monarch run any needed logic before
// closing all windows.
auto args = winrt::make_self<implementation::QuitAllRequestedArgs>();
_QuitAllRequestedHandlers(*this, *args);
if (const auto action = args->BeforeQuitAllAction())
{
return;
co_await action;
}
_quitting.store(true);
// Tell all peasants to exit.
const auto callback = [&](const auto& id, const auto& p) {
// We want to tell our peasant to quit last, so that we don't try
// to perform a bunch of elections on quit.
@@ -188,7 +197,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// If we are quitting we don't care about maintaining our list of
// peasants anymore, and don't need to notify the host that something
// changed.
if (_quitting.load(std::memory_order_relaxed))
if (_quitting.load(std::memory_order_acquire))
{
return;
}
@@ -198,7 +207,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
std::unique_lock lock{ _peasantsMutex };
_peasants.erase(peasantId);
}
WindowClosed.raise(nullptr, nullptr);
_WindowClosedHandlers(nullptr, nullptr);
}
// Method Description:
@@ -641,7 +650,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
auto findWindowArgs{ winrt::make_self<Remoting::implementation::FindTargetWindowArgs>(args) };
// This is handled by some handler in-proc
FindTargetWindowRequested.raise(*this, *findWindowArgs);
_FindTargetWindowRequestedHandlers(*this, *findWindowArgs);
// After the event was handled, ResultTargetWindow() will be filled with
// the parsed result.
@@ -732,7 +741,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
result->WindowName(targetWindowName);
result->ShouldCreateWindow(true);
RequestNewWindow.raise(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
_RequestNewWindowHandlers(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
// If this fails, it'll be logged in the following
// TraceLoggingWrite statement, with succeeded=false
@@ -770,7 +779,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
result->Id(windowID);
result->WindowName(targetWindowName);
RequestNewWindow.raise(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
_RequestNewWindowHandlers(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
return *result;
}
@@ -787,7 +796,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
auto result = winrt::make_self<Remoting::implementation::ProposeCommandlineResult>(true);
result->WindowName(targetWindowName);
RequestNewWindow.raise(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
_RequestNewWindowHandlers(*this, *winrt::make_self<WindowRequestedArgs>(*result, args));
return *result;
}
@@ -1027,6 +1036,30 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
_forEachPeasant(func, onError);
}
// Method Description:
// - Ask all peasants to return their window layout as json
// Arguments:
// - <none>
// Return Value:
// - The collection of window layouts from each peasant.
Windows::Foundation::Collections::IVector<winrt::hstring> Monarch::GetAllWindowLayouts()
{
std::vector<winrt::hstring> vec;
auto callback = [&](const auto& /*id*/, const auto& p) {
vec.emplace_back(p.GetWindowLayout());
};
auto onError = [](auto&& id) {
TraceLoggingWrite(g_hRemotingProvider,
"Monarch_GetAllWindowLayouts_Failed",
TraceLoggingInt64(id, "peasantID", "The ID of the peasant which we could not get a window layout from"),
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
};
_forEachPeasant(callback, onError);
return winrt::single_threaded_vector(std::move(vec));
}
void Monarch::RequestMoveContent(winrt::hstring window,
winrt::hstring content,
uint32_t tabIndex,
@@ -1082,7 +1115,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
auto request = winrt::make_self<implementation::WindowRequestedArgs>(nameIsReserved ? L"" : window,
content,
windowBounds);
RequestNewWindow.raise(*this, *request);
_RequestNewWindowHandlers(*this, *request);
}
}

View File

@@ -96,17 +96,19 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
void SummonAllWindows();
bool DoesQuakeWindowExist();
Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Terminal::Remoting::PeasantInfo> GetPeasantInfos();
Windows::Foundation::Collections::IVector<winrt::hstring> GetAllWindowLayouts();
void RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex, const Windows::Foundation::IReference<Windows::Foundation::Rect>& windowBounds);
void RequestSendContent(const Remoting::RequestReceiveContentArgs& args);
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs> FindTargetWindowRequested;
til::typed_event<> ShowNotificationIconRequested;
til::typed_event<> HideNotificationIconRequested;
til::typed_event<> WindowCreated;
til::typed_event<> WindowClosed;
TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);
TYPED_EVENT(ShowNotificationIconRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(HideNotificationIconRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(WindowCreated, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(WindowClosed, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(QuitAllRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::QuitAllRequestedArgs);
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs> RequestNewWindow;
TYPED_EVENT(RequestNewWindow, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs);
private:
uint64_t _ourPID;
@@ -144,8 +146,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
void _renameRequested(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Microsoft::Terminal::Remoting::RenameRequestArgs& args);
void _handleQuitAll(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Windows::Foundation::IInspectable& args);
winrt::fire_and_forget _handleQuitAll(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Windows::Foundation::IInspectable& args);
// Method Description:
// - Helper for doing something on each and every peasant.
@@ -221,7 +223,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// A peasant died, let the app host know that the number of
// windows has changed.
WindowClosed.raise(nullptr, nullptr);
_WindowClosedHandlers(nullptr, nullptr);
}
}

View File

@@ -46,6 +46,11 @@ namespace Microsoft.Terminal.Remoting
Windows.Foundation.IReference<UInt64> WindowID;
}
[default_interface] runtimeclass QuitAllRequestedArgs {
QuitAllRequestedArgs();
Windows.Foundation.IAsyncAction BeforeQuitAllAction;
}
struct PeasantInfo
{
UInt64 Id;
@@ -67,6 +72,7 @@ namespace Microsoft.Terminal.Remoting
void SummonAllWindows();
Boolean DoesQuakeWindowExist();
Windows.Foundation.Collections.IVectorView<PeasantInfo> GetPeasantInfos { get; };
Windows.Foundation.Collections.IVector<String> GetAllWindowLayouts();
void RequestMoveContent(String window, String content, UInt32 tabIndex, Windows.Foundation.IReference<Windows.Foundation.Rect> bounds);
void RequestSendContent(RequestReceiveContentArgs args);
@@ -76,6 +82,7 @@ namespace Microsoft.Terminal.Remoting
event Windows.Foundation.TypedEventHandler<Object, Object> HideNotificationIconRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> WindowCreated;
event Windows.Foundation.TypedEventHandler<Object, Object> WindowClosed;
event Windows.Foundation.TypedEventHandler<Object, QuitAllRequestedArgs> QuitAllRequested;
event Windows.Foundation.TypedEventHandler<Object, WindowRequestedArgs> RequestNewWindow;
};

View File

@@ -5,6 +5,7 @@
#include "Peasant.h"
#include "CommandlineArgs.h"
#include "SummonWindowBehavior.h"
#include "GetWindowLayoutArgs.h"
#include "Peasant.g.cpp"
#include "../../types/inc/utils.hpp"
#include "AttachRequest.g.cpp"
@@ -66,7 +67,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// Raise an event with these args. The AppHost will listen for this
// event to know when to take these args and dispatch them to a
// currently-running window.
ExecuteCommandlineRequested.raise(*this, args);
_ExecuteCommandlineRequestedHandlers(*this, args);
return true;
}
@@ -96,7 +97,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// by the monarch. The monarch might have died. If they have, this
// will throw an exception. Just eat it, the election thread will
// handle hooking up the new one.
WindowActivated.raise(*this, args);
_WindowActivatedHandlers(*this, args);
successfullyNotified = true;
}
catch (...)
@@ -145,7 +146,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
SummonRequested.raise(*this, localCopy);
_SummonRequestedHandlers(*this, localCopy);
}
// Method Description:
@@ -160,7 +161,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
// Not worried about try/catching this. The handler is in AppHost, which
// is in-proc for us.
DisplayWindowIdRequested.raise(*this, nullptr);
_DisplayWindowIdRequestedHandlers(*this, nullptr);
}
// Method Description:
@@ -181,7 +182,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// by the monarch. The monarch might have died. If they have, this
// will throw an exception. Just eat it, the election thread will
// handle hooking up the new one.
IdentifyWindowsRequested.raise(*this, nullptr);
_IdentifyWindowsRequestedHandlers(*this, nullptr);
successfullyNotified = true;
}
catch (...)
@@ -206,7 +207,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// by the monarch. The monarch might have died. If they have, this
// will throw an exception. Just eat it, the election thread will
// handle hooking up the new one.
RenameRequested.raise(*this, args);
_RenameRequestedHandlers(*this, args);
if (args.Succeeded())
{
_WindowName = args.NewName();
@@ -232,7 +233,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
ShowNotificationIconRequested.raise(*this, nullptr);
_ShowNotificationIconRequestedHandlers(*this, nullptr);
}
catch (...)
{
@@ -248,7 +249,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
HideNotificationIconRequested.raise(*this, nullptr);
_HideNotificationIconRequestedHandlers(*this, nullptr);
}
catch (...)
{
@@ -264,7 +265,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
QuitAllRequested.raise(*this, nullptr);
_QuitAllRequestedHandlers(*this, nullptr);
}
catch (...)
{
@@ -280,7 +281,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
AttachRequested.raise(*this, request);
_AttachRequestedHandlers(*this, request);
}
catch (...)
{
@@ -296,7 +297,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
QuitRequested.raise(*this, nullptr);
_QuitRequestedHandlers(*this, nullptr);
}
catch (...)
{
@@ -308,8 +309,28 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
}
// Method Description:
// - Request and return the window layout from the current TerminalPage
// Arguments:
// - <none>
// Return Value:
// - the window layout as a json string
hstring Peasant::GetWindowLayout()
{
auto args = winrt::make_self<implementation::GetWindowLayoutArgs>();
_GetWindowLayoutRequestedHandlers(nullptr, *args);
if (const auto op = args->WindowLayoutJsonAsync())
{
// This will fail if called on the UI thread, so the monarch should
// never set WindowLayoutJsonAsync.
auto str = op.get();
return str;
}
return args->WindowLayoutJson();
}
void Peasant::SendContent(const Remoting::RequestReceiveContentArgs& args)
{
SendContentRequested.raise(*this, args);
_SendContentRequestedHandlers(*this, args);
}
}

View File

@@ -65,26 +65,28 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
winrt::Microsoft::Terminal::Remoting::CommandlineArgs InitialArgs();
winrt::hstring GetWindowLayout();
void SendContent(const winrt::Microsoft::Terminal::Remoting::RequestReceiveContentArgs& args);
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs> WindowActivated;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::CommandlineArgs> ExecuteCommandlineRequested;
til::typed_event<> IdentifyWindowsRequested;
til::typed_event<> DisplayWindowIdRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::RenameRequestArgs> RenameRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::SummonWindowBehavior> SummonRequested;
til::typed_event<> ShowNotificationIconRequested;
til::typed_event<> HideNotificationIconRequested;
til::typed_event<> QuitAllRequested;
til::typed_event<> QuitRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::AttachRequest> AttachRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::RequestReceiveContentArgs> SendContentRequested;
WINRT_PROPERTY(winrt::hstring, WindowName);
WINRT_PROPERTY(winrt::hstring, ActiveTabTitle);
TYPED_EVENT(WindowActivated, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs);
TYPED_EVENT(ExecuteCommandlineRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::CommandlineArgs);
TYPED_EVENT(IdentifyWindowsRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(DisplayWindowIdRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(RenameRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::RenameRequestArgs);
TYPED_EVENT(SummonRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::SummonWindowBehavior);
TYPED_EVENT(ShowNotificationIconRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(HideNotificationIconRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(QuitAllRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(QuitRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(GetWindowLayoutRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::GetWindowLayoutArgs);
TYPED_EVENT(AttachRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::AttachRequest);
TYPED_EVENT(SendContentRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::RequestReceiveContentArgs);
private:
Peasant(const uint64_t testPID);
uint64_t _ourPID;

View File

@@ -32,6 +32,12 @@ namespace Microsoft.Terminal.Remoting
Windows.Foundation.DateTime ActivatedTime { get; };
};
[default_interface] runtimeclass GetWindowLayoutArgs {
GetWindowLayoutArgs();
String WindowLayoutJson;
Windows.Foundation.IAsyncOperation<String> WindowLayoutJsonAsync;
}
enum MonitorBehavior
{
InPlace,
@@ -82,6 +88,7 @@ namespace Microsoft.Terminal.Remoting
void RequestHideNotificationIcon();
void RequestQuitAll();
void Quit();
String GetWindowLayout();
void AttachContentToWindow(AttachRequest request);
void SendContent(RequestReceiveContentArgs args);
@@ -95,6 +102,7 @@ namespace Microsoft.Terminal.Remoting
event Windows.Foundation.TypedEventHandler<Object, Object> ShowNotificationIconRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> HideNotificationIconRequested;
event Windows.Foundation.TypedEventHandler<Object, GetWindowLayoutArgs> GetWindowLayoutRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> QuitAllRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> QuitRequested;

View File

@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "QuitAllRequestedArgs.h"
#include "QuitAllRequestedArgs.g.cpp"

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Class Name:
- QuitAllRequestedArgs.h
Abstract:
- This is a helper class for allowing the monarch to run code before telling all
peasants to quit. This way the monarch can raise an event and get back a future
to wait for before continuing.
--*/
#pragma once
#include "QuitAllRequestedArgs.g.h"
namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct QuitAllRequestedArgs : public QuitAllRequestedArgsT<QuitAllRequestedArgs>
{
WINRT_PROPERTY(winrt::Windows::Foundation::IAsyncAction, BeforeQuitAllAction, nullptr)
};
}
namespace winrt::Microsoft::Terminal::Remoting::factory_implementation
{
BASIC_FACTORY(QuitAllRequestedArgs);
}

View File

@@ -89,9 +89,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// done when we become the king. This will be called both for the first
// window, and when the current monarch dies.
_monarch.WindowCreated({ get_weak(), &WindowManager::_bubbleWindowCreated });
_monarch.WindowClosed({ get_weak(), &WindowManager::_bubbleWindowClosed });
_monarch.WindowCreated({ get_weak(), &WindowManager::_WindowCreatedHandlers });
_monarch.WindowClosed({ get_weak(), &WindowManager::_WindowClosedHandlers });
_monarch.FindTargetWindowRequested({ this, &WindowManager::_raiseFindTargetWindowRequested });
_monarch.QuitAllRequested({ get_weak(), &WindowManager::_QuitAllRequestedHandlers });
_monarch.RequestNewWindow({ get_weak(), &WindowManager::_raiseRequestNewWindow });
}
@@ -108,12 +109,12 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
void WindowManager::_raiseFindTargetWindowRequested(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs& args)
{
FindTargetWindowRequested.raise(sender, args);
_FindTargetWindowRequestedHandlers(sender, args);
}
void WindowManager::_raiseRequestNewWindow(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs& args)
{
RequestNewWindow.raise(sender, args);
_RequestNewWindowHandlers(sender, args);
}
Remoting::ProposeCommandlineResult WindowManager::ProposeCommandline(const Remoting::CommandlineArgs& args, const bool isolatedMode)
@@ -161,7 +162,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
auto findWindowArgs{ winrt::make_self<Remoting::implementation::FindTargetWindowArgs>(args) };
// This is handled by some handler in-proc
FindTargetWindowRequested.raise(*this, *findWindowArgs);
_FindTargetWindowRequestedHandlers(*this, *findWindowArgs);
// After the event was handled, ResultTargetWindow() will be filled with
// the parsed result.
@@ -355,6 +356,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
_monarch.AddPeasant(*p);
p->GetWindowLayoutRequested({ get_weak(), &WindowManager::_GetWindowLayoutRequestedHandlers });
TraceLoggingWrite(g_hRemotingProvider,
"WindowManager_CreateOurPeasant",
TraceLoggingUInt64(p->GetID(), "peasantID", "The ID of our new peasant"),
@@ -364,15 +367,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
return *p;
}
void WindowManager::_bubbleWindowCreated(const winrt::Windows::Foundation::IInspectable& s, const winrt::Windows::Foundation::IInspectable& e)
{
WindowCreated.raise(s, e);
}
void WindowManager::_bubbleWindowClosed(const winrt::Windows::Foundation::IInspectable& s, const winrt::Windows::Foundation::IInspectable& e)
{
WindowClosed.raise(s, e);
}
void WindowManager::SignalClose(const Remoting::Peasant& peasant)
{
if (_monarch)
@@ -418,6 +412,18 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
return 0;
}
// Method Description:
// - Ask the monarch to quit all windows.
// Arguments:
// - <none>
// Return Value:
// - <none>
winrt::fire_and_forget WindowManager::RequestQuitAll(Remoting::Peasant peasant)
{
co_await winrt::resume_background();
peasant.RequestQuitAll();
}
bool WindowManager::DoesQuakeWindowExist()
{
return _monarch.DoesQuakeWindowExist();
@@ -428,6 +434,19 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
winrt::get_self<implementation::Peasant>(peasant)->ActiveTabTitle(title);
}
Windows::Foundation::Collections::IVector<winrt::hstring> WindowManager::GetAllWindowLayouts()
{
if (_monarch)
{
try
{
return _monarch.GetAllWindowLayouts();
}
CATCH_LOG()
}
return nullptr;
}
winrt::fire_and_forget WindowManager::RequestMoveContent(winrt::hstring window,
winrt::hstring content,
uint32_t tabIndex,

View File

@@ -38,18 +38,23 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
uint64_t GetNumberOfPeasants();
static winrt::fire_and_forget RequestQuitAll(Remoting::Peasant peasant);
void UpdateActiveTabTitle(const winrt::hstring& title, const Remoting::Peasant& peasant);
Windows::Foundation::Collections::IVector<winrt::hstring> GetAllWindowLayouts();
bool DoesQuakeWindowExist();
winrt::fire_and_forget RequestMoveContent(winrt::hstring window, winrt::hstring content, uint32_t tabIndex, Windows::Foundation::IReference<Windows::Foundation::Rect> windowBounds);
winrt::fire_and_forget RequestSendContent(Remoting::RequestReceiveContentArgs args);
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs> FindTargetWindowRequested;
TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);
til::typed_event<> WindowCreated;
til::typed_event<> WindowClosed;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs> RequestNewWindow;
TYPED_EVENT(WindowCreated, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(WindowClosed, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(QuitAllRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::QuitAllRequestedArgs);
TYPED_EVENT(GetWindowLayoutRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::GetWindowLayoutArgs);
TYPED_EVENT(RequestNewWindow, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs);
private:
DWORD _registrationHostClass{ 0 };
@@ -65,8 +70,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
const winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs& args);
void _raiseRequestNewWindow(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs& args);
void _bubbleWindowCreated(const winrt::Windows::Foundation::IInspectable& s, const winrt::Windows::Foundation::IInspectable& e);
void _bubbleWindowClosed(const winrt::Windows::Foundation::IInspectable& s, const winrt::Windows::Foundation::IInspectable& e);
};
}

View File

@@ -14,10 +14,12 @@ namespace Microsoft.Terminal.Remoting
void SignalClose(Peasant p);
void UpdateActiveTabTitle(String title, Peasant p);
static void RequestQuitAll(Peasant p);
void SummonWindow(SummonWindowSelectionArgs args);
void SummonAllWindows();
Windows.Foundation.Collections.IVector<String> GetAllWindowLayouts();
Windows.Foundation.Collections.IVectorView<PeasantInfo> GetPeasantInfos();
UInt64 GetNumberOfPeasants();
@@ -31,6 +33,8 @@ namespace Microsoft.Terminal.Remoting
event Windows.Foundation.TypedEventHandler<Object, Object> WindowCreated;
event Windows.Foundation.TypedEventHandler<Object, Object> WindowClosed;
event Windows.Foundation.TypedEventHandler<Object, QuitAllRequestedArgs> QuitAllRequested;
event Windows.Foundation.TypedEventHandler<Object, GetWindowLayoutArgs> GetWindowLayoutRequested;
event Windows.Foundation.TypedEventHandler<Object, WindowRequestedArgs> RequestNewWindow;

View File

@@ -15,9 +15,9 @@ namespace winrt::TerminalApp::implementation
winrt::hstring ApplicationDisplayName();
winrt::hstring ApplicationVersion();
til::property_changed_event PropertyChanged;
WINRT_OBSERVABLE_PROPERTY(bool, UpdatesAvailable, PropertyChanged.raise, false);
WINRT_OBSERVABLE_PROPERTY(bool, CheckingForUpdates, PropertyChanged.raise, false);
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
WINRT_OBSERVABLE_PROPERTY(bool, UpdatesAvailable, _PropertyChangedHandlers, false);
WINRT_OBSERVABLE_PROPERTY(bool, CheckingForUpdates, _PropertyChangedHandlers, false);
private:
friend struct AboutDialogT<AboutDialog>; // for Xaml to bind events

View File

@@ -127,7 +127,7 @@ namespace winrt::TerminalApp::implementation
auto originalOpacity{ control.BackgroundOpacity() };
// Apply the new opacity
control.AdjustOpacity(args.Opacity() / 100.0f, args.Relative());
control.AdjustOpacity(args.Opacity() / 100.0, args.Relative());
if (backup)
{

View File

@@ -5,8 +5,6 @@
#include "App.h"
#include "TerminalPage.h"
#include "ScratchpadContent.h"
#include "TasksPaneContent.h"
#include "../WinRTUtils/inc/WtExeUtils.h"
#include "../../types/inc/utils.hpp"
#include "Utils.h"
@@ -119,7 +117,7 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_HandleCloseWindow(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
CloseRequested.raise(nullptr, nullptr);
_CloseRequestedHandlers(nullptr, nullptr);
args.Handled(true);
}
@@ -239,32 +237,6 @@ namespace winrt::TerminalApp::implementation
}
}
// * Helper to try and get a ProfileIndex out of a NewTerminalArgs out of a
// NewContentArgs. For the new tab and split pane action, we want to _not_
// handle the event if an invalid profile index was passed.
//
// Return value:
// * True if the args are NewTerminalArgs, and the profile index was out of bounds.
// * False otherwise.
static bool _shouldBailForInvalidProfileIndex(const CascadiaSettings& settings, const INewContentArgs& args)
{
if (!args)
{
return false;
}
if (const auto& terminalArgs{ args.try_as<NewTerminalArgs>() })
{
if (const auto index = terminalArgs.ProfileIndex())
{
if (gsl::narrow<uint32_t>(index.Value()) >= settings.ActiveProfiles().Size())
{
return true;
}
}
}
return false;
}
void TerminalPage::_HandleSplitPane(const IInspectable& sender,
const ActionEventArgs& args)
{
@@ -274,10 +246,16 @@ namespace winrt::TerminalApp::implementation
}
else if (const auto& realArgs = args.ActionArgs().try_as<SplitPaneArgs>())
{
if (_shouldBailForInvalidProfileIndex(_settings, realArgs.ContentArgs()))
if (const auto& newTerminalArgs{ realArgs.TerminalArgs() })
{
args.Handled(false);
return;
if (const auto index = realArgs.TerminalArgs().ProfileIndex())
{
if (gsl::narrow<uint32_t>(index.Value()) >= _settings.ActiveProfiles().Size())
{
args.Handled(false);
return;
}
}
}
const auto& duplicateFromTab{ realArgs.SplitMode() == SplitType::Duplicate ? _GetFocusedTab() : nullptr };
@@ -287,8 +265,8 @@ namespace winrt::TerminalApp::implementation
_SplitPane(terminalTab,
realArgs.SplitDirection(),
// This is safe, we're already filtering so the value is (0, 1)
realArgs.SplitSize(),
_MakePane(realArgs.ContentArgs(), duplicateFromTab));
::base::saturated_cast<float>(realArgs.SplitSize()),
_MakePane(realArgs.TerminalArgs(), duplicateFromTab));
args.Handled(true);
}
}
@@ -466,13 +444,19 @@ namespace winrt::TerminalApp::implementation
}
else if (const auto& realArgs = args.ActionArgs().try_as<NewTabArgs>())
{
if (_shouldBailForInvalidProfileIndex(_settings, realArgs.ContentArgs()))
if (const auto& newTerminalArgs{ realArgs.TerminalArgs() })
{
args.Handled(false);
return;
if (const auto index = newTerminalArgs.ProfileIndex())
{
if (gsl::narrow<uint32_t>(index.Value()) >= _settings.ActiveProfiles().Size())
{
args.Handled(false);
return;
}
}
}
LOG_IF_FAILED(_OpenNewTab(realArgs.ContentArgs()));
LOG_IF_FAILED(_OpenNewTab(realArgs.TerminalArgs()));
args.Handled(true);
}
}
@@ -753,8 +737,8 @@ namespace winrt::TerminalApp::implementation
{
if (const auto& realArgs = actionArgs.ActionArgs().try_as<ExecuteCommandlineArgs>())
{
auto actions = winrt::single_threaded_vector<ActionAndArgs>(
TerminalPage::ConvertExecuteCommandlineToActions(realArgs));
auto actions = winrt::single_threaded_vector<ActionAndArgs>(std::move(
TerminalPage::ConvertExecuteCommandlineToActions(realArgs)));
if (actions.Size() != 0)
{
@@ -884,23 +868,8 @@ namespace winrt::TerminalApp::implementation
// - <none>
// Important: Don't take the param by reference, since we'll be doing work
// on another thread.
fire_and_forget TerminalPage::_OpenNewWindow(const INewContentArgs newContentArgs)
fire_and_forget TerminalPage::_OpenNewWindow(const NewTerminalArgs newTerminalArgs)
{
auto terminalArgs{ newContentArgs.try_as<NewTerminalArgs>() };
// Do nothing for non-terminal panes.
//
// Theoretically, we could define a `IHasCommandline` interface, and
// stick `ToCommandline` on that interface, for any kind of pane that
// wants to be convertable to a wt commandline.
//
// Another idea we're thinking about is just `wt do {literal json for an
// action}`, which might be less leaky
if (terminalArgs == nullptr)
{
co_return;
}
// Hop to the BG thread
co_await winrt::resume_background();
@@ -913,7 +882,8 @@ namespace winrt::TerminalApp::implementation
// `-w -1` will ensure a new window is created.
winrt::hstring cmdline{
fmt::format(L"-w -1 new-tab {}",
terminalArgs.ToCommandline().c_str())
newTerminalArgs ? newTerminalArgs.ToCommandline().c_str() :
L"")
};
// Build the args to ShellExecuteEx. We need to use ShellExecuteEx so we
@@ -938,32 +908,29 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_HandleNewWindow(const IInspectable& /*sender*/,
const ActionEventArgs& actionArgs)
{
INewContentArgs newContentArgs{ nullptr };
NewTerminalArgs newTerminalArgs{ nullptr };
// If the caller provided NewTerminalArgs, then try to use those
if (actionArgs)
{
if (const auto& realArgs = actionArgs.ActionArgs().try_as<NewWindowArgs>())
{
newContentArgs = realArgs.ContentArgs();
newTerminalArgs = realArgs.TerminalArgs();
}
}
// Otherwise, if no NewTerminalArgs were provided, then just use a
// default-constructed one. The default-constructed one implies that
// nothing about the launch should be modified (just use the default
// profile).
if (!newContentArgs)
if (!newTerminalArgs)
{
newContentArgs = NewTerminalArgs{};
newTerminalArgs = NewTerminalArgs();
}
if (const auto& terminalArgs{ newContentArgs.try_as<NewTerminalArgs>() })
{
const auto profile{ _settings.GetProfileForArgs(terminalArgs) };
terminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
}
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs) };
// Manually fill in the evaluated profile.
_OpenNewWindow(newContentArgs);
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
_OpenNewWindow(newTerminalArgs);
actionArgs.Handled(true);
}
@@ -981,7 +948,7 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_HandleIdentifyWindows(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
IdentifyWindowsRequested.raise(*this, nullptr);
_IdentifyWindowsRequestedHandlers(*this, nullptr);
args.Handled(true);
}
@@ -1010,7 +977,7 @@ namespace winrt::TerminalApp::implementation
{
const auto newName = realArgs.Name();
const auto request = winrt::make_self<implementation::RenameWindowRequestedArgs>(newName);
RenameWindowRequested.raise(*this, *request);
_RenameWindowRequestedHandlers(*this, *request);
args.Handled(true);
}
}
@@ -1180,7 +1147,7 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_HandleOpenSystemMenu(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
OpenSystemMenu.raise(*this, nullptr);
_OpenSystemMenuHandlers(*this, nullptr);
args.Handled(true);
}
@@ -1248,7 +1215,7 @@ namespace winrt::TerminalApp::implementation
if (const auto& realArgs = args.ActionArgs().try_as<AdjustOpacityArgs>())
{
const auto res = _ApplyToActiveControls([&](auto& control) {
control.AdjustOpacity(realArgs.Opacity() / 100.0f, realArgs.Relative());
control.AdjustOpacity(realArgs.Opacity() / 100.0, realArgs.Relative());
});
args.Handled(res);
}
@@ -1434,7 +1401,7 @@ namespace winrt::TerminalApp::implementation
{
if (const auto activePane{ activeTab->GetActivePane() })
{
_restartPaneConnection(activePane->GetContent().try_as<TerminalApp::TerminalPaneContent>(), nullptr);
_restartPaneConnection(activePane);
}
}
args.Handled(true);
@@ -1449,50 +1416,10 @@ namespace winrt::TerminalApp::implementation
}
args.Handled(true);
}
void TerminalPage::_HandleOpenScratchpad(const IInspectable& sender,
const ActionEventArgs& args)
{
if (Feature_ScratchpadPane::IsEnabled())
{
const auto& scratchPane{ winrt::make_self<ScratchpadContent>() };
// This is maybe a little wacky - add our key event handler to the pane
// we made. So that we can get actions for keys that the content didn't
// handle.
scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler });
const auto resultPane = std::make_shared<Pane>(*scratchPane);
_SplitPane(_senderOrFocusedTab(sender), SplitDirection::Automatic, 0.5f, resultPane);
args.Handled(true);
}
}
void TerminalPage::_HandleOpenAbout(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
_ShowAboutDialog();
args.Handled(true);
}
void TerminalPage::_HandleOpenTasksPane(const IInspectable& sender,
const ActionEventArgs& args)
{
if (Feature_ScratchpadPane::IsEnabled())
{
const auto& scratchPane{ winrt::make_self<TasksPaneContent>() };
scratchPane->UpdateSettings(_settings);
// This is maybe a little wacky - add our key event handler to the pane
// we made. So that we can get actions for keys that the content didn't
// handle.
scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler });
scratchPane->DispatchCommandRequested({ this, &TerminalPage::_OnDispatchCommandRequested });
const auto resultPane = std::make_shared<Pane>(*scratchPane);
_SplitPane(_senderOrFocusedTab(sender), SplitDirection::Automatic, 0.5f, resultPane);
args.Handled(true);
}
}
}

View File

@@ -549,9 +549,6 @@ void AppCommandlineArgs::_addNewTerminalArgs(AppCommandlineArgs::NewTerminalSubc
subcommand.profileNameOption = subcommand.subcommand->add_option("-p,--profile",
_profileName,
RS_A(L"CmdProfileArgDesc"));
subcommand.sessionIdOption = subcommand.subcommand->add_option("--sessionId",
_sessionId,
RS_A(L"CmdSessionIdArgDesc"));
subcommand.startingDirectoryOption = subcommand.subcommand->add_option("-d,--startingDirectory",
_startingDirectory,
RS_A(L"CmdStartingDirArgDesc"));
@@ -631,13 +628,6 @@ NewTerminalArgs AppCommandlineArgs::_getNewTerminalArgs(AppCommandlineArgs::NewT
args.Profile(winrt::to_hstring(_profileName));
}
if (*subcommand.sessionIdOption)
{
const auto str = winrt::to_hstring(_sessionId);
const auto id = ::Microsoft::Console::Utils::GuidFromString(str.c_str());
args.SessionId(id);
}
if (*subcommand.startingDirectoryOption)
{
args.StartingDirectory(winrt::to_hstring(_startingDirectory));
@@ -724,7 +714,6 @@ bool AppCommandlineArgs::_noCommandsProvided()
void AppCommandlineArgs::_resetStateToDefault()
{
_profileName.clear();
_sessionId.clear();
_startingDirectory.clear();
_startingTitle.clear();
_startingTabColor.clear();

View File

@@ -62,7 +62,6 @@ private:
CLI::App* subcommand;
CLI::Option* commandlineOption;
CLI::Option* profileNameOption;
CLI::Option* sessionIdOption;
CLI::Option* startingDirectoryOption;
CLI::Option* titleOption;
CLI::Option* tabColorOption;
@@ -97,7 +96,6 @@ private:
// Are you adding a new sub-command? Make sure to update _noCommandsProvided!
std::string _profileName;
std::string _sessionId;
std::string _startingDirectory;
std::string _startingTitle;
std::string _startingTabColor;

View File

@@ -149,11 +149,6 @@ namespace winrt::TerminalApp::implementation
_languageProfileNotifier = winrt::make_self<LanguageProfileNotifier>([this]() {
_reloadSettings->Run();
});
// Do this here, rather than at the top of main. This will prevent us from
// including this variable in the vars we serialize in the
// Remoting::CommandlineArgs up in HandleCommandlineArgs.
_setupFolderPathEnvVar();
}
// Method Description:
@@ -428,7 +423,7 @@ namespace winrt::TerminalApp::implementation
_settingsLoadExceptionText,
warnings,
_settings);
SettingsChanged.raise(*this, *ev);
_SettingsChangedHandlers(*this, *ev);
return;
}
}
@@ -457,7 +452,7 @@ namespace winrt::TerminalApp::implementation
_settingsLoadExceptionText,
warnings,
_settings);
SettingsChanged.raise(*this, *ev);
_SettingsChangedHandlers(*this, *ev);
}
// This is a continuation of AppLogic::Create() and includes the more expensive parts.
@@ -702,6 +697,22 @@ namespace winrt::TerminalApp::implementation
return _settings.GlobalSettings().ShouldUsePersistedLayout();
}
void AppLogic::SaveWindowLayoutJsons(const Windows::Foundation::Collections::IVector<hstring>& layouts)
{
std::vector<WindowLayout> converted;
converted.reserve(layouts.Size());
for (const auto& json : layouts)
{
if (json != L"")
{
converted.emplace_back(WindowLayout::FromJson(json));
}
}
ApplicationState::SharedInstance().PersistedWindowLayouts(winrt::single_threaded_vector(std::move(converted)));
}
TerminalApp::ParseCommandlineResult AppLogic::GetParseCommandlineMessage(array_view<const winrt::hstring> args)
{
::TerminalApp::AppCommandlineArgs _appArgs;
@@ -709,14 +720,4 @@ namespace winrt::TerminalApp::implementation
return TerminalApp::ParseCommandlineResult{ winrt::to_hstring(_appArgs.GetExitMessage()), r };
}
// Function Description
// * Adds a `WT_SETTINGS_DIR` env var to our own environment block, that
// points at our settings directory. This allows portable installs to
// refer to files in the portable install using %WT_SETTINGS_DIR%
void AppLogic::_setupFolderPathEnvVar()
{
std::wstring path{ CascadiaSettings::SettingsPath() };
auto folderPath = path.substr(0, path.find_last_of(L"\\"));
SetEnvironmentVariableW(L"WT_SETTINGS_DIR", folderPath.c_str());
}
}

View File

@@ -53,7 +53,9 @@ namespace winrt::TerminalApp::implementation
void NotifyRootInitialized();
bool HasSettingsStartupActions() const noexcept;
bool ShouldUsePersistedLayout() const;
void SaveWindowLayoutJsons(const Windows::Foundation::Collections::IVector<hstring>& layouts);
[[nodiscard]] Microsoft::Terminal::Settings::Model::CascadiaSettings GetSettings() const noexcept;
@@ -72,7 +74,7 @@ namespace winrt::TerminalApp::implementation
TerminalApp::ParseCommandlineResult GetParseCommandlineMessage(array_view<const winrt::hstring> args);
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::SettingsLoadEventArgs> SettingsChanged;
TYPED_EVENT(SettingsChanged, winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::SettingsLoadEventArgs);
private:
bool _isElevated{ false };
@@ -110,8 +112,6 @@ namespace winrt::TerminalApp::implementation
void _RegisterSettingsChange();
fire_and_forget _DispatchReloadSettings();
void _setupFolderPathEnvVar();
#ifdef UNIT_TESTING
friend class TerminalAppLocalTests::CommandlineTest;
#endif

View File

@@ -37,6 +37,7 @@ namespace TerminalApp
Boolean HasSettingsStartupActions();
Boolean ShouldUsePersistedLayout();
void SaveWindowLayoutJsons(Windows.Foundation.Collections.IVector<String> layouts);
void ReloadSettings();

View File

@@ -1,21 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
namespace winrt::TerminalApp::implementation
{
struct BasicPaneEvents
{
til::typed_event<> ConnectionStateChanged;
til::typed_event<IPaneContent> CloseRequested;
til::typed_event<IPaneContent, winrt::TerminalApp::BellEventArgs> BellRequested;
til::typed_event<IPaneContent> TitleChanged;
til::typed_event<IPaneContent> TabColorChanged;
til::typed_event<IPaneContent> TaskbarProgressChanged;
til::typed_event<IPaneContent> ReadOnlyChanged;
til::typed_event<IPaneContent> FocusRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command> DispatchCommandRequested;
};
}

View File

@@ -32,7 +32,7 @@ namespace winrt::TerminalApp::implementation
{
auto button{ sender.as<Windows::UI::Xaml::Controls::Button>() };
auto rectClr{ button.Background().as<Windows::UI::Xaml::Media::SolidColorBrush>() };
ColorSelected.raise(rectClr.Color());
_ColorSelectedHandlers(rectClr.Color());
Hide();
}
@@ -45,7 +45,7 @@ namespace winrt::TerminalApp::implementation
// - <none>
void ColorPickupFlyout::ClearColorButton_Click(const IInspectable&, const Windows::UI::Xaml::RoutedEventArgs&)
{
ColorCleared.raise();
_ColorClearedHandlers();
Hide();
}
@@ -80,12 +80,12 @@ namespace winrt::TerminalApp::implementation
void ColorPickupFlyout::CustomColorButton_Click(const Windows::Foundation::IInspectable&, const Windows::UI::Xaml::RoutedEventArgs&)
{
auto color = customColorPicker().Color();
ColorSelected.raise(color);
_ColorSelectedHandlers(color);
Hide();
}
void ColorPickupFlyout::ColorPicker_ColorChanged(const Microsoft::UI::Xaml::Controls::ColorPicker&, const Microsoft::UI::Xaml::Controls::ColorChangedEventArgs& args)
{
ColorSelected.raise(args.NewColor());
_ColorSelectedHandlers(args.NewColor());
}
}

View File

@@ -13,8 +13,8 @@ namespace winrt::TerminalApp::implementation
void ClearColorButton_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& args);
void ColorPicker_ColorChanged(const Microsoft::UI::Xaml::Controls::ColorPicker&, const Microsoft::UI::Xaml::Controls::ColorChangedEventArgs& args);
til::event<TerminalApp::ColorClearedArgs> ColorCleared;
til::event<TerminalApp::ColorSelectedArgs> ColorSelected;
WINRT_CALLBACK(ColorCleared, TerminalApp::ColorClearedArgs);
WINRT_CALLBACK(ColorSelected, TerminalApp::ColorSelectedArgs);
};
}

View File

@@ -235,7 +235,7 @@ namespace winrt::TerminalApp::implementation
{
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
{
PreviewAction.raise(*this, actionPaletteItem.Command());
_PreviewActionHandlers(*this, actionPaletteItem.Command());
}
}
else if (_currentMode == CommandPaletteMode::CommandlineMode)
@@ -569,7 +569,7 @@ namespace winrt::TerminalApp::implementation
void CommandPalette::_moveBackButtonClicked(const Windows::Foundation::IInspectable& /*sender*/,
const Windows::UI::Xaml::RoutedEventArgs&)
{
PreviewAction.raise(*this, nullptr);
_PreviewActionHandlers(*this, nullptr);
_searchBox().Focus(FocusState::Programmatic);
const auto previousAction{ _nestedActionStack.GetAt(_nestedActionStack.Size() - 1) };
@@ -714,7 +714,7 @@ namespace winrt::TerminalApp::implementation
// All other actions can just be dispatched.
if (actionPaletteItem.Command().ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
{
DispatchCommandRequested.raise(*this, actionPaletteItem.Command());
_DispatchCommandRequestedHandlers(*this, actionPaletteItem.Command());
}
TraceLoggingWrite(
@@ -768,7 +768,7 @@ namespace winrt::TerminalApp::implementation
{
if (const auto tab{ tabPaletteItem.Tab() })
{
SwitchToTabRequested.raise(*this, tab);
_SwitchToTabRequestedHandlers(*this, tab);
}
}
}
@@ -796,7 +796,7 @@ namespace winrt::TerminalApp::implementation
if (const auto commandLinePaletteItem{ filteredCommand.value().Item().try_as<winrt::TerminalApp::CommandLinePaletteItem>() })
{
CommandLineExecutionRequested.raise(*this, commandLinePaletteItem.CommandLine());
_CommandLineExecutionRequestedHandlers(*this, commandLinePaletteItem.CommandLine());
_close();
}
}
@@ -843,16 +843,6 @@ namespace winrt::TerminalApp::implementation
void CommandPalette::_filterTextChanged(const IInspectable& /*sender*/,
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
{
// When we are executing the _SelectNextTab in the TabManagement.cpp, this method
// is getting triggered because we set up the default value for that CommandPalette
// with an empty string. Therefore, to avoid the reset of the index when executing
// the Next/Prev tab command, we are skipping this execution.
// Check issue https://github.com/microsoft/terminal/issues/11146
if (_currentMode == CommandPaletteMode::TabSwitchMode)
{
return;
}
if (_currentMode == CommandPaletteMode::CommandlineMode)
{
_evaluatePrefix();
@@ -1197,7 +1187,7 @@ namespace winrt::TerminalApp::implementation
{
Visibility(Visibility::Collapsed);
PreviewAction.raise(*this, nullptr);
_PreviewActionHandlers(*this, nullptr);
// Reset visibility in case anchor mode tab switcher just finished.
_searchBox().Visibility(Visibility::Visible);
@@ -1348,7 +1338,7 @@ namespace winrt::TerminalApp::implementation
// there aren't any recent commands, then just store the new command.
if (!recentCommands)
{
ApplicationState::SharedInstance().RecentCommands(single_threaded_vector(std::vector{ command }));
ApplicationState::SharedInstance().RecentCommands(single_threaded_vector(std::move(std::vector{ command })));
return;
}

View File

@@ -48,18 +48,18 @@ namespace winrt::TerminalApp::implementation
void EnableTabSwitcherMode(const uint32_t startIdx, Microsoft::Terminal::Settings::Model::TabSwitcherMode tabSwitcherMode);
void EnableTabSearchMode();
til::property_changed_event PropertyChanged;
til::typed_event<winrt::TerminalApp::CommandPalette, winrt::TerminalApp::TabBase> SwitchToTabRequested;
til::typed_event<winrt::TerminalApp::CommandPalette, winrt::hstring> CommandLineExecutionRequested;
til::typed_event<winrt::TerminalApp::CommandPalette, Microsoft::Terminal::Settings::Model::Command> DispatchCommandRequested;
til::typed_event<Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command> PreviewAction;
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, NoMatchesText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, SearchBoxPlaceholderText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, PrefixCharacter, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ControlName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParentCommandName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParsedCommandLineText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, NoMatchesText, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, SearchBoxPlaceholderText, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, PrefixCharacter, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ControlName, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParentCommandName, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParsedCommandLineText, PropertyChanged.raise);
TYPED_EVENT(SwitchToTabRequested, winrt::TerminalApp::CommandPalette, winrt::TerminalApp::TabBase);
TYPED_EVENT(CommandLineExecutionRequested, winrt::TerminalApp::CommandPalette, winrt::hstring);
TYPED_EVENT(DispatchCommandRequested, winrt::TerminalApp::CommandPalette, Microsoft::Terminal::Settings::Model::Command);
TYPED_EVENT(PreviewAction, Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command);
private:
struct winrt_object_hash

View File

@@ -62,7 +62,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
{
_outputRevoker = wrappedConnection.TerminalOutput(winrt::auto_revoke, { this, &DebugTapConnection::_OutputHandler });
_stateChangedRevoker = wrappedConnection.StateChanged(winrt::auto_revoke, [this](auto&& /*s*/, auto&& /*e*/) {
StateChanged.raise(*this, nullptr);
_StateChangedHandlers(*this, nullptr);
});
_wrappedConnection = wrappedConnection;
}
@@ -127,7 +127,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
{
output.insert(++lfPos, L"\r\n");
}
TerminalOutput.raise(output);
_TerminalOutputHandlers(output);
}
// Called by the DebugInputTapConnection to print user input
@@ -135,7 +135,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
{
auto clean{ til::visualize_control_codes(str) };
auto formatted{ wil::str_printf<std::wstring>(L"\x1b[91m%ls\x1b[m", clean.data()) };
TerminalOutput.raise(formatted);
_TerminalOutputHandlers(formatted);
}
// Wire us up so that we can forward input through

View File

@@ -25,9 +25,9 @@ namespace winrt::Microsoft::TerminalApp::implementation
void SetInputTap(const Microsoft::Terminal::TerminalConnection::ITerminalConnection& inputTap);
til::event<winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler> TerminalOutput;
WINRT_CALLBACK(TerminalOutput, winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler);
til::typed_event<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Windows::Foundation::IInspectable> StateChanged;
TYPED_EVENT(StateChanged, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Windows::Foundation::IInspectable);
private:
void _PrintInput(const hstring& data);

View File

@@ -21,22 +21,11 @@ namespace winrt::TerminalApp::implementation
{
// This class is a wrapper of PaletteItem, that is used as an item of a filterable list in CommandPalette.
// It manages a highlighted text that is computed by matching search filter characters to item name
FilteredCommand::FilteredCommand(const winrt::TerminalApp::PaletteItem& item)
FilteredCommand::FilteredCommand(const winrt::TerminalApp::PaletteItem& item) :
_Item(item),
_Filter(L""),
_Weight(0)
{
// Actually implement the ctor in _constructFilteredCommand
_constructFilteredCommand(item);
}
// We need to actually implement the ctor in a separate helper. This is
// because we have a FilteredTask class which derives from FilteredCommand.
// HOWEVER, for cppwinrt ~ r e a s o n s ~, it doesn't actually derive from
// FilteredCommand directly, so we can't just use the FilteredCommand ctor
// directly in the base class.
void FilteredCommand::_constructFilteredCommand(const winrt::TerminalApp::PaletteItem& item)
{
_Item = item;
_Filter = L"";
_Weight = 0;
_HighlightedName = _computeHighlightedName();
// Recompute the highlighted name if the item name changes

Some files were not shown because too many files have changed in this diff Show More