Compare commits

...

29 Commits

Author SHA1 Message Date
Dustin L. Howett
238d848ecc HAX: TerminalApp->M.T.App 2023-02-03 16:21:22 -06:00
Dustin L. Howett
24297f99d9 Rename WindowsTerminalShellExt to Microsoft.Terminal.ShellExtension 2023-02-03 15:43:51 -06:00
Dustin L. Howett
3564c6cb54 Rename TerminalConnection to Microsoft.Terminal.Connection 2023-02-03 15:42:19 -06:00
James Holderness
282c583731 Make all console output modes more strictly buffer state (#14735)
The original console output modes were considered attributes of the
buffer, while later additions were treated as global state, and yet both
were accessed via the same buffer-based API. This could result in the
reported modes being out of sync with the way the system was actually
behaving, and a call to `SetConsoleMode` without updating anything could
still trigger unpredictable changes in behavior.

This PR attempts to address that problem by making all modes part of the
buffer state, and giving them predictable default values.

While this won't solve all the tmux layout-breaking issues in #6987, it
does at least fix one case which was the result of an unexpected change
in the `DISABLE_NEWLINE_AUTO_RETURN` mode.

All access to the output modes is now done via the `OutputMode` field in
`SCREEN_INFORMATION`. The fields that were tracking global state in the
`Settings` class (`_fAutoReturnOnNewline` and  `_fRenderGridWorldwide`)
have now been removed.

We still have a global `_dwVirtTermLevel` field, though, but that now
serves as a default value for the `ENABLE_VIRTUAL_TERMINAL_PROCESSING`
mode when creating a new buffer. It's enabled for conpty mode, and when
the VT level in the registry is not 0. That default doesn't change.

For the VT alternate buffer, things works slightly differently, since
there is an expectation that VT modes are global. So when creating an
alt buffer, we copy the current modes from the main buffer, and when
it's closed, we copy them back again.

## Validation Steps Performed

I've manually confirmed that this fixes the problem described in issue
#14690. I've also added a basic feature test that confirms the modes are
initialized as expected when creating new buffers, and changes to the
modes in one buffer do not impact any other buffers.

Closes #14690
2023-01-27 20:38:37 +00:00
Dustin L. Howett
fc960e3327 Generalize OpenConsoleProxy's HybridCRT logic (#14733)
This pull request moves the Hybrid CRT logic out of the Host.Proxy
project and makes it available for all other projects in our solution.
2023-01-27 19:17:30 +00:00
Dustin L. Howett
6a610334af When generating a stacked changelog, note which branch/es contain a commit (#14728)
New-TerminalStackedChangelog used to generate logs that looked like this:

```
* [3] A commit that was seen 3 times
* A commit that was only seen once
* [2] Some other commit
```

Now it will generate logs that look like this:

```
   / base..branch-1
   |/ base..branch-2
   ||/ base..branch-3
* [XXX] A commit that was seen 3 times
* [ X ] A commit that was only seen once
* [XX ] Some other commit
```

This format is more expressive, as it indicates _which branches_ contain which commits.

As a reminder, my release note writing style starts with a stacked changelog. It's how I tell (1) which commits are in the new preview release only, (2) which commits are in the new preview and the new stable release and (3) which commits were already released in a previous stable release.

Changes from 1 get included in the new changelog, changes from 2 get included in both and changes from 3 get deleted because they have already been released.
2023-01-25 10:52:11 -08:00
Dustin Howett
7d0baa7946 Revert "Manually set the automation name of the default color scheme for screen reader (#14704)"
This reverts commit 47f38e31a1.
2023-01-23 19:01:49 -06:00
Carlos Zamora
a0e830cc1a [UIA] Dispatch a TextChanged event on new output (#14723)
For some reason, Windows Terminal stops dispatching UIA TextChanged events sometimes. There isn't a reliable repro for this bug.

However, under NVDA's logger, it appears that when the bug does occur, we still dispatch UIA notifications (which may be ignored by NVDA in some configurations). A "quick fix" here is to dispatch a TextChanged event if we're going to dispatch a notification. Since we're just enabling a flag, we won't send two events at once.

Closes #10911
2023-01-23 21:53:09 +00:00
Mike Griese
a4cf4e2761 Resize our ContentDialog's when the window resizes (#14722)
Major thanks to @dongle-the-gadget in https://github.com/microsoft/microsoft-ui-xaml/issues/3577#issuecomment-1399250405 for coming up with this workaround.

This PR will manually forward a `WM_SIZE` message to our `CoreWindow`, to trigger the `ContentDialog` to resize itself. 

We always closed these issues as dupes of the upstream one, so this doesn't actually close anything.
HOWEVER, these are the following issues that reported this bug:
- #2380
- #4463
- #5252
- #5810
- #6181
- #7113
- #7225
- #8245
- #8496
- #8643
- #9336
- #9563
- #5808
- #10351
- #10634
- #10995
- #11770
- #13796
2023-01-23 12:42:27 -06:00
Carlos Zamora
3dd40791c9 Ensure TermControl is not closing when firing UIA events (#14714)
The `SignalTextChanged` crash seems to be occurring due to the `TermControlAutomationPeer` being destructed by the time the UIA event is actually dispatched. Even though we're already checking if TCAP and TermControl still exist, it could be that the TermControl is being closed as text is being output.

The proposed fix here is to record when the closing process starts and exposing that information directly to the TCAP. If TCAP sees that we're in the process of closing, don't bother sending a UIA event.


Closes #13978
2023-01-21 15:48:33 +00:00
Dustin Howett
8f1960d0b4 version: bump to 1.18 on main 2023-01-20 15:24:08 -06:00
Dustin L. Howett
72be9a95af Code sign the contents of the Terminal package (#14710)
Up until now, we have been relying on the catalog signature produced for our MSIX package.
There are some things (Packaged COM, Process Explorer as of 2022) that cannot handle catalog-signed
files. It's easier and safer for us to simply sign all the executables we produce before packaging them.

Unfortunately, we can't do it before we package them. We have to unpack and re-pack our package.

In the future, this will allow us to provide a codesigned distribution that is not in an MSIX package.

TEST=Ran a build and checked out the contents of the package. They were all signed!

Closes #13294
Closes #12695
Closes #9670
2023-01-20 11:47:18 -06:00
Mike Griese
596d0c5155 Update the titlebar visibility when we gain/lose focus too (#14708)
We forgot to updateTheme again when we change the titlebar color. That would result in us setting the titlebar visibility only when the settings were reloaded, but if the unfocused BG was opaque, and the focused was transparent, we'd use the current _unfocused_ color to set the titlebar visibility. 

Also, this fixes a bug with `tabRow.BG: terminalBackground`

from teams for brevity 

> tabRow.BG = terminalBackground might not work, and here's why
>
> the termcontrol's BG brush might be (r,g,b, 255), with an Opacity of 0
> 
> so my "use mica when the brush's A is <1.0" doesn't work
> 

closes #14563
2023-01-20 01:38:34 +00:00
Mike Griese
79eb9b3d3c Use a dark titlebar when we've requested dark theme (#14536)
This applies to `"showTabsInTitlebar": false,`. We literally never set that for the `IslandWindow` before, only ever the NCIW. 

Closes #11589


![update-titlebar-for-theme](https://user-images.githubusercontent.com/18356694/207109370-a63a8b19-4c42-4b1f-8d39-8c3abdf1b403.gif)


For a dramatic example - here's the IW with mica enabled, in dark mode:

![image](https://user-images.githubusercontent.com/18356694/207109465-a6165637-31a5-45a4-bff0-51ac79404cd6.png)

Theme json:

```json
        {
            "name": "chonk",
            "tab":
            {
                "background": "#00000000",
                "unfocusedBackground": "#00000000",
                "showCloseButton": "never"
            },
            "tabRow":
            {
                "background": "#00000000",
                "unfocusedBackground": "#00000000",
            },
            "window":
            {
                "applicationTheme": "dark",
                "useMica": true
            }
        },
```
2023-01-19 23:51:21 +00:00
Joshua Boelter
eab1c239a9 Launch elevated instances via shell:AppFolder (#14637)
This uses `shell:AppsFolder` to launch elevated instances of the app via
`ShellExecuteEx` and `runas` in elevate-shim.exe. The app to launch is
discovered via the `GetCurrentApplicationUserModelId` API.

e.g. `shell:AppsFolder\WindowsTerminalDev_8wekyb3d8bbwe!App`

This will fallback to launching `WindowsTerminal.exe` if it fails to
discover the app user model id to launch.

This also fixes a bug in elevate-shim where the first argument of
WinMain was lost (e.g. `new-tab`). 

Curiously, `AppLogic::RunAsUwp()` is never called and
`AppLogic::IsUwp()` is always false when running debug builds locally
(e.g. WindowsTerminalDev). It's not clear if this is an artifact of
development packages or something else.

## Validation Steps Performed

Various manual debug/execution scenarios.

Verified the fallback path by running the unbundled app by extracting
the `CascadiaPackage_0.0.1.0_x64.msix` from the 'drop' build artifact.

Fixes #14501
2023-01-19 23:40:53 +00:00
PankajBhojwani
96a9dd5209 Automatically focus the ColorSchemeListView when we navigate to the ColorSchemes page (#14631)
This regressed when we implemented ColorSchemeViewModel in #13179.
This commit fixes that by automatically focusing the ColorSchemeListView
when we navigate to the ColorSchemes page, which makes sense from a
user experience perspective anyway.

Closes #11971
2023-01-19 23:20:56 +00:00
PankajBhojwani
6278a2d9bf Fix the selected color scheme list item container background being blue in Windows 10 (#14706)
Specify the resource to use for the list view item background when selected.

References #14693 

## Validation Steps Performed
Background is no longer blue, it is light gray (like in Windows 11). Screenshots below.
2023-01-19 22:04:28 +00:00
PankajBhojwani
16fe2e5905 Add color chips to the color scheme dropdown in Appearance (#14587)
Does what it says on the tin.
2023-01-19 21:46:59 +00:00
Mike Griese
f2b82cd054 Only use Mica in the SUI if Mica is available (#14675)
This should make sure we only use Mica for the BG of the SUI when we're on a Windows build that supports it. Otherwise, we're just gonna get the emergency backstop / full transparency under it. 

Confirmed this fixes it on my win10 VM.

Closes #14667
2023-01-19 21:06:49 +00:00
James Holderness
7813953b23 Add support for IRM (Insert Replace Mode) (#14700)
This PR add support for the ANSI Insert/Replace mode (`IRM`), which
determines whether output characters are inserted at the active cursor
position, moving existing content to the right, or whether they should
overwrite the content that is already there.

The implementation is a bit of a hack. When that mode is enabled, it
first measures how many cells the string is expected to occupy, then
scrolls the target line right by that amount before writing out the new
text.

In the longer term it might be better if this was implemented entirely
in the `TextBuffer` itself, so the scrolling could take place at the
same time as the content was being written.

## Validation Steps Performed

I've added a very basic unit test that verifies the mode is working as
expected. But I've also done a lot more manual testing, confirming edge
cases like wide characters, double-width lines, and both with and
without wrapping mode enabled.

Closes #1947
2023-01-19 19:59:05 +00:00
PankajBhojwani
47f38e31a1 Manually set the automation name of the default color scheme for screen reader (#14704)
## Summary of the Pull Request
When we navigate to the color schemes page, find the default color scheme (if present) and manually set the container's automation name to include the word 'default'. 

Note that we don't want to change the actual `ColorSchemeViewModel`'s name since that name is used internally to identify schemes. We only want to change the `ListViewItem`'s name, i.e. the container in the SUI.

## PR Checklist
* [x] Closes #14401 
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Validation Steps Performed
Screen reader reads out the 'default' text now. It also correctly reads out the new default scheme if the default scheme is changed via SUI or json.
2023-01-19 19:39:08 +00:00
Mike Griese
0fe0868f98 Remove the win10/win11 digit from our version number. (#14660)
As of about 2022, the one's digit of the Build of our version is a placeholder value to differentiate the Windows 10 build from the Windows 11 build. Let's trim that out, it's only a source of confusion.

For additional clarity, let's omit the Revision, which _must_ be `.0`, and doesn't provide any value to report.

We will need to make sure we report releases as `1.17.ABC` now, instead of `1.17.ABC1.0`/`1.17.ABC2.0`

Let's not backport this. 1.17 will be the start of the new numbering scheme. Otherwise, `1.16.EFG` < `1.16.ABC1.0`, for an old version `ABC1` and a new version `EFG`.

* closes #14106
* As summarized here: https://github.com/microsoft/terminal/issues/14106#issuecomment-1289462310
2023-01-19 19:32:23 +00:00
Dustin L. Howett
179bb9bded Add TerminalStress, Mike Treit's application for breaking WT (#14701)
From Treit/TerminalStress@39c03e2d00

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
Co-authored-by: Mike Treit <mtreit@ntdev.microsoft.com>
2023-01-19 13:20:43 -06:00
Mike Griese
90485e4c79 Fix a crash on startup with a folder entry without entries (#14629)
`_Entries` was getting default constructed to `nullptr`. We should be careful about that. 

Adds a test too, and fixes a regression in the local tests introduced in #13763.

Closes #14557
2023-01-19 19:12:40 +00:00
Dustin L. Howett
29ef49252b Make the PR template less unfriendly (#14697)
Dunno how to feel about this. I want to guide people, but i don't want HTML comments in my `git log`
2023-01-19 11:39:04 +00:00
PankajBhojwani
5614116c6e Update Profile and Appearance VMs to use CSVM; remove nav state (#14572)
ColorScheme MVVM was implemented in #13179. This PR updates the
ProfileViewModel/AppearanceViewModels to use color scheme view models
instead of the raw settings model objects.

* [x] Updates ProfileViewModel/AppearanceViewModel to use
  ColorSchemesPageViewModel/ColorSchemeViewModel implemented in #13179
* [x] Removes ProfilePageNavigationState

## Validation Steps Performed
Settings UI still works (we _probably_ want to bug bash this at some
point though as with all SUI changes)
2023-01-18 15:30:00 -06:00
James Holderness
a1865b9cf7 Merge the PrintString functionality into AdaptDispatch (#14640)
The main purpose of this PR was to merge the `ITerminalApi::PrintString`
implementations into a shared method in `AdaptDispatch`, and avoid the
VT code path depending on `WriteCharsLegacy`. But this refactoring has
also fixed some bugs that existed in the original implementations. 

This helps to close the gap between the Conhost and Terminal (#13408).

I started by taking the `WriteCharsLegacy` implementation, and stripping
out everything that didn't apply to the VT code path. What was left was
a fairly simple loop with the following steps:

1. Check if _delayed wrap_ is set, and if so, move to the next line.
2. Write out as much of the string as will fit on the current line.
3. If we reach the end of the line, set the _delayed wrap_ flag again.
4. Repeat the loop until the entire string has been output.

But step 2 was a little more complicated than necessary because of its
legacy history. It was copying the string into a temporary buffer,
manually estimated how much of it would fit, and then passing on that
partial buffer to the `TextBuffer::Write` method.

In the new implementation, we just pass the entire string directly to
`TextBuffer::WriteLine`, and that handles the clipping itself. The
returned `OutputCellIterator` tells us how much of the string is left.
This approach fixes some issues with wide characters, and should also
cope better with future buffer enhancements.

Another improvement from the new implementation is that the Terminal now
handles delayed EOL wrap correctly. However, the downside of this is
that it introduced a cursor-dropping bug that previously only affected
conhost. I hadn't originally intended to fix that, but it became more of
an issue now.

The root cause was the fact that we called `cursor.StartDeferDrawing()`
before outputting the text, and this was something I had adopted in the
new implementation as well. But I've now removed that, and instead just
call `cursor.SetIsOn(false)`. This seems to avoid the cursor droppings,
and hopefully still has similar performance benefits.

The other thing worth mentioning is that I've eliminated some special
casing handling for the `ENABLE_VIRTUAL_TERMINAL_PROCESSING` mode and
the `WC_DELAY_EOL_WRAP` flag in the `WriteCharsLegacy` function. They
were only used for VT output, so aren't needed here anymore.

## Validation Steps Performed

I've just been testing manually, writing out sample text both in ASCII
and with wide Unicode chars. I've made sure it wraps correctly when
exceeding the available space, but doesn't wrap when stopped at the last
column, and with `DECAWM` disabled, it doesn't wrap at all.

I've also confirmed that the test case from issue #12739 is now working
correctly, and the cursor no longer disappears in Windows Terminal when
writing to the last column (i.e. the delayed EOL wrap is working).

Closes #780
Closes #6162
Closes #6555
Closes #12440
Closes #12739
2023-01-18 20:26:04 +00:00
Mike Griese
c79298d3fd Use ThemeLookup for the SUI bg too (#14644)
I can't exactly repro #14559. I suspect that's due to #14567 having been merged. This, however, seemed related. Without this, we'll use the App's `RequestedTheme` (the one that can't be changed at runtime), rather than the user's `requestedTheme`. That will do weird things, like make the BG of the SUI dark, with white expanders.

I think this should close #14559.
2023-01-18 18:31:21 +00:00
Carlos Zamora
8e041692b3 Add mutex to keyEvents in TermControlAutomationPeer (#14694)
Some investigation revealed that `_keyEvents` would get a `NULL_POINTER_READ` error. On the main thread, `RecordKeyEvent()` would be called, which mainly updates `_keyEvents`. On the renderer thread, `NotifyNewOutput()` would be called, which starts by iterating through `_keyEvents` and slowly clearing it out. On occasion, these two threads are modifying `_keyEvents` simultaneously, causing a crash.

The fix is to add a mutex on this variable. 

Closes #14592
2023-01-18 07:28:06 +00:00
258 changed files with 1922 additions and 1207 deletions

View File

@@ -1,20 +1,14 @@
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? -->
## References
## References and Relevant Issues
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [ ] Closes #xxx
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
## PR Checklist
- [ ] Closes #xxx
- [ ] Tests added/passed
- [ ] Documentation updated
- If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [ ] Schema updated (if necessary)

View File

@@ -1825,6 +1825,7 @@ SYSCOMMAND
SYSDEADCHAR
SYSKEYDOWN
SYSKEYUP
SYSLIB
SYSLINK
SYSMENU
sysparams

View File

@@ -413,6 +413,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Audio", "Audio", "{40BD8415
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MidiAudio", "src\audio\midi\lib\midi.vcxproj", "{3C67784E-1453-49C2-9660-483E2CC7F7AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TerminalStress", "src\tools\TerminalStress\TerminalStress.csproj", "{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AuditMode|Any CPU = AuditMode|Any CPU
@@ -2741,6 +2743,30 @@ Global
{3C67784E-1453-49C2-9660-483E2CC7F7AD}.Release|x64.Build.0 = Release|x64
{3C67784E-1453-49C2-9660-483E2CC7F7AD}.Release|x86.ActiveCfg = Release|Win32
{3C67784E-1453-49C2-9660-483E2CC7F7AD}.Release|x86.Build.0 = Release|Win32
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.AuditMode|Any CPU.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.AuditMode|ARM.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.AuditMode|ARM64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.AuditMode|x64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.AuditMode|x86.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|ARM.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|x64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|x64.Build.0 = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Debug|x86.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Fuzzing|Any CPU.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Fuzzing|ARM.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Fuzzing|ARM64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Fuzzing|x64.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Fuzzing|x86.ActiveCfg = Debug|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|Any CPU.Build.0 = Release|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|ARM.ActiveCfg = Release|Any CPU
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4}.Release|ARM64.ActiveCfg = Release|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2845,6 +2871,7 @@ Global
{75C6F576-18E9-4566-978A-F0A301CAC090} = {05500DEF-2294-41E3-AF9A-24E580B82836}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}

View File

@@ -0,0 +1,115 @@
{
"Version": "1.0.0",
"UseMinimatch": false,
"SignBatches": [
{
"MatchedPath": [
// Namespaced DLLs
"Microsoft.Terminal.*.dll",
"Microsoft.Terminal.*.winmd",
// ConPTY and DefTerm
"OpenConsole.exe",
"OpenConsoleProxy.dll",
// VCRT Forwarders
"*_app.dll",
// Legacy DLLs with old names
"TerminalApp.dll",
"TerminalApp.winmd",
"TerminalThemeHelpers.dll",
// The rest
"TerminalAzBridge.exe",
"wt.exe",
"WindowsTerminal.exe",
"elevate-shim.exe"
],
"SigningInfo": {
"Operations": [
{
"KeyCode": "CP-230012",
"OperationSetCode": "SigntoolSign",
"Parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationSetCode": "SigntoolVerify",
"Parameters": [],
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
}
},
{
// THIRD PARTY SOFTWARE
"MatchedPath": [
"cpprest*.dll"
],
"SigningInfo": {
"Operations": [
{
"KeyCode": "CP-231522",
"OperationSetCode": "SigntoolSign",
"Parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-231522",
"OperationSetCode": "SigntoolVerify",
"Parameters": [],
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
}
}
]
}

View File

@@ -63,6 +63,7 @@ parameters:
- Win11
variables:
MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe'
TerminalInternalPackageVersion: "0.0.7"
# If we are building a branch called "release-*", change the NuGet suffix
# to "preview". If we don't do that, XES will set the suffix to "release1"
@@ -270,6 +271,28 @@ jobs:
displayName: 'Generate SBOM manifest'
inputs:
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
- pwsh: |-
$Package = (Get-ChildItem "$(Build.ArtifactStagingDirectory)/appx" -Recurse -Filter "Cascadia*.msix" | Select -First 1)
$PackageFilename = $Package.FullName
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
& "$(MakeAppxPath)" unpack /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
displayName: Unpack the new Terminal package for signing
- task: EsrpCodeSigning@1
displayName: Submit Terminal's binaries for signing
inputs:
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
FolderPath: '$(Build.SourcesDirectory)\UnpackedTerminalPackage'
signType: batchSigning
batchSignPolicyFile: '$(Build.SourcesDirectory)\build\config\ESRPSigning_Terminal.json'
- pwsh: |-
$PackageFilename = "$(WindowsTerminalPackagePath)"
Remove-Item "$(Build.SourcesDirectory)\UnpackedTerminalPackage\CodeSignSummary*"
& "$(MakeAppxPath)" pack /h SHA256 /o /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
displayName: Re-pack the new Terminal package after signing
- task: PublishBuildArtifacts@1
displayName: Publish Artifact (appx)
inputs:

View File

@@ -58,7 +58,7 @@ Try {
### Check the activatable class entries for a few DLLs we need.
$inProcServers = $Manifest.Package.Extensions.Extension.InProcessServer.Path
$RequiredInProcServers = ("TerminalApp.dll", "Microsoft.Terminal.Control.dll", "Microsoft.Terminal.Remoting.dll", "Microsoft.Terminal.Settings.Editor.dll", "Microsoft.Terminal.Settings.Model.dll", "TerminalConnection.dll")
$RequiredInProcServers = ("TerminalApp.dll", "Microsoft.Terminal.Control.dll", "Microsoft.Terminal.Remoting.dll", "Microsoft.Terminal.Settings.Editor.dll", "Microsoft.Terminal.Settings.Model.dll", "Microsoft.Terminal.Connection.dll")
Write-Verbose "InProc Servers: $inProcServers"

View File

@@ -15,9 +15,9 @@
<VersionBuildRevision Condition="'$(TerminalTargetWindowsVersion)'=='Win11' and '$(VersionBuildRevision)'!=''">$([MSBuild]::Add($(VersionBuildRevision), 1))</VersionBuildRevision>
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
<XesBaseYearForStoreVersion>2022</XesBaseYearForStoreVersion>
<XesBaseYearForStoreVersion>2023</XesBaseYearForStoreVersion>
<VersionMajor>1</VersionMajor>
<VersionMinor>17</VersionMinor>
<VersionMinor>18</VersionMinor>
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
</PropertyGroup>
</Project>

View File

@@ -260,7 +260,7 @@ this:
echo OutDir=$(OutDir)
(xcopy /Y &quot;$(SolutionDir)src\cascadia\ut_app\TerminalApp.Unit.Tests.manifest&quot; &quot;$(OutDir)\TerminalApp.Unit.Tests.manifest*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalConnection\TerminalConnection.dll&quot; &quot;$(OutDir)\TerminalConnection.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalConnection\Microsoft.Terminal.Connection.dll&quot; &quot;$(OutDir)\Microsoft.Terminal.Connection.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalSettings\TerminalSettings.dll&quot; &quot;$(OutDir)\TerminalSettings.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalControl\TerminalControl.dll&quot; &quot;$(OutDir)\TerminalControl.dll*&quot; )
</Command>
@@ -446,7 +446,7 @@ before. The complete `PostBuildEvent` now looks like this:
(xcopy /Y &quot;$(SolutionDir)src\cascadia\ut_app\TerminalApp.Unit.Tests.AppxManifest.xml&quot; &quot;$(OutDir)\TerminalApp.Unit.Tests.AppxManifest.xml*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalConnection\TerminalConnection.dll&quot; &quot;$(OutDir)\TerminalConnection.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalConnection\Microsoft.Terminal.Connection.dll&quot; &quot;$(OutDir)\Microsoft.Terminal.Connection.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalSettings\TerminalSettings.dll&quot; &quot;$(OutDir)\TerminalSettings.dll*&quot; )
(xcopy /Y &quot;$(OpenConsoleCommonOutDir)\TerminalControl\TerminalControl.dll&quot; &quot;$(OutDir)\TerminalControl.dll*&quot; )
</Command>

View File

@@ -49,9 +49,9 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Terminal.TerminalConnection">
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
<Implementation>$(OpenConsoleCommonOutDir)TerminalConnection\TerminalConnection.dll</Implementation>
<Reference Include="Microsoft.Terminal.Connection">
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
<Implementation>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
<Private>true</Private>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>

View File

@@ -28,7 +28,7 @@ namespace winrt::SampleApp::implementation
{
auto settings = winrt::make_self<implementation::MySettings>();
auto connectionSettings{ TerminalConnection::ConptyConnection::CreateSettings(L"cmd.exe /k echo This TermControl is hosted in-proc...",
auto connectionSettings{ Connection::ConptyConnection::CreateSettings(L"cmd.exe /k echo This TermControl is hosted in-proc...",
winrt::hstring{},
L"",
nullptr,
@@ -36,11 +36,11 @@ namespace winrt::SampleApp::implementation
80,
winrt::guid()) };
// "Microsoft.Terminal.TerminalConnection.ConptyConnection"
winrt::hstring myClass{ winrt::name_of<TerminalConnection::ConptyConnection>() };
TerminalConnection::ConnectionInformation connectInfo{ myClass, connectionSettings };
// "Microsoft.Terminal.Connection.ConptyConnection"
winrt::hstring myClass{ winrt::name_of<Connection::ConptyConnection>() };
Connection::ConnectionInformation connectInfo{ myClass, connectionSettings };
TerminalConnection::ITerminalConnection conn{ TerminalConnection::ConnectionInformation::CreateConnection(connectInfo) };
Connection::ITerminalConnection conn{ Connection::ConnectionInformation::CreateConnection(connectInfo) };
Control::TermControl control{ *settings, *settings, conn };
InProcContent().Children().Append(control);

View File

@@ -115,8 +115,8 @@
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</Reference>
<Reference Include="Microsoft.Terminal.TerminalConnection">
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
<Reference Include="Microsoft.Terminal.Connection">
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>

View File

@@ -68,8 +68,8 @@
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</Reference>
<Reference Include="Microsoft.Terminal.TerminalConnection">
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
<Reference Include="Microsoft.Terminal.Connection">
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>

View File

@@ -64,7 +64,7 @@ TRACELOGGING_DECLARE_PROVIDER(g_hSampleAppProvider);
#include <winrt/Microsoft.Terminal.Core.h>
#include <winrt/Microsoft.Terminal.Control.h>
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
#include <winrt/Microsoft.Terminal.Connection.h>
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#include "til.h"

View File

@@ -98,9 +98,9 @@
<Private>true</Private>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
</Reference>
<Reference Include="Microsoft.Terminal.TerminalConnection">
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
<Implementation>$(OpenConsoleCommonOutDir)TerminalConnection\TerminalConnection.dll</Implementation>
<Reference Include="Microsoft.Terminal.Connection">
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
<Implementation>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
<Private>true</Private>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
@@ -201,13 +201,13 @@
<!-- This is the same as the above VC libs hack, but for TerminalConnection.
TerminalConnection depends on cpprest*.dll, and if we don't include it in
the packaging output, we'll crash as soon as we try to load
TerminalConnection.dll.
Microsoft.Terminal.Connection.dll.
The Sample sln needs to do this manually - the real exe has a
ProjectReference to TerminalConnection.vcxproj and can figure this out on
its own. -->
<ItemGroup>
<_TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\TerminalConnection\*.dll" />
<_TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\Microsoft.Terminal.Connection\*.dll" />
<PackagingOutputs Include="@(_TerminalConnectionDlls)">
<ProjectName>$(ProjectName)</ProjectName>

View File

@@ -113,7 +113,7 @@
<com:Class Id="051F34EE-C1FD-4B19-AF75-9BA54648434C"/>
</com:ExeServer>
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
<com:Class Id="52065414-e077-47ec-a3ac-1cc5455e1b54" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
<com:Class Id="52065414-e077-47ec-a3ac-1cc5455e1b54" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
</com:SurrogateServer>
</com:ComServer>
</com:Extension>

View File

@@ -202,7 +202,7 @@
<com:Class Id="86633F1F-6454-40EC-89CE-DA4EBA977EE2"/>
</com:ExeServer>
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
<com:Class Id="02db545a-3e20-46de-83a5-1329b1e88b6b" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
<com:Class Id="02db545a-3e20-46de-83a5-1329b1e88b6b" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
</com:SurrogateServer>
</com:ComServer>
</com:Extension>

View File

@@ -202,7 +202,7 @@
<com:Class Id="E12CFF52-A866-4C77-9A90-F570A7AA2C6B"/>
</com:ExeServer>
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
<com:Class Id="9f156763-7844-4dc4-b2b1-901f640f5155" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
<com:Class Id="9f156763-7844-4dc4-b2b1-901f640f5155" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
</com:SurrogateServer>
</com:ComServer>
</com:Extension>

View File

@@ -9,7 +9,10 @@
#include <wil/stl.h>
#include <wil/resource.h>
#include <wil/win32_helpers.h>
#include <gsl/gsl_util>
#include <gsl/pointers>
#include <shellapi.h>
#include <appmodel.h>
// BODGY
//
@@ -25,18 +28,68 @@
// process can successfully elevate.
#pragma warning(suppress : 26461) // we can't change the signature of wWinMain
int __stdcall wWinMain(HINSTANCE, HINSTANCE, LPWSTR pCmdLine, int)
int __stdcall wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int)
{
// All of the args passed to us (something like `new-tab -p {guid}`) are in
// pCmdLine
// This will invoke an elevated terminal in two possible ways. See GH#14501
// In both scenarios, it passes the entire cmdline as-is to the new process.
//
// #1 discover and invoke the app using the GetCurrentApplicationUserModelId
// api using shell:AppsFolder\package!appid
// cmd: shell:AppsFolder\WindowsTerminalDev_8wekyb3d8bbwe!App
// params: new-tab -p {guid}
//
// #2 find and execute WindowsTerminal.exe
// cmd: {same path as this binary}\WindowsTerminal.exe
// params: new-tab -p {guid}
// Get the path to WindowsTerminal.exe, which should live next to us.
std::filesystem::path module{ wil::GetModuleFileNameW<std::wstring>(nullptr) };
// Swap elevate-shim.exe for WindowsTerminal.exe
module.replace_filename(L"WindowsTerminal.exe");
// see if we're a store app we can invoke with shell:AppsFolder
std::wstring appUserModelId;
const auto result = wil::AdaptFixedSizeToAllocatedResult<std::wstring, APPLICATION_USER_MODEL_ID_MAX_LENGTH>(
appUserModelId, [&](PWSTR value, size_t valueLength, gsl::not_null<size_t*> valueLengthNeededWithNull) noexcept -> HRESULT {
UINT32 length = gsl::narrow_cast<UINT32>(valueLength);
const LONG rc = GetCurrentApplicationUserModelId(&length, value);
switch (rc)
{
case ERROR_SUCCESS:
*valueLengthNeededWithNull = length;
return S_OK;
case ERROR_INSUFFICIENT_BUFFER:
*valueLengthNeededWithNull = length;
return S_FALSE; // trigger allocation loop
case APPMODEL_ERROR_NO_APPLICATION:
return E_FAIL; // we are not running as a store app
default:
return E_UNEXPECTED;
}
});
LOG_IF_FAILED(result);
std::wstring cmd = {};
if (result == S_OK && appUserModelId.length() > 0)
{
// scenario #1
cmd = L"shell:AppsFolder\\" + appUserModelId;
}
else
{
// scenario #2
// Get the path to WindowsTerminal.exe, which should live next to us.
std::filesystem::path module{
wil::GetModuleFileNameW<std::wstring>(nullptr)
};
// Swap elevate-shim.exe for WindowsTerminal.exe
module.replace_filename(L"WindowsTerminal.exe");
cmd = module;
}
// Go!
// The cmdline argument passed to WinMain is stripping the first argument.
// Using GetCommandLine() instead for lParameters
// disable warnings from SHELLEXECUTEINFOW struct. We can't fix that.
#pragma warning(push)
#pragma warning(disable : 26476) // Macro uses naked union over variant.
@@ -46,8 +99,10 @@ int __stdcall wWinMain(HINSTANCE, HINSTANCE, LPWSTR pCmdLine, int)
seInfo.cbSize = sizeof(seInfo);
seInfo.fMask = SEE_MASK_DEFAULT;
seInfo.lpVerb = L"runas"; // This asks the shell to elevate the process
seInfo.lpFile = module.c_str(); // This is `...\WindowsTerminal.exe`
seInfo.lpParameters = pCmdLine; // This is `new-tab -p {guid}`
seInfo.lpFile = cmd.c_str(); // This is `shell:AppsFolder\...` or `...\WindowsTerminal.exe`
seInfo.lpParameters = GetCommandLine(); // This is `new-tab -p {guid}`
seInfo.nShow = SW_SHOWNORMAL;
LOG_IF_WIN32_BOOL_FALSE(ShellExecuteExW(&seInfo));
return 0;
}

View File

@@ -0,0 +1,107 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "../TerminalSettingsModel/NewTabMenuEntry.h"
#include "../TerminalSettingsModel/FolderEntry.h"
#include "../TerminalSettingsModel/CascadiaSettings.h"
#include "../types/inc/colorTable.hpp"
#include "JsonTestClass.h"
#include <defaults.h>
using namespace Microsoft::Console;
using namespace winrt::Microsoft::Terminal;
using namespace winrt::Microsoft::Terminal::Settings::Model::implementation;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace WEX::Common;
namespace SettingsModelLocalTests
{
// TODO:microsoft/terminal#3838:
// Unfortunately, these tests _WILL NOT_ work in our CI. We're waiting for
// an updated TAEF that will let us install framework packages when the test
// package is deployed. Until then, these tests won't deploy in CI.
class NewTabMenuTests : public JsonTestClass
{
// Use a custom AppxManifest to ensure that we can activate winrt types
// from our test. This property will tell taef to manually use this as
// the AppxManifest for this test class.
// This does not yet work for anything XAML-y. See TabTests.cpp for more
// details on that.
BEGIN_TEST_CLASS(NewTabMenuTests)
TEST_CLASS_PROPERTY(L"RunAs", L"UAP")
TEST_CLASS_PROPERTY(L"UAP:AppXManifest", L"TestHostAppXManifest.xml")
END_TEST_CLASS()
TEST_METHOD(DefaultsToRemainingProfiles);
TEST_METHOD(ParseEmptyFolder);
};
void NewTabMenuTests::DefaultsToRemainingProfiles()
{
Log::Comment(L"If the user doesn't customize the menu, put one entry for each profile");
static constexpr std::string_view settingsString{ R"json({
})json" };
try
{
const auto settings{ winrt::make_self<CascadiaSettings>(settingsString, DefaultJson) };
VERIFY_ARE_EQUAL(0u, settings->Warnings().Size());
const auto& entries = settings->GlobalSettings().NewTabMenu();
VERIFY_ARE_EQUAL(1u, entries.Size());
VERIFY_ARE_EQUAL(winrt::Microsoft::Terminal::Settings::Model::NewTabMenuEntryType::RemainingProfiles, entries.GetAt(0).Type());
}
catch (const SettingsException& ex)
{
auto loadError = ex.Error();
loadError;
throw ex;
}
catch (const SettingsTypedDeserializationException& e)
{
auto deserializationErrorMessage = til::u8u16(e.what());
Log::Comment(NoThrowString().Format(deserializationErrorMessage.c_str()));
throw e;
}
}
void NewTabMenuTests::ParseEmptyFolder()
{
Log::Comment(L"GH #14557 - An empty folder entry shouldn't crash");
static constexpr std::string_view settingsString{ R"json({
"newTabMenu": [
{ "type": "folder" }
]
})json" };
try
{
const auto settings{ winrt::make_self<CascadiaSettings>(settingsString, DefaultJson) };
VERIFY_ARE_EQUAL(0u, settings->Warnings().Size());
const auto& entries = settings->GlobalSettings().NewTabMenu();
VERIFY_ARE_EQUAL(1u, entries.Size());
}
catch (const SettingsException& ex)
{
auto loadError = ex.Error();
loadError;
throw ex;
}
catch (const SettingsTypedDeserializationException& e)
{
auto deserializationErrorMessage = til::u8u16(e.what());
Log::Comment(NoThrowString().Format(deserializationErrorMessage.c_str()));
throw e;
}
}
}

View File

@@ -406,6 +406,12 @@ namespace SettingsModelLocalTests
"$schema" : "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-1111-5271-96e7-009a87ff44bf}",
"disabledProfileSources": [ "Windows.Terminal.Wsl" ],
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles": {
"defaults": {
"font": {

View File

@@ -39,6 +39,7 @@
<ClCompile Include="KeyBindingsTests.cpp" />
<ClCompile Include="CommandTests.cpp" />
<ClCompile Include="DeserializationTests.cpp" />
<ClCompile Include="NewTabMenuTests.cpp" />
<ClCompile Include="SerializationTests.cpp" />
<ClCompile Include="TerminalSettingsTests.cpp" />
<ClCompile Include="ThemeTests.cpp" />

View File

@@ -16,12 +16,12 @@ using namespace WEX::TestExecution;
using namespace winrt;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::TerminalApp;
using namespace ::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace ::Microsoft::Terminal::App;
namespace winrt
{
namespace appImpl = TerminalApp::implementation;
namespace appImpl = Microsoft::Terminal::App::implementation;
}
namespace TerminalAppLocalTests
@@ -1571,7 +1571,7 @@ namespace TerminalAppLocalTests
void CommandlineTest::TestSimpleExecuteCommandlineAction()
{
ExecuteCommandlineArgs args{ L"new-tab" };
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
VERIFY_ARE_EQUAL(1u, actions.size());
auto actionAndArgs = actions.at(0);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@@ -1590,7 +1590,7 @@ namespace TerminalAppLocalTests
void CommandlineTest::TestMultipleCommandExecuteCommandlineAction()
{
ExecuteCommandlineArgs args{ L"new-tab ; split-pane" };
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
VERIFY_ARE_EQUAL(2u, actions.size());
{
auto actionAndArgs = actions.at(0);
@@ -1626,7 +1626,7 @@ namespace TerminalAppLocalTests
{
// -H and -V cannot be combined.
ExecuteCommandlineArgs args{ L"split-pane -H -V" };
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
VERIFY_ARE_EQUAL(0u, actions.size());
}

View File

@@ -31,10 +31,10 @@ namespace TerminalAppLocalTests
void FilteredCommandTests::VerifyHighlighting()
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
{
Log::Comment(L"Testing command name segmentation with no filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
@@ -42,7 +42,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with empty filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
@@ -51,7 +51,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter equals to the string");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
@@ -60,7 +60,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter with first character matching");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"A";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 2u);
@@ -71,7 +71,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter with other case");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"a";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 2u);
@@ -82,7 +82,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter matching several characters");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"ab";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 4u);
@@ -97,7 +97,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with non matching filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"abcd";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
@@ -112,17 +112,17 @@ namespace TerminalAppLocalTests
void FilteredCommandTests::VerifyWeight()
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
{
Log::Comment(L"Testing weight of command with no filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 0);
}
{
Log::Comment(L"Testing weight of command with empty filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
@@ -130,7 +130,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing weight of command with filter equals to the string");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
@@ -138,7 +138,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing weight of command with filter with first character matching");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"A";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
@@ -146,7 +146,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing weight of command with filter with other case");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"a";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
@@ -154,7 +154,7 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing weight of command with filter matching several characters");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"ab";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
@@ -168,45 +168,45 @@ namespace TerminalAppLocalTests
void FilteredCommandTests::VerifyCompare()
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto paletteItem2{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"BBBBBCCC") };
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto paletteItem2{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"BBBBBCCC") };
{
Log::Comment(L"Testing comparison of commands with no filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
}
{
Log::Comment(L"Testing comparison of commands with empty filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
filteredCommand->_Weight = filteredCommand->_computeWeight();
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
filteredCommand2->_Filter = L"";
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
}
{
Log::Comment(L"Testing comparison of commands with different weights");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"B";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
filteredCommand->_Weight = filteredCommand->_computeWeight();
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
filteredCommand2->_Filter = L"B";
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
VERIFY_IS_TRUE(filteredCommand->Weight() < filteredCommand2->Weight()); // Second command gets more points due to the beginning of the word
VERIFY_IS_FALSE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
VERIFY_IS_FALSE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
}
});
@@ -216,14 +216,14 @@ namespace TerminalAppLocalTests
void FilteredCommandTests::VerifyCompareIgnoreCase()
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"a") };
const auto paletteItem2{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"B") };
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"a") };
const auto paletteItem2{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"B") };
{
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
}
});

View File

@@ -10,7 +10,7 @@ using namespace Microsoft::Console;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace WEX::Common;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::Microsoft::Terminal::Control;
@@ -164,7 +164,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -287,7 +287,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -412,7 +412,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -527,7 +527,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -621,7 +621,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -744,7 +744,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -880,7 +880,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -982,7 +982,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
@@ -1205,7 +1205,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${scheme.name}", realArgs.TerminalArgs().Profile());
}
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

View File

@@ -12,8 +12,8 @@
#include "CppWinrtTailored.h"
using namespace Microsoft::Console;
using namespace TerminalApp;
using namespace winrt::TerminalApp;
using namespace Microsoft::Terminal::App;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace WEX::Logging;
@@ -107,9 +107,9 @@ namespace TerminalAppLocalTests
}
private:
void _initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
void _initializeTerminalPage(winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage>& page,
CascadiaSettings initialSettings);
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> _commonSetup();
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> _commonSetup();
};
template<typename TFunction>
@@ -139,7 +139,7 @@ namespace TerminalAppLocalTests
{
// Verify we can create a WinRT type we authored
// Just creating it is enough to know that everything is working.
winrt::Microsoft::Terminal::TerminalConnection::EchoConnection conn{};
winrt::Microsoft::Terminal::Connection::EchoConnection conn{};
VERIFY_IS_NOT_NULL(conn);
// We're doing this test separately from the TryCreateSettingsType test,
// to ensure both dependent binaries (TerminalSettings and
@@ -170,10 +170,10 @@ namespace TerminalAppLocalTests
void TabTests::CreateSimpleTerminalXamlType()
{
winrt::com_ptr<winrt::TerminalApp::implementation::MinMaxCloseControl> mmcc{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::MinMaxCloseControl> mmcc{ nullptr };
auto result = RunOnUIThread([&mmcc]() {
mmcc = winrt::make_self<winrt::TerminalApp::implementation::MinMaxCloseControl>();
mmcc = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::MinMaxCloseControl>();
VERIFY_IS_NOT_NULL(mmcc);
});
VERIFY_SUCCEEDED(result);
@@ -181,10 +181,10 @@ namespace TerminalAppLocalTests
void TabTests::CreateTerminalMuxXamlType()
{
winrt::com_ptr<winrt::TerminalApp::implementation::TabRowControl> tabRowControl{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TabRowControl> tabRowControl{ nullptr };
auto result = RunOnUIThread([&tabRowControl]() {
tabRowControl = winrt::make_self<winrt::TerminalApp::implementation::TabRowControl>();
tabRowControl = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::TabRowControl>();
VERIFY_IS_NOT_NULL(tabRowControl);
});
VERIFY_SUCCEEDED(result);
@@ -192,10 +192,10 @@ namespace TerminalAppLocalTests
void TabTests::CreateTerminalPage()
{
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
auto result = RunOnUIThread([&page]() {
page = winrt::make_self<winrt::TerminalApp::implementation::TerminalPage>();
page = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::TerminalPage>();
VERIFY_IS_NOT_NULL(page);
});
VERIFY_SUCCEEDED(result);
@@ -226,7 +226,7 @@ namespace TerminalAppLocalTests
// - initialSettings: a CascadiaSettings to initialize the TerminalPage with.
// Return Value:
// - <none>
void TabTests::_initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
void TabTests::_initializeTerminalPage(winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage>& page,
CascadiaSettings initialSettings)
{
// This is super wacky, but we can't just initialize the
@@ -237,12 +237,12 @@ namespace TerminalAppLocalTests
// Instead, create the winrt object, then get a com_ptr to the
// implementation _from_ the winrt object. This seems to work, even if
// it's weird.
winrt::TerminalApp::TerminalPage projectedPage{ nullptr };
winrt::Microsoft::Terminal::App::TerminalPage projectedPage{ nullptr };
Log::Comment(NoThrowString().Format(L"Construct the TerminalPage"));
auto result = RunOnUIThread([&projectedPage, &page, initialSettings]() {
projectedPage = winrt::TerminalApp::TerminalPage();
page.copy_from(winrt::get_self<winrt::TerminalApp::implementation::TerminalPage>(projectedPage));
projectedPage = winrt::Microsoft::Terminal::App::TerminalPage();
page.copy_from(winrt::get_self<winrt::Microsoft::Terminal::App::implementation::TerminalPage>(projectedPage));
page->_settings = initialSettings;
});
VERIFY_SUCCEEDED(result);
@@ -278,7 +278,7 @@ namespace TerminalAppLocalTests
auto app = ::winrt::Windows::UI::Xaml::Application::Current();
winrt::TerminalApp::TerminalPage pp = *page;
winrt::Microsoft::Terminal::App::TerminalPage pp = *page;
winrt::Windows::UI::Xaml::Window::Current().Content(pp);
winrt::Windows::UI::Xaml::Window::Current().Activate();
});
@@ -334,7 +334,7 @@ namespace TerminalAppLocalTests
// Instead, create the winrt object, then get a com_ptr to the
// implementation _from_ the winrt object. This seems to work, even if
// it's weird.
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
_initializeTerminalPage(page, settings0);
auto result = RunOnUIThread([&page]() {
@@ -399,7 +399,7 @@ namespace TerminalAppLocalTests
// Instead, create the winrt object, then get a com_ptr to the
// implementation _from_ the winrt object. This seems to work, even if
// it's weird.
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
_initializeTerminalPage(page, settings0);
auto result = RunOnUIThread([&page]() {
@@ -486,7 +486,7 @@ namespace TerminalAppLocalTests
// Instead, create the winrt object, then get a com_ptr to the
// implementation _from_ the winrt object. This seems to work, even if
// it's weird.
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
_initializeTerminalPage(page, settings0);
auto result = RunOnUIThread([&page]() {
@@ -551,7 +551,7 @@ namespace TerminalAppLocalTests
// - <none>
// Return Value:
// - The initialized TerminalPage, ready to use.
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> TabTests::_commonSetup()
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> TabTests::_commonSetup()
{
static constexpr std::wstring_view settingsJson0{ LR"(
{
@@ -668,7 +668,7 @@ namespace TerminalAppLocalTests
// Instead, create the winrt object, then get a com_ptr to the
// implementation _from_ the winrt object. This seems to work, even if
// it's weird.
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
_initializeTerminalPage(page, settings0);
auto result = RunOnUIThread([&page]() {
@@ -1225,9 +1225,9 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"a", page->_mruTabs.GetAt(3).Title());
});
const auto palette = winrt::get_self<winrt::TerminalApp::implementation::CommandPalette>(page->CommandPalette());
const auto palette = winrt::get_self<winrt::Microsoft::Terminal::App::implementation::CommandPalette>(page->CommandPalette());
VERIFY_ARE_EQUAL(winrt::TerminalApp::implementation::CommandPaletteMode::TabSwitchMode, palette->_currentMode, L"Verify we are in the tab switcher mode");
VERIFY_ARE_EQUAL(winrt::Microsoft::Terminal::App::implementation::CommandPaletteMode::TabSwitchMode, palette->_currentMode, L"Verify we are in the tab switcher mode");
// At this point, the contents of the command palette's _mruTabs list is
// still the _old_ ordering (d, c, b, a). The ordering is only updated
// in TerminalPage::_SelectNextTab, but as we saw before, the palette
@@ -1242,7 +1242,7 @@ namespace TerminalAppLocalTests
END_TEST_METHOD_PROPERTIES()
auto page = _commonSetup();
page->RenameWindowRequested([&page](auto&&, const winrt::TerminalApp::RenameWindowRequestedArgs args) {
page->RenameWindowRequested([&page](auto&&, const winrt::Microsoft::Terminal::App::RenameWindowRequestedArgs args) {
// In the real terminal, this would bounce up to the monarch and
// come back down. Instead, immediately call back and set the name.
page->WindowName(args.ProposedName());

View File

@@ -14,6 +14,7 @@
<UseWmXml>true</UseWmXml>
<ConfigurationType>Application</ConfigurationType>
<OpenConsoleCppWinRTProject>true</OpenConsoleCppWinRTProject>
<EnableHybridCRT>false</EnableHybridCRT> <!-- C++/CLI projects can't deal -->
<!--
These two properties are very important!
@@ -151,7 +152,7 @@
rules instead.
-->
<ItemGroup>
<TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\TerminalConnection\*.dll"/>
<TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\Microsoft.Terminal.Connection\*.dll"/>
</ItemGroup>
<!-- Copy the AppxManifest.xml to another file, because when TAEF is

View File

@@ -55,7 +55,7 @@ Author(s):
#include <winrt/windows.applicationmodel.core.h>
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
#include <winrt/Microsoft.Terminal.Connection.h>
#include <winrt/Microsoft.Terminal.Settings.Model.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>

View File

@@ -60,4 +60,4 @@
<AdditionalDependencies>Uiautomationcore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
</Project>
</Project>

View File

@@ -97,7 +97,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// You can emulate the monarch dying by: starting a terminal, sticking a
// breakpoint in
// TerminalApp!winrt::TerminalApp::implementation::AppLogic::_doFindTargetWindow,
// Microsoft.Terminal.App!winrt::Microsoft::Terminal::App::implementation::AppLogic::_doFindTargetWindow,
// starting a defterm, and when that BP gets hit, kill the original
// monarch, and see what happens here.

View File

@@ -2,7 +2,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{f2ed628a-db22-446f-a081-4cc845b51a2b}</ProjectGuid>
<ProjectName>WindowsTerminalShellExt</ProjectName>
<ProjectName>Microsoft.Terminal.ShellExtension</ProjectName>
<RootNamespace>Microsoft.Terminal.ShellExtension</RootNamespace>
<!-- cppwinrt.build.pre.props depends on these settings: -->
<!-- build a dll, not exe (Application) -->

View File

@@ -34,4 +34,4 @@ DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
}
// Usurp the TerminalApp's Context Menu specific resource group.
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/ContextMenu")
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.App/ContextMenu")

View File

@@ -8,7 +8,7 @@
#include "ActionPaletteItem.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::System;
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
ActionPaletteItem::ActionPaletteItem(const Microsoft::Terminal::Settings::Model::Command& command) :
_Command(command)

View File

@@ -6,7 +6,7 @@
#include "PaletteItem.h"
#include "ActionPaletteItem.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct ActionPaletteItem : ActionPaletteItemT<ActionPaletteItem, PaletteItem>
{
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(ActionPaletteItem);
}

View File

@@ -3,7 +3,7 @@
import "PaletteItem.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass ActionPaletteItem : PaletteItem
{

View File

@@ -18,9 +18,9 @@ using namespace winrt::Windows::ApplicationModel::DataTransfer;
using namespace winrt::Windows::UI::Text;
using namespace winrt::Microsoft::Terminal;
using namespace winrt::Microsoft::Terminal::Control;
using namespace winrt::Microsoft::Terminal::TerminalConnection;
using namespace winrt::Microsoft::Terminal::Connection;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace ::TerminalApp;
using namespace ::Microsoft::Terminal::App;
using namespace ::Microsoft::Console;
using namespace std::chrono_literals;
namespace winrt
@@ -30,7 +30,7 @@ namespace winrt
using IInspectable = Windows::Foundation::IInspectable;
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Method Description:
// - Stop previewing the currently previewed action. We can use this to

View File

@@ -1,6 +1,6 @@
#pragma once
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
template<typename D, typename... I>
struct App_baseWithProvider : public App_base<D, ::winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider>
@@ -24,7 +24,7 @@ namespace winrt::TerminalApp::implementation
private:
bool _contentLoaded{ false };
winrt::TerminalApp::XamlMetaDataProvider _appProvider;
winrt::Microsoft::Terminal::App::XamlMetaDataProvider _appProvider;
};
template<typename D, typename... I>

View File

@@ -14,7 +14,7 @@ using namespace winrt::Windows::UI::Xaml::Navigation;
namespace xaml = ::winrt::Windows::UI::Xaml;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
App::App()
{

View File

@@ -7,7 +7,7 @@
#include "App.base.h"
#include <winrt/Windows.UI.Xaml.Hosting.h>
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct App : AppT2<App>
{
@@ -16,7 +16,7 @@ namespace winrt::TerminalApp::implementation
void OnLaunched(const Windows::ApplicationModel::Activation::LaunchActivatedEventArgs&);
void Initialize();
TerminalApp::AppLogic Logic();
Microsoft::Terminal::App::AppLogic Logic();
void Close();
@@ -33,7 +33,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
struct App : AppT<App, implementation::App>
{

View File

@@ -3,7 +3,7 @@
import "AppLogic.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
// ADD ARBITRARY APP LOGIC TO AppLogic.idl, NOT HERE.
// This is for XAML platform setup only.

View File

@@ -2,12 +2,12 @@
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<Application x:Class="TerminalApp.App"
<Application x:Class="Microsoft.Terminal.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:TA="using:TerminalApp"
xmlns:TA="using:Microsoft.Terminal.App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:local="using:Microsoft.Terminal.App"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<!--

View File

@@ -18,8 +18,8 @@ using namespace winrt::Windows::System;
using namespace winrt::Microsoft::Terminal;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::Microsoft::Terminal::Control;
using namespace winrt::Microsoft::Terminal::TerminalConnection;
using namespace ::TerminalApp;
using namespace winrt::Microsoft::Terminal::Connection;
using namespace ::Microsoft::Terminal::App;
namespace winrt
{
@@ -27,7 +27,7 @@ namespace winrt
using IInspectable = Windows::Foundation::IInspectable;
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
void TerminalPage::_HandleOpenNewTabDropdown(const IInspectable& /*sender*/,
const ActionEventArgs& args)
@@ -721,7 +721,7 @@ namespace winrt::TerminalApp::implementation
}
// Since _RemoveTabs is asynchronous, create a snapshot of the tabs we want to remove
std::vector<winrt::TerminalApp::TabBase> tabsToRemove;
std::vector<winrt::Microsoft::Terminal::App::TabBase> tabsToRemove;
if (index > 0)
{
std::copy(begin(_tabs), begin(_tabs) + index, std::back_inserter(tabsToRemove));
@@ -760,7 +760,7 @@ namespace winrt::TerminalApp::implementation
}
// Since _RemoveTabs is asynchronous, create a snapshot of the tabs we want to remove
std::vector<winrt::TerminalApp::TabBase> tabsToRemove;
std::vector<winrt::Microsoft::Terminal::App::TabBase> tabsToRemove;
std::copy(begin(_tabs) + index + 1, end(_tabs), std::back_inserter(tabsToRemove));
_RemoveTabs(tabsToRemove);

View File

@@ -8,7 +8,7 @@
#include <LibraryResources.h>
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace TerminalApp;
using namespace Microsoft::Terminal::App;
// Either a ; at the start of a line, or a ; preceded by any non-\ char.
const std::wregex AppCommandlineArgs::_commandDelimiterRegex{ LR"(^;|[^\\];)" };
@@ -980,7 +980,7 @@ int AppCommandlineArgs::ParseArgs(winrt::array_view<const winrt::hstring>& args)
}
}
auto commands = ::TerminalApp::AppCommandlineArgs::BuildCommands(args);
auto commands = ::Microsoft::Terminal::App::AppCommandlineArgs::BuildCommands(args);
for (auto& cmdBlob : commands)
{

View File

@@ -12,12 +12,12 @@ namespace TerminalAppLocalTests
};
#endif
namespace TerminalApp
namespace Microsoft::Terminal::App
{
class AppCommandlineArgs;
};
class TerminalApp::AppCommandlineArgs final
class Microsoft::Terminal::App::AppCommandlineArgs final
{
public:
static constexpr std::string_view NixHelpFlag{ "-?" };

View File

@@ -7,10 +7,10 @@
#include "AppKeyBindings.g.cpp"
using namespace winrt::Microsoft::Terminal;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Microsoft::Terminal::Control;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
bool AppKeyBindings::TryKeyChord(const KeyChord& kc)
{
@@ -26,7 +26,7 @@ namespace winrt::TerminalApp::implementation
return _actionMap.IsKeyChordExplicitlyUnbound(kc);
}
void AppKeyBindings::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
void AppKeyBindings::SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch)
{
_dispatch = dispatch;
}

View File

@@ -12,7 +12,7 @@ namespace TerminalAppLocalTests
class SettingsTests;
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct AppKeyBindings : AppKeyBindingsT<AppKeyBindings>
{
@@ -21,19 +21,19 @@ namespace winrt::TerminalApp::implementation
bool TryKeyChord(const winrt::Microsoft::Terminal::Control::KeyChord& kc);
bool IsKeyChordExplicitlyUnbound(const winrt::Microsoft::Terminal::Control::KeyChord& kc);
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
void SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch);
void SetActionMap(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap);
private:
winrt::Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
winrt::TerminalApp::ShortcutActionDispatch _dispatch{ nullptr };
winrt::Microsoft::Terminal::App::ShortcutActionDispatch _dispatch{ nullptr };
friend class TerminalAppLocalTests::SettingsTests;
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(AppKeyBindings);
}

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
import "ShortcutActionDispatch.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass AppKeyBindings : Microsoft.Terminal.Control.IKeyBindings
{

View File

@@ -23,7 +23,7 @@ using namespace winrt::Windows::System;
using namespace winrt::Microsoft::Terminal;
using namespace winrt::Microsoft::Terminal::Control;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace ::TerminalApp;
using namespace ::Microsoft::Terminal::App;
namespace winrt
{
@@ -135,7 +135,7 @@ static Documents::Run _BuildErrorRun(const winrt::hstring& text, const ResourceD
return textRun;
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Function Description:
// - Get the AppLogic for the current active Xaml application, or null if there isn't one.
@@ -145,7 +145,7 @@ namespace winrt::TerminalApp::implementation
AppLogic* AppLogic::Current() noexcept
try
{
if (auto currentXamlApp{ winrt::Windows::UI::Xaml::Application::Current().try_as<winrt::TerminalApp::App>() })
if (auto currentXamlApp{ winrt::Windows::UI::Xaml::Application::Current().try_as<winrt::Microsoft::Terminal::App::App>() })
{
if (auto appLogicPointer{ winrt::get_self<AppLogic>(currentXamlApp.Logic()) })
{
@@ -169,7 +169,7 @@ namespace winrt::TerminalApp::implementation
// - HR E_INVALIDARG if the app isn't up and running.
const CascadiaSettings AppLogic::CurrentAppSettings()
{
auto appLogic{ ::winrt::TerminalApp::implementation::AppLogic::Current() };
auto appLogic{ ::winrt::Microsoft::Terminal::App::implementation::AppLogic::Current() };
THROW_HR_IF_NULL(E_INVALIDARG, appLogic);
return appLogic->GetSettings();
}
@@ -463,7 +463,7 @@ namespace winrt::TerminalApp::implementation
{
if (!_settingsLoadExceptionText.empty())
{
warningsTextBlock.Inlines().Append(_BuildErrorRun(_settingsLoadExceptionText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::TerminalApp::App>().Resources()));
warningsTextBlock.Inlines().Append(_BuildErrorRun(_settingsLoadExceptionText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::Microsoft::Terminal::App::App>().Resources()));
warningsTextBlock.Inlines().Append(Documents::LineBreak{});
}
}
@@ -507,7 +507,7 @@ namespace winrt::TerminalApp::implementation
const auto warningText = _GetWarningText(warning);
if (!warningText.empty())
{
warningsTextBlock.Inlines().Append(_BuildErrorRun(warningText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::TerminalApp::App>().Resources()));
warningsTextBlock.Inlines().Append(_BuildErrorRun(warningText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::Microsoft::Terminal::App::App>().Resources()));
warningsTextBlock.Inlines().Append(Documents::LineBreak{});
}
}
@@ -726,7 +726,7 @@ namespace winrt::TerminalApp::implementation
// - defaultInitialY: the system default y coordinate value
// Return Value:
// - a point containing the requested initial position in pixels.
TerminalApp::InitialPosition AppLogic::GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY)
Microsoft::Terminal::App::InitialPosition AppLogic::GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY)
{
if (!_loadedInitialSettings)
{
@@ -1223,7 +1223,7 @@ namespace winrt::TerminalApp::implementation
}
}
winrt::TerminalApp::TaskbarState AppLogic::TaskbarState()
winrt::Microsoft::Terminal::App::TaskbarState AppLogic::TaskbarState()
{
if (_root)
{
@@ -1330,7 +1330,7 @@ namespace winrt::TerminalApp::implementation
int32_t AppLogic::ExecuteCommandline(array_view<const winrt::hstring> args,
const winrt::hstring& cwd)
{
::TerminalApp::AppCommandlineArgs appArgs;
::Microsoft::Terminal::App::AppCommandlineArgs appArgs;
auto result = appArgs.ParseArgs(args);
if (result == 0)
{
@@ -1365,7 +1365,7 @@ namespace winrt::TerminalApp::implementation
// - WindowingBehaviorUseAnyExisting: We should handle the args "in the current
// window ON ANY DESKTOP"
// - anything else: We should handle the commandline in the window with the given ID.
TerminalApp::FindTargetWindowResult AppLogic::FindTargetWindow(array_view<const winrt::hstring> args)
Microsoft::Terminal::App::FindTargetWindowResult AppLogic::FindTargetWindow(array_view<const winrt::hstring> args)
{
if (!_loadedInitialSettings)
{
@@ -1377,10 +1377,10 @@ namespace winrt::TerminalApp::implementation
}
// The main body of this function is a static helper, to facilitate unit-testing
TerminalApp::FindTargetWindowResult AppLogic::_doFindTargetWindow(array_view<const winrt::hstring> args,
Microsoft::Terminal::App::FindTargetWindowResult AppLogic::_doFindTargetWindow(array_view<const winrt::hstring> args,
const Microsoft::Terminal::Settings::Model::WindowingMode& windowingBehavior)
{
::TerminalApp::AppCommandlineArgs appArgs;
::Microsoft::Terminal::App::AppCommandlineArgs appArgs;
const auto result = appArgs.ParseArgs(args);
if (result == 0)
{

View File

@@ -21,7 +21,7 @@ namespace TerminalAppLocalTests
};
#endif
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct FindTargetWindowResult : FindTargetWindowResultT<FindTargetWindowResult>
{
@@ -72,7 +72,7 @@ namespace winrt::TerminalApp::implementation
bool HasSettingsStartupActions() const noexcept;
int32_t SetStartupCommandline(array_view<const winrt::hstring> actions);
int32_t ExecuteCommandline(array_view<const winrt::hstring> actions, const winrt::hstring& cwd);
TerminalApp::FindTargetWindowResult FindTargetWindow(array_view<const winrt::hstring> actions);
Microsoft::Terminal::App::FindTargetWindowResult FindTargetWindow(array_view<const winrt::hstring> actions);
winrt::hstring ParseCommandlineMessage();
bool ShouldExitEarly();
@@ -100,7 +100,7 @@ namespace winrt::TerminalApp::implementation
Windows::Foundation::Size GetLaunchDimensions(uint32_t dpi);
bool CenterOnLaunch();
TerminalApp::InitialPosition GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY);
Microsoft::Terminal::App::InitialPosition GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY);
winrt::Windows::UI::Xaml::ElementTheme GetRequestedTheme();
Microsoft::Terminal::Settings::Model::LaunchMode GetLaunchMode();
bool GetShowTabsInTitlebar();
@@ -118,7 +118,7 @@ namespace winrt::TerminalApp::implementation
void CloseWindow(Microsoft::Terminal::Settings::Model::LaunchPosition position);
void WindowVisibilityChanged(const bool showOrHide);
winrt::TerminalApp::TaskbarState TaskbarState();
winrt::Microsoft::Terminal::App::TaskbarState TaskbarState();
winrt::Windows::UI::Xaml::Media::Brush TitlebarBrush();
void WindowActivated(const bool activated);
@@ -145,7 +145,7 @@ namespace winrt::TerminalApp::implementation
TYPED_EVENT(RequestedThemeChanged, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Settings::Model::Theme);
TYPED_EVENT(SettingsChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(SystemMenuChangeRequested, winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::SystemMenuChangeArgs);
TYPED_EVENT(SystemMenuChangeRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::SystemMenuChangeArgs);
private:
bool _isUwp{ false };
@@ -168,8 +168,8 @@ namespace winrt::TerminalApp::implementation
std::shared_mutex _dialogLock;
winrt::Windows::UI::Xaml::Controls::ContentDialog _dialog;
::TerminalApp::AppCommandlineArgs _appArgs;
::TerminalApp::AppCommandlineArgs _settingsAppArgs;
::Microsoft::Terminal::App::AppCommandlineArgs _appArgs;
::Microsoft::Terminal::App::AppCommandlineArgs _settingsAppArgs;
std::shared_ptr<ThrottledFuncTrailing<>> _reloadSettings;
til::throttled_func_trailing<> _reloadState;
@@ -179,7 +179,7 @@ namespace winrt::TerminalApp::implementation
winrt::com_ptr<LanguageProfileNotifier> _languageProfileNotifier;
wil::unique_folder_change_reader_nothrow _reader;
static TerminalApp::FindTargetWindowResult _doFindTargetWindow(winrt::array_view<const hstring> args,
static Microsoft::Terminal::App::FindTargetWindowResult _doFindTargetWindow(winrt::array_view<const hstring> args,
const Microsoft::Terminal::Settings::Model::WindowingMode& windowingBehavior);
void _ShowLoadErrorsDialog(const winrt::hstring& titleKey, const winrt::hstring& contentKey, HRESULT settingsLoadedResult);
@@ -207,7 +207,7 @@ namespace winrt::TerminalApp::implementation
// directly to them.
FORWARDED_TYPED_EVENT(SetTitleBarContent, winrt::Windows::Foundation::IInspectable, winrt::Windows::UI::Xaml::UIElement, _root, SetTitleBarContent);
FORWARDED_TYPED_EVENT(TitleChanged, winrt::Windows::Foundation::IInspectable, winrt::hstring, _root, TitleChanged);
FORWARDED_TYPED_EVENT(LastTabClosed, winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::LastTabClosedEventArgs, _root, LastTabClosed);
FORWARDED_TYPED_EVENT(LastTabClosed, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::LastTabClosedEventArgs, _root, LastTabClosed);
FORWARDED_TYPED_EVENT(FocusModeChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, FocusModeChanged);
FORWARDED_TYPED_EVENT(FullscreenChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, FullscreenChanged);
FORWARDED_TYPED_EVENT(ChangeMaximizeRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, ChangeMaximizeRequested);
@@ -215,7 +215,7 @@ namespace winrt::TerminalApp::implementation
FORWARDED_TYPED_EVENT(RaiseVisualBell, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, RaiseVisualBell);
FORWARDED_TYPED_EVENT(SetTaskbarProgress, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, SetTaskbarProgress);
FORWARDED_TYPED_EVENT(IdentifyWindowsRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IdentifyWindowsRequested);
FORWARDED_TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::RenameWindowRequestedArgs, _root, RenameWindowRequested);
FORWARDED_TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::RenameWindowRequestedArgs, _root, RenameWindowRequested);
FORWARDED_TYPED_EVENT(IsQuakeWindowChanged, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IsQuakeWindowChanged);
FORWARDED_TYPED_EVENT(SummonWindowRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, SummonWindowRequested);
FORWARDED_TYPED_EVENT(CloseRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, CloseRequested);
@@ -229,7 +229,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(AppLogic);
}

View File

@@ -5,7 +5,7 @@ import "TerminalPage.idl";
import "ShortcutActionDispatch.idl";
import "IDirectKeyListener.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
struct InitialPosition
{
@@ -137,7 +137,7 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, Object> CloseRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
event Windows.Foundation.TypedEventHandler<Object, Object> QuitRequested;
event Windows.Foundation.TypedEventHandler<Object, TerminalApp.SystemMenuChangeArgs> SystemMenuChangeRequested;
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.App.SystemMenuChangeArgs> SystemMenuChangeRequested;
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Control.ShowWindowArgs> ShowWindowChanged;
}
}

View File

@@ -2,7 +2,7 @@
#include "ColorHelper.h"
#include <limits>
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
// Method Description:
// Determines whether or not a given color is light

View File

@@ -3,7 +3,7 @@
#include <winrt/windows.ui.core.h>
namespace winrt::TerminalApp
namespace winrt::Microsoft::Terminal::App
{
class HSL
{

View File

@@ -6,7 +6,7 @@
#include "winrt/Windows.UI.Xaml.Interop.h"
#include <LibraryResources.h>
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Method Description:
// - Default constructor, localizes the buttons and hooks

View File

@@ -1,7 +1,7 @@
#pragma once
#include "ColorPickupFlyout.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout>
{
@@ -13,12 +13,12 @@ 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);
WINRT_CALLBACK(ColorCleared, TerminalApp::ColorClearedArgs);
WINRT_CALLBACK(ColorSelected, TerminalApp::ColorSelectedArgs);
WINRT_CALLBACK(ColorCleared, Microsoft::Terminal::App::ColorClearedArgs);
WINRT_CALLBACK(ColorSelected, Microsoft::Terminal::App::ColorSelectedArgs);
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(ColorPickupFlyout);
}

View File

@@ -1,4 +1,4 @@
namespace TerminalApp
namespace Microsoft.Terminal.App
{
delegate void ColorSelectedArgs(Windows.UI.Color color);
delegate void ColorClearedArgs();

View File

@@ -1,8 +1,8 @@
<Flyout x:Class="TerminalApp.ColorPickupFlyout"
<Flyout x:Class="Microsoft.Terminal.App.ColorPickupFlyout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:local="using:Microsoft.Terminal.App"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
Placement="Bottom"

View File

@@ -8,7 +8,7 @@
#include "CommandLinePaletteItem.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::System;
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
CommandLinePaletteItem::CommandLinePaletteItem(const winrt::hstring& commandLine) :
_CommandLine(commandLine)

View File

@@ -6,7 +6,7 @@
#include "PaletteItem.h"
#include "CommandLinePaletteItem.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct CommandLinePaletteItem : CommandLinePaletteItemT<CommandLinePaletteItem, PaletteItem>
{
@@ -17,7 +17,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(CommandLinePaletteItem);
}

View File

@@ -1,7 +1,7 @@
import "PaletteItem.idl";
import "TabBase.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass CommandLinePaletteItem : PaletteItem
{

View File

@@ -11,7 +11,7 @@
#include "CommandPalette.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::UI::Xaml::Controls;
@@ -20,7 +20,7 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
CommandPalette::CommandPalette() :
_switcherStartIdx{ 0 }
@@ -30,12 +30,12 @@ namespace winrt::TerminalApp::implementation
_itemTemplateSelector = Resources().Lookup(winrt::box_value(L"PaletteItemTemplateSelector")).try_as<PaletteItemTemplateSelector>();
_listItemTemplate = Resources().Lookup(winrt::box_value(L"ListItemTemplate")).try_as<DataTemplate>();
_filteredActions = winrt::single_threaded_observable_vector<winrt::TerminalApp::FilteredCommand>();
_nestedActionStack = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
_currentNestedCommands = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
_allCommands = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
_tabActions = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
_mruTabActions = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
_filteredActions = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_nestedActionStack = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_currentNestedCommands = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_allCommands = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_tabActions = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_mruTabActions = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
_switchToMode(CommandPaletteMode::ActionMode);
@@ -226,14 +226,14 @@ namespace winrt::TerminalApp::implementation
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
{
const auto selectedCommand = _filteredActionsView().SelectedItem();
const auto filteredCommand{ selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>() };
const auto filteredCommand{ selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() };
if (_currentMode == CommandPaletteMode::TabSwitchMode)
{
_switchToTab(filteredCommand);
}
else if (_currentMode == CommandPaletteMode::ActionMode && filteredCommand != nullptr)
{
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
{
_PreviewActionHandlers(*this, actionPaletteItem.Command());
}
@@ -332,7 +332,7 @@ namespace winrt::TerminalApp::implementation
}
const auto selectedCommand = _filteredActionsView().SelectedItem();
const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>();
const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>();
_dispatchCommand(filteredCommand);
e.Handled(true);
}
@@ -371,7 +371,7 @@ namespace winrt::TerminalApp::implementation
}
else if (key == VirtualKey::Right && _currentMode == CommandPaletteMode::CommandlineMode)
{
if (const auto command{ _filteredActionsView().SelectedItem().try_as<winrt::TerminalApp::FilteredCommand>() })
if (const auto command{ _filteredActionsView().SelectedItem().try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() })
{
_searchBox().Text(command.Item().Name());
_searchBox().Select(_searchBox().Text().size(), 0);
@@ -427,7 +427,7 @@ namespace winrt::TerminalApp::implementation
if (!ctrlDown && !altDown && !shiftDown)
{
const auto selectedCommand = _filteredActionsView().SelectedItem();
if (const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>())
if (const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>())
{
_dispatchCommand(filteredCommand);
}
@@ -524,7 +524,7 @@ namespace winrt::TerminalApp::implementation
const Windows::UI::Xaml::Controls::ItemClickEventArgs& e)
{
const auto selectedCommand = e.ClickedItem();
if (const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>())
if (const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>())
{
_dispatchCommand(filteredCommand);
}
@@ -542,9 +542,9 @@ namespace winrt::TerminalApp::implementation
if (const auto selectedList = e.AddedItems(); selectedList.Size() > 0)
{
const auto selectedCommand = selectedList.GetAt(0);
if (const auto filteredCmd = selectedCommand.try_as<TerminalApp::FilteredCommand>())
if (const auto filteredCmd = selectedCommand.try_as<Microsoft::Terminal::App::FilteredCommand>())
{
if (const auto paletteItem = filteredCmd.Item().try_as<TerminalApp::PaletteItem>())
if (const auto paletteItem = filteredCmd.Item().try_as<Microsoft::Terminal::App::PaletteItem>())
{
automationPeer.RaiseNotificationEvent(
Automation::Peers::AutomationNotificationKind::ItemAdded,
@@ -579,7 +579,7 @@ namespace winrt::TerminalApp::implementation
if (_nestedActionStack.Size() > 0)
{
const auto newPreviousAction{ _nestedActionStack.GetAt(_nestedActionStack.Size() - 1) };
const auto actionPaletteItem{ newPreviousAction.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() };
const auto actionPaletteItem{ newPreviousAction.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() };
ParentCommandName(actionPaletteItem.Command().Name());
_updateCurrentNestedCommands(actionPaletteItem.Command());
@@ -640,7 +640,7 @@ namespace winrt::TerminalApp::implementation
// - <none>
// Return Value:
// - A list of Commands to filter.
Collections::IVector<winrt::TerminalApp::FilteredCommand> CommandPalette::_commandsToFilter()
Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::_commandsToFilter()
{
switch (_currentMode)
{
@@ -671,7 +671,7 @@ namespace winrt::TerminalApp::implementation
// - command: the Command to dispatch. This might be null.
// Return Value:
// - <none>
void CommandPalette::_dispatchCommand(const winrt::TerminalApp::FilteredCommand& filteredCommand)
void CommandPalette::_dispatchCommand(const winrt::Microsoft::Terminal::App::FilteredCommand& filteredCommand)
{
if (_currentMode == CommandPaletteMode::CommandlineMode)
{
@@ -684,7 +684,7 @@ namespace winrt::TerminalApp::implementation
}
else if (filteredCommand)
{
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
{
if (actionPaletteItem.Command().HasNestedCommands())
{
@@ -760,11 +760,11 @@ namespace winrt::TerminalApp::implementation
// - filteredCommand - Selected filtered command - might be null
// Return Value:
// - <none>
void CommandPalette::_switchToTab(const winrt::TerminalApp::FilteredCommand& filteredCommand)
void CommandPalette::_switchToTab(const winrt::Microsoft::Terminal::App::FilteredCommand& filteredCommand)
{
if (filteredCommand)
{
if (const auto tabPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::TabPaletteItem>() })
if (const auto tabPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::TabPaletteItem>() })
{
if (const auto tab{ tabPaletteItem.Tab() })
{
@@ -780,7 +780,7 @@ namespace winrt::TerminalApp::implementation
// - filteredCommand - Selected filtered command - might be null
// Return Value:
// - <none>
void CommandPalette::_dispatchCommandline(const winrt::TerminalApp::FilteredCommand& command)
void CommandPalette::_dispatchCommandline(const winrt::Microsoft::Terminal::App::FilteredCommand& command)
{
const auto filteredCommand = command ? command : _buildCommandLineCommand(winrt::hstring(_getTrimmedInput()));
if (filteredCommand.has_value())
@@ -794,7 +794,7 @@ namespace winrt::TerminalApp::implementation
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
if (const auto commandLinePaletteItem{ filteredCommand.value().Item().try_as<winrt::TerminalApp::CommandLinePaletteItem>() })
if (const auto commandLinePaletteItem{ filteredCommand.value().Item().try_as<winrt::Microsoft::Terminal::App::CommandLinePaletteItem>() })
{
_CommandLineExecutionRequestedHandlers(*this, commandLinePaletteItem.CommandLine());
_close();
@@ -802,7 +802,7 @@ namespace winrt::TerminalApp::implementation
}
}
std::optional<TerminalApp::FilteredCommand> CommandPalette::_buildCommandLineCommand(const hstring& commandLine)
std::optional<Microsoft::Terminal::App::FilteredCommand> CommandPalette::_buildCommandLineCommand(const hstring& commandLine)
{
if (commandLine.empty())
{
@@ -932,7 +932,7 @@ namespace winrt::TerminalApp::implementation
}
}
Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> CommandPalette::FilteredActions()
Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::FilteredActions()
{
return _filteredActions;
}
@@ -947,7 +947,7 @@ namespace winrt::TerminalApp::implementation
_allCommands.Clear();
for (const auto& action : actions)
{
auto actionPaletteItem{ winrt::make<winrt::TerminalApp::implementation::ActionPaletteItem>(action) };
auto actionPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::ActionPaletteItem>(action) };
auto filteredCommand{ winrt::make<FilteredCommand>(actionPaletteItem) };
_allCommands.Append(filteredCommand);
}
@@ -970,13 +970,13 @@ namespace winrt::TerminalApp::implementation
// Return Value:
// - <none>
void CommandPalette::_bindTabs(
const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& source,
const Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand>& target)
const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& source,
const Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand>& target)
{
target.Clear();
for (const auto& tab : source)
{
auto tabPaletteItem{ winrt::make<winrt::TerminalApp::implementation::TabPaletteItem>(tab) };
auto tabPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::TabPaletteItem>(tab) };
auto filteredCommand{ winrt::make<FilteredCommand>(tabPaletteItem) };
target.Append(filteredCommand);
}
@@ -1071,9 +1071,9 @@ namespace winrt::TerminalApp::implementation
// - A collection that will receive the filtered actions
// Return Value:
// - <none>
std::vector<winrt::TerminalApp::FilteredCommand> CommandPalette::_collectFilteredActions()
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::_collectFilteredActions()
{
std::vector<winrt::TerminalApp::FilteredCommand> actions;
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> actions;
winrt::hstring searchText{ _getTrimmedInput() };
@@ -1168,7 +1168,7 @@ namespace winrt::TerminalApp::implementation
for (const auto& nameAndCommand : parentCommand.NestedCommands())
{
const auto action = nameAndCommand.Value();
auto nestedActionPaletteItem{ winrt::make<winrt::TerminalApp::implementation::ActionPaletteItem>(action) };
auto nestedActionPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::ActionPaletteItem>(action) };
auto nestedFilteredCommand{ winrt::make<FilteredCommand>(nestedActionPaletteItem) };
_currentNestedCommands.Append(nestedFilteredCommand);
}
@@ -1297,17 +1297,17 @@ namespace winrt::TerminalApp::implementation
// - Reads the list of recent commands from the persistent application state
// Return Value:
// - The list of FilteredCommand representing the ones stored in the state
IVector<TerminalApp::FilteredCommand> CommandPalette::_loadRecentCommands()
IVector<Microsoft::Terminal::App::FilteredCommand> CommandPalette::_loadRecentCommands()
{
const auto recentCommands = ApplicationState::SharedInstance().RecentCommands();
// If this is the first time we've opened the commandline mode and
// there aren't any recent commands, then just return an empty vector.
if (!recentCommands)
{
return single_threaded_vector<TerminalApp::FilteredCommand>();
return single_threaded_vector<Microsoft::Terminal::App::FilteredCommand>();
}
std::vector<TerminalApp::FilteredCommand> parsedCommands;
std::vector<Microsoft::Terminal::App::FilteredCommand> parsedCommands;
parsedCommands.reserve(std::min(recentCommands.Size(), CommandLineHistoryLength));
for (const auto& c : recentCommands)

View File

@@ -13,7 +13,7 @@ namespace TerminalAppLocalTests
class TabTests;
};
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
enum class CommandPaletteMode
{
@@ -27,10 +27,10 @@ namespace winrt::TerminalApp::implementation
{
CommandPalette();
Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> FilteredActions();
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> FilteredActions();
void SetCommands(const Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command>& actions);
void SetTabs(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& tabs, const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& mruTabs);
void SetTabs(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& tabs, const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& mruTabs);
void SetActionMap(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap);
bool OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down);
@@ -54,20 +54,20 @@ namespace winrt::TerminalApp::implementation
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParentCommandName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParsedCommandLineText, _PropertyChangedHandlers);
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(SwitchToTabRequested, winrt::Microsoft::Terminal::App::CommandPalette, winrt::Microsoft::Terminal::App::TabBase);
TYPED_EVENT(CommandLineExecutionRequested, winrt::Microsoft::Terminal::App::CommandPalette, winrt::hstring);
TYPED_EVENT(DispatchCommandRequested, winrt::Microsoft::Terminal::App::CommandPalette, Microsoft::Terminal::Settings::Model::Command);
TYPED_EVENT(PreviewAction, Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command);
private:
friend struct CommandPaletteT<CommandPalette>; // for Xaml to bind events
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _allCommands{ nullptr };
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _currentNestedCommands{ nullptr };
Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> _filteredActions{ nullptr };
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _nestedActionStack{ nullptr };
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _allCommands{ nullptr };
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _currentNestedCommands{ nullptr };
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> _filteredActions{ nullptr };
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _nestedActionStack{ nullptr };
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _commandsToFilter();
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _commandsToFilter();
bool _lastFilterTextWasEmpty{ true };
@@ -100,7 +100,7 @@ namespace winrt::TerminalApp::implementation
void _updateCurrentNestedCommands(const winrt::Microsoft::Terminal::Settings::Model::Command& parentCommand);
std::vector<winrt::TerminalApp::FilteredCommand> _collectFilteredActions();
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> _collectFilteredActions();
void _close();
@@ -113,20 +113,20 @@ namespace winrt::TerminalApp::implementation
Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
// Tab Switcher
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _tabActions{ nullptr };
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _mruTabActions{ nullptr };
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _tabActions{ nullptr };
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _mruTabActions{ nullptr };
Microsoft::Terminal::Settings::Model::TabSwitcherMode _tabSwitcherMode;
uint32_t _switcherStartIdx;
void _bindTabs(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& source, const Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand>& target);
void _bindTabs(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& source, const Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand>& target);
void _anchorKeyUpHandler();
winrt::Windows::UI::Xaml::Controls::ListView::SizeChanged_revoker _sizeChangedRevoker;
void _dispatchCommand(const winrt::TerminalApp::FilteredCommand& command);
void _dispatchCommandline(const winrt::TerminalApp::FilteredCommand& command);
void _switchToTab(const winrt::TerminalApp::FilteredCommand& command);
static std::optional<winrt::TerminalApp::FilteredCommand> _buildCommandLineCommand(const winrt::hstring& commandLine);
void _dispatchCommand(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
void _dispatchCommandline(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
void _switchToTab(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
static std::optional<winrt::Microsoft::Terminal::App::FilteredCommand> _buildCommandLineCommand(const winrt::hstring& commandLine);
void _dismissPalette();
@@ -134,13 +134,13 @@ namespace winrt::TerminalApp::implementation
uint32_t _getNumVisibleItems();
static constexpr uint32_t CommandLineHistoryLength = 20;
static Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _loadRecentCommands();
static Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _loadRecentCommands();
static void _updateRecentCommands(const winrt::hstring& command);
::TerminalApp::AppCommandlineArgs _appArgs;
::Microsoft::Terminal::App::AppCommandlineArgs _appArgs;
void _choosingItemContainer(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ChoosingItemContainerEventArgs& args);
void _containerContentChanging(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args);
winrt::TerminalApp::PaletteItemTemplateSelector _itemTemplateSelector{ nullptr };
winrt::Microsoft::Terminal::App::PaletteItemTemplateSelector _itemTemplateSelector{ nullptr };
std::unordered_map<Windows::UI::Xaml::DataTemplate, std::unordered_set<Windows::UI::Xaml::Controls::Primitives::SelectorItem>> _listViewItemsCache;
Windows::UI::Xaml::DataTemplate _listItemTemplate;
@@ -148,7 +148,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(CommandPalette);
}

View File

@@ -6,7 +6,7 @@ import "IDirectKeyListener.idl";
import "HighlightedTextControl.idl";
import "FilteredCommand.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass CommandPalette : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged, IDirectKeyListener
{

View File

@@ -2,12 +2,12 @@
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<UserControl x:Class="TerminalApp.CommandPalette"
<UserControl x:Class="Microsoft.Terminal.App.CommandPalette"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:local="using:Microsoft.Terminal.App"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:Microsoft.Terminal.Settings.Model"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"

View File

@@ -4,7 +4,7 @@
#include "pch.h"
#include "Commandline.h"
using namespace TerminalApp;
using namespace Microsoft::Terminal::App;
size_t Commandline::Argc() const
{

View File

@@ -23,12 +23,12 @@ namespace TerminalAppLocalTests
{
class CommandlineTest;
};
namespace TerminalApp
namespace Microsoft::Terminal::App
{
class Commandline;
};
class TerminalApp::Commandline
class Microsoft::Terminal::App::Commandline
{
public:
static constexpr std::wstring_view Delimiter{ L";" };

View File

@@ -4,9 +4,9 @@
#include "pch.h"
#include "DebugTapConnection.h"
using namespace ::winrt::Microsoft::Terminal::TerminalConnection;
using namespace ::winrt::Microsoft::Terminal::Connection;
using namespace ::winrt::Windows::Foundation;
namespace winrt::Microsoft::TerminalApp::implementation
namespace winrt::Microsoft::Microsoft::Terminal::App::implementation
{
// DebugInputTapConnection is an implementation detail of DebugTapConnection.
// It wraps the _actual_ connection so it can hook WriteInput and forward it
@@ -129,7 +129,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
}
// Wire us up so that we can forward input through
void DebugTapConnection::SetInputTap(const Microsoft::Terminal::TerminalConnection::ITerminalConnection& inputTap)
void DebugTapConnection::SetInputTap(const Microsoft::Terminal::Connection::ITerminalConnection& inputTap)
{
_inputSide = inputTap;
}
@@ -141,7 +141,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
// 2. One that will print raw VT sequences sent into and received _from_ the original connection.
std::tuple<ITerminalConnection, ITerminalConnection> OpenDebugTapConnection(ITerminalConnection baseConnection)
{
using namespace winrt::Microsoft::TerminalApp::implementation;
using namespace winrt::Microsoft::Microsoft::Terminal::App::implementation;
auto debugSide{ winrt::make_self<DebugTapConnection>(baseConnection) };
auto inputSide{ winrt::make_self<DebugInputTapConnection>(debugSide, baseConnection) };
debugSide->SetInputTap(*inputSide);

View File

@@ -3,38 +3,38 @@
#pragma once
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
#include <winrt/Microsoft.Terminal.Connection.h>
#include <til/latch.h>
namespace winrt::Microsoft::TerminalApp::implementation
namespace winrt::Microsoft::Microsoft::Terminal::App::implementation
{
class DebugInputTapConnection;
class DebugTapConnection : public winrt::implements<DebugTapConnection, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection>
class DebugTapConnection : public winrt::implements<DebugTapConnection, winrt::Microsoft::Terminal::Connection::ITerminalConnection>
{
public:
explicit DebugTapConnection(Microsoft::Terminal::TerminalConnection::ITerminalConnection wrappedConnection);
explicit DebugTapConnection(winrt::Microsoft::Terminal::Connection::ITerminalConnection wrappedConnection);
void Initialize(const Windows::Foundation::Collections::ValueSet& /*settings*/){};
~DebugTapConnection();
void Start();
void WriteInput(const hstring& data);
void Resize(uint32_t rows, uint32_t columns);
void Close();
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState State() const noexcept;
winrt::Microsoft::Terminal::Connection::ConnectionState State() const noexcept;
void SetInputTap(const Microsoft::Terminal::TerminalConnection::ITerminalConnection& inputTap);
void SetInputTap(const winrt::Microsoft::Terminal::Connection::ITerminalConnection& inputTap);
WINRT_CALLBACK(TerminalOutput, winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler);
WINRT_CALLBACK(TerminalOutput, winrt::Microsoft::Terminal::Connection::TerminalOutputHandler);
TYPED_EVENT(StateChanged, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(StateChanged, winrt::Microsoft::Terminal::Connection::ITerminalConnection, winrt::Windows::Foundation::IInspectable);
private:
void _PrintInput(const hstring& data);
void _OutputHandler(const hstring str);
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::TerminalOutput_revoker _outputRevoker;
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::StateChanged_revoker _stateChangedRevoker;
winrt::weak_ref<Microsoft::Terminal::TerminalConnection::ITerminalConnection> _wrappedConnection;
winrt::weak_ref<Microsoft::Terminal::TerminalConnection::ITerminalConnection> _inputSide;
winrt::Microsoft::Terminal::Connection::ITerminalConnection::TerminalOutput_revoker _outputRevoker;
winrt::Microsoft::Terminal::Connection::ITerminalConnection::StateChanged_revoker _stateChangedRevoker;
winrt::weak_ref<winrt::Microsoft::Terminal::Connection::ITerminalConnection> _wrappedConnection;
winrt::weak_ref<winrt::Microsoft::Terminal::Connection::ITerminalConnection> _inputSide;
til::latch _start{ 1 };
@@ -42,4 +42,4 @@ namespace winrt::Microsoft::TerminalApp::implementation
};
}
std::tuple<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection> OpenDebugTapConnection(winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection baseConnection);
std::tuple<winrt::Microsoft::Terminal::Connection::ITerminalConnection, winrt::Microsoft::Terminal::Connection::ITerminalConnection> OpenDebugTapConnection(winrt::Microsoft::Terminal::Connection::ITerminalConnection baseConnection);

View File

@@ -5,7 +5,7 @@
using namespace winrt::Windows;
using namespace winrt::Windows::UI::Xaml;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Method Description:
// - Attempt to convert something into another type. For the

View File

@@ -2,7 +2,7 @@
#include "EmptyStringVisibilityConverter.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct EmptyStringVisibilityConverter : EmptyStringVisibilityConverterT<EmptyStringVisibilityConverter>
{
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(EmptyStringVisibilityConverter);
}

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.App
{
// See https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-quickstart

View File

@@ -9,7 +9,7 @@
#include "FilteredCommand.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::System;
@@ -17,11 +17,11 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::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::Microsoft::Terminal::App::PaletteItem& item) :
_Item(item),
_Filter(L""),
_Weight(0)
@@ -70,9 +70,9 @@ namespace winrt::TerminalApp::implementation
//
// Return Value:
// - The HighlightedText object initialized with the segments computed according to the algorithm above.
winrt::TerminalApp::HighlightedText FilteredCommand::_computeHighlightedName()
winrt::Microsoft::Terminal::App::HighlightedText FilteredCommand::_computeHighlightedName()
{
const auto segments = winrt::single_threaded_observable_vector<winrt::TerminalApp::HighlightedTextSegment>();
const auto segments = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>();
auto commandName = _Item.Name();
auto isProcessingMatchedSegment = false;
uint32_t nextOffsetToReport = 0;
@@ -225,7 +225,7 @@ namespace winrt::TerminalApp::implementation
// - other: another instance of FilteredCommand interface
// Return Value:
// - Returns true if the first is "bigger" (aka should appear first)
int FilteredCommand::Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second)
int FilteredCommand::Compare(const winrt::Microsoft::Terminal::App::FilteredCommand& first, const winrt::Microsoft::Terminal::App::FilteredCommand& second)
{
auto firstWeight{ first.Weight() };
auto secondWeight{ second.Weight() };

View File

@@ -12,25 +12,25 @@ namespace TerminalAppLocalTests
class FilteredCommandTests;
};
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct FilteredCommand : FilteredCommandT<FilteredCommand>
{
FilteredCommand() = default;
FilteredCommand(const winrt::TerminalApp::PaletteItem& item);
FilteredCommand(const winrt::Microsoft::Terminal::App::PaletteItem& item);
void UpdateFilter(const winrt::hstring& filter);
static int Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second);
static int Compare(const winrt::Microsoft::Terminal::App::FilteredCommand& first, const winrt::Microsoft::Terminal::App::FilteredCommand& second);
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Filter, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::HighlightedText, HighlightedName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(int, Weight, _PropertyChangedHandlers);
private:
winrt::TerminalApp::HighlightedText _computeHighlightedName();
winrt::Microsoft::Terminal::App::HighlightedText _computeHighlightedName();
int _computeWeight();
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _itemChangedRevoker;
@@ -38,7 +38,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(FilteredCommand);
}

View File

@@ -4,7 +4,7 @@
import "PaletteItem.idl";
import "HighlightedTextControl.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass FilteredCommand : Windows.UI.Xaml.Data.INotifyPropertyChanged
{

View File

@@ -7,7 +7,7 @@
#include "HighlightedText.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::System;
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
HighlightedTextSegment::HighlightedTextSegment(const winrt::hstring& textSegment, bool isHighlighted) :
_TextSegment(textSegment),
@@ -24,7 +24,7 @@ namespace winrt::TerminalApp::implementation
{
}
HighlightedText::HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>& segments) :
HighlightedText::HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>& segments) :
_Segments(segments)
{
}

View File

@@ -6,7 +6,7 @@
#include "HighlightedTextSegment.g.h"
#include "HighlightedText.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct HighlightedTextSegment : HighlightedTextSegmentT<HighlightedTextSegment>
{
@@ -21,14 +21,14 @@ namespace winrt::TerminalApp::implementation
struct HighlightedText : HighlightedTextT<HighlightedText>
{
HighlightedText() = default;
HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>& segments);
HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>& segments);
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
WINRT_OBSERVABLE_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(HighlightedTextSegment);
BASIC_FACTORY(HighlightedText);

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass HighlightedTextSegment : Windows.UI.Xaml.Data.INotifyPropertyChanged
{

View File

@@ -8,7 +8,7 @@
#include "HighlightedTextControl.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::System;
@@ -17,15 +17,15 @@ using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Our control exposes a "Text" property to be used with Data Binding
// To allow this we need to register a Dependency Property Identifier to be used by the property system
// (https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/custom-dependency-properties)
DependencyProperty HighlightedTextControl::_textProperty = DependencyProperty::Register(
L"Text",
xaml_typename<winrt::TerminalApp::HighlightedText>(),
xaml_typename<winrt::TerminalApp::HighlightedTextControl>(),
xaml_typename<winrt::Microsoft::Terminal::App::HighlightedText>(),
xaml_typename<winrt::Microsoft::Terminal::App::HighlightedTextControl>(),
PropertyMetadata(nullptr, HighlightedTextControl::_onTextChanged));
HighlightedTextControl::HighlightedTextControl()
@@ -49,12 +49,12 @@ namespace winrt::TerminalApp::implementation
return _textView();
}
winrt::TerminalApp::HighlightedText HighlightedTextControl::Text()
winrt::Microsoft::Terminal::App::HighlightedText HighlightedTextControl::Text()
{
return winrt::unbox_value<winrt::TerminalApp::HighlightedText>(GetValue(_textProperty));
return winrt::unbox_value<winrt::Microsoft::Terminal::App::HighlightedText>(GetValue(_textProperty));
}
void HighlightedTextControl::Text(const winrt::TerminalApp::HighlightedText& value)
void HighlightedTextControl::Text(const winrt::Microsoft::Terminal::App::HighlightedText& value)
{
SetValue(_textProperty, winrt::box_value(value));
}
@@ -67,8 +67,8 @@ namespace winrt::TerminalApp::implementation
// The new value is expected to be an instance of HighlightedText
void HighlightedTextControl::_onTextChanged(const DependencyObject& o, const DependencyPropertyChangedEventArgs& e)
{
const auto control = o.try_as<winrt::TerminalApp::HighlightedTextControl>();
const auto highlightedText = e.NewValue().try_as<winrt::TerminalApp::HighlightedText>();
const auto control = o.try_as<winrt::Microsoft::Terminal::App::HighlightedTextControl>();
const auto highlightedText = e.NewValue().try_as<winrt::Microsoft::Terminal::App::HighlightedText>();
if (control && highlightedText)
{

View File

@@ -7,7 +7,7 @@
#include "HighlightedTextControl.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct HighlightedTextControl : HighlightedTextControlT<HighlightedTextControl>
{
@@ -15,8 +15,8 @@ namespace winrt::TerminalApp::implementation
static Windows::UI::Xaml::DependencyProperty TextProperty();
winrt::TerminalApp::HighlightedText Text();
void Text(const winrt::TerminalApp::HighlightedText& value);
winrt::Microsoft::Terminal::App::HighlightedText Text();
void Text(const winrt::Microsoft::Terminal::App::HighlightedText& value);
Windows::UI::Xaml::Controls::TextBlock TextView();
@@ -26,7 +26,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(HighlightedTextControl);
}

View File

@@ -3,7 +3,7 @@
import "HighlightedText.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass HighlightedTextControl : Windows.UI.Xaml.Controls.Control
{

View File

@@ -1,8 +1,8 @@
<UserControl x:Class="TerminalApp.HighlightedTextControl"
<UserControl x:Class="Microsoft.Terminal.App.HighlightedTextControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:local="using:Microsoft.Terminal.App"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="Transparent"
mc:Ignorable="d">

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.App
{
// C++/winrt makes it difficult to share this idl between two projects,
// Instead, we just pin the uuid and include it in both TermControl and App

View File

@@ -4,7 +4,7 @@
#include "pch.h"
#include "LanguageProfileNotifier.h"
using namespace winrt::TerminalApp::implementation;
using namespace winrt::Microsoft::Terminal::App::implementation;
LanguageProfileNotifier::LanguageProfileNotifier(std::function<void()>&& callback) :
_callback{ std::move(callback) },

View File

@@ -3,7 +3,7 @@
#pragma once
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
class LanguageProfileNotifier : public winrt::implements<LanguageProfileNotifier, ITfInputProcessorProfileActivationSink>
{

View File

@@ -9,7 +9,7 @@
using namespace winrt::Windows::UI::Xaml;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
static void closeToolTipForButton(const Controls::Button& button)
{

View File

@@ -9,7 +9,7 @@
#include "MinMaxCloseControl.g.h"
#include <ThrottledFunc.h>
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct MinMaxCloseControl : MinMaxCloseControlT<MinMaxCloseControl>
{
@@ -28,16 +28,16 @@ namespace winrt::TerminalApp::implementation
void _CloseClick(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
TYPED_EVENT(MinimizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
TYPED_EVENT(MaximizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
TYPED_EVENT(CloseClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
TYPED_EVENT(MinimizeClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
TYPED_EVENT(MaximizeClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
TYPED_EVENT(CloseClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
std::shared_ptr<ThrottledFuncTrailing<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(MinMaxCloseControl);
}

View File

@@ -3,7 +3,7 @@
import "TitlebarControl.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass MinMaxCloseControl : Windows.UI.Xaml.Controls.StackPanel
{

View File

@@ -2,7 +2,7 @@
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<StackPanel x:Class="TerminalApp.MinMaxCloseControl"
<StackPanel x:Class="Microsoft.Terminal.App.MinMaxCloseControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

View File

@@ -13,7 +13,7 @@ using namespace winrt::Microsoft::Terminal::Control;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::Windows::System;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
Controls::IconElement PaletteItem::ResolvedIcon()
{

View File

@@ -4,7 +4,7 @@
#pragma once
#include "PaletteItem.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct PaletteItem : PaletteItemT<PaletteItem>
{

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.App
{
unsealed runtimeclass PaletteItem : Windows.UI.Xaml.Data.INotifyPropertyChanged
{

View File

@@ -6,7 +6,7 @@
#include "PaletteItemTemplateSelector.h"
#include "PaletteItemTemplateSelector.g.cpp"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
Windows::UI::Xaml::DataTemplate PaletteItemTemplateSelector::SelectTemplateCore(const winrt::Windows::Foundation::IInspectable& item, const winrt::Windows::UI::Xaml::DependencyObject& /*container*/)
{
@@ -24,13 +24,13 @@ namespace winrt::TerminalApp::implementation
// - data template to use for rendering
Windows::UI::Xaml::DataTemplate PaletteItemTemplateSelector::SelectTemplateCore(const winrt::Windows::Foundation::IInspectable& item)
{
if (const auto filteredCommand{ item.try_as<winrt::TerminalApp::FilteredCommand>() })
if (const auto filteredCommand{ item.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() })
{
if (filteredCommand.Item().try_as<winrt::TerminalApp::TabPaletteItem>())
if (filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::TabPaletteItem>())
{
return TabItemTemplate();
}
else if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
else if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
{
if (actionPaletteItem.Command().HasNestedCommands())
{

View File

@@ -5,7 +5,7 @@
#include "PaletteItemTemplateSelector.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct PaletteItemTemplateSelector : PaletteItemTemplateSelectorT<PaletteItemTemplateSelector>
{
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(PaletteItemTemplateSelector);
}

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass PaletteItemTemplateSelector : Windows.UI.Xaml.Controls.DataTemplateSelector
{

View File

@@ -17,9 +17,9 @@ using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::UI::Xaml::Media;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::Microsoft::Terminal::Control;
using namespace winrt::Microsoft::Terminal::TerminalConnection;
using namespace winrt::TerminalApp;
using namespace TerminalApp;
using namespace winrt::Microsoft::Terminal::Connection;
using namespace winrt::Microsoft::Terminal::App;
using namespace Microsoft::Terminal::App;
static const int PaneBorderSize = 2;
static const int CombinedPaneBorderSize = 2 * PaneBorderSize;
@@ -3169,11 +3169,11 @@ bool Pane::ContainsReadOnly() const
// - states: a vector that will receive all the states of all leaves in the tree
// Return Value:
// - <none>
void Pane::CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& states)
void Pane::CollectTaskbarStates(std::vector<winrt::Microsoft::Terminal::App::TaskbarState>& states)
{
if (_IsLeaf())
{
auto tbState{ winrt::make<winrt::TerminalApp::implementation::TaskbarState>(_control.TaskbarState(),
auto tbState{ winrt::make<winrt::Microsoft::Terminal::App::implementation::TaskbarState>(_control.TaskbarState(),
_control.TaskbarProgress()) };
states.push_back(tbState);
}

View File

@@ -28,7 +28,7 @@ namespace TerminalAppLocalTests
class TabTests;
};
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct TerminalTab;
}
@@ -195,7 +195,7 @@ public:
});
}
void CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& states);
void CollectTaskbarStates(std::vector<winrt::Microsoft::Terminal::App::TaskbarState>& states);
WINRT_CALLBACK(ClosedByParent, winrt::delegate<>);
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
@@ -226,7 +226,7 @@ private:
SplitState _splitState{ SplitState::None };
float _desiredSplitPosition;
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
winrt::Microsoft::Terminal::Connection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::Connection::ConnectionState::NotConnected };
winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
bool _isDefTermSession{ false };
#pragma endregion
@@ -393,6 +393,6 @@ private:
void _AssignChildNode(std::unique_ptr<LayoutSizeNode>& nodeField, const LayoutSizeNode* const newNode);
};
friend struct winrt::TerminalApp::implementation::TerminalTab;
friend struct winrt::Microsoft::Terminal::App::implementation::TerminalTab;
friend class ::TerminalAppLocalTests::TabTests;
};

View File

@@ -21,7 +21,7 @@ namespace winrt
namespace WUX = Windows::UI::Xaml;
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
SettingsTab::SettingsTab(MainPage settingsUI,
winrt::Windows::UI::Xaml::ElementTheme requestedTheme)

View File

@@ -19,7 +19,7 @@ Author(s):
#include "TabBase.h"
#include "SettingsTab.g.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct SettingsTab : SettingsTabT<SettingsTab, TabBase>
{
@@ -27,10 +27,10 @@ namespace winrt::TerminalApp::implementation
SettingsTab(winrt::Microsoft::Terminal::Settings::Editor::MainPage settingsUI,
winrt::Windows::UI::Xaml::ElementTheme requestedTheme);
void UpdateSettings(Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
void UpdateSettings(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
void Focus(winrt::Windows::UI::Xaml::FocusState focusState) override;
std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs> BuildStartupActions() const override;
std::vector<winrt::Microsoft::Terminal::Settings::Model::ActionAndArgs> BuildStartupActions() const override;
private:
winrt::Windows::UI::Xaml::ElementTheme _requestedTheme;

View File

@@ -3,7 +3,7 @@
import "TabBase.idl";
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass SettingsTab : TabBase
{

View File

@@ -8,7 +8,7 @@
using namespace winrt::Microsoft::Terminal;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::App;
#define ACTION_CASE(action) \
case ShortcutAction::action: \
@@ -17,7 +17,7 @@ using namespace winrt::TerminalApp;
break; \
}
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
// Method Description:
// - Dispatch the appropriate event for the given ActionAndArgs. Constructs

View File

@@ -13,9 +13,9 @@ namespace TerminalAppLocalTests
class KeyBindingsTests;
}
#define DECLARE_ACTION(action) TYPED_EVENT(action, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs);
#define DECLARE_ACTION(action) TYPED_EVENT(action, Microsoft::Terminal::App::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs);
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::App::implementation
{
struct ShortcutActionDispatch : ShortcutActionDispatchT<ShortcutActionDispatch>
{
@@ -33,7 +33,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::App::factory_implementation
{
BASIC_FACTORY(ShortcutActionDispatch);
}

View File

@@ -4,7 +4,7 @@
#define ACTION_EVENT(name) event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> name
namespace TerminalApp
namespace Microsoft.Terminal.App
{
[default_interface] runtimeclass ShortcutActionDispatch {
ShortcutActionDispatch();

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