Skip to content

Commit 8f2a129

Browse files
committed
Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane
2 parents 5b4747f + c8d0c0a commit 8f2a129

File tree

369 files changed

+87285
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+87285
-436
lines changed

.github/actions/spelling/allow/allow.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ changelog
1414
clickable
1515
clig
1616
CMMI
17+
consvc
1718
copyable
1819
Counterintuitively
1920
CtrlDToClose

.github/actions/spelling/excludes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,4 @@
126126
^tools/ReleaseEngineering/ServicingPipeline\.ps1$
127127
^XamlStyler\.json$
128128
ignore$
129+
Resources/(?!en)

.github/actions/spelling/expect/expect.txt

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ aumid
7474
Authenticode
7575
AUTOBUDDY
7676
AUTOCHECKBOX
77+
autocrlf
7778
autohide
7879
AUTOHSCROLL
7980
automagically

build/pipelines/daily-loc-submission.yml

+52-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ schedules:
88
- main
99
always: false # only run if there's code changes!
1010

11+
12+
parameters:
13+
- name: targetBranch
14+
type: string
15+
default: "automated/loc-update"
16+
1117
pool:
1218
vmImage: windows-2019
1319

@@ -38,6 +44,13 @@ steps:
3844
persistCredentials: true
3945
path: s/Terminal.Internal
4046

47+
- pwsh: |-
48+
Install-Module PSGitHub -Scope CurrentUser -Force
49+
git config --local user.email "[email protected]"
50+
git config --local user.name "Console Service Bot"
51+
git config --local core.autocrlf true
52+
displayName: Prepare git submission environment
53+
4154
- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@1
4255
displayName: 'Touchdown Build - 7105, PRODEXT'
4356
inputs:
@@ -51,13 +64,44 @@ steps:
5164
outputDirectoryRoot: LocOutput
5265
appendRelativeDir: true
5366
pseudoSetting: Included
67+
localizationTarget: true
5468

55-
# Saving one of these makes it really easy to inspect the loc output...
56-
- powershell: 'tar czf LocOutput.tar.gz LocOutput'
57-
displayName: 'Archive Loc Output for Submission'
69+
- pwsh: |-
70+
Remove-Item -EA:Ignore -R -Force LocOutput\Terminal.Internal
71+
$Files = Get-ChildItem LocOutput -R -Include 'ContextMenu.resw','Resources.resw' | ? FullName -Like '*en-US\*\*.resw'
72+
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
73+
& tar.exe -c -f LocOutputMunged.tar -C LocOutput .
74+
& tar.exe -x -v -f LocOutputMunged.tar
75+
rm LocOutputMunged.tar
76+
rm -r -fo LocOutput
77+
& ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
78+
displayName: Move Loc files to the right places
5879

59-
- task: PublishBuildArtifacts@1
60-
displayName: 'Publish Artifact: LocOutput'
61-
inputs:
62-
PathtoPublish: LocOutput.tar.gz
63-
ArtifactName: LocOutput
80+
- pwsh: |-
81+
git add **/*.resw
82+
git status
83+
git diff --quiet --cached --exit-code
84+
If ($LASTEXITCODE -Ne 0) {
85+
$Now = Get-Date
86+
git commit -m "Localization Updates - $Now"
87+
git push origin HEAD:refs/heads/${{parameters.targetBranch}} -f
88+
Write-Host "##vso[task.setvariable variable=ChangesPushedToRepo]1"
89+
} Else {
90+
Write-Host "##vso[task.setvariable variable=ChangesPushedToRepo]0"
91+
}
92+
displayName: git commit and push
93+
94+
- pwsh: |-
95+
Import-Module PSGitHub
96+
$BaseBranch = "$(Build.SourceBranch)" -Replace "^refs/heads/",""
97+
Write-Host "Preparing PR against $BaseBranch"
98+
$PSDefaultParameterValues['*GitHub*:Owner'] = "microsoft"
99+
$PSDefaultParameterValues['*GitHub*:RepositoryName'] = "terminal"
100+
$PSDefaultParameterValues['*GitHub*:Token'] = ("$(GithubPullRequestToken)" | ConvertTo-SecureString -AsPlainText -Force)
101+
$existingPr = Get-GitHubPullRequest -HeadBranch "${{parameters.targetBranch}}" -BaseBranch $BaseBranch
102+
If ($null -Eq $existingPr) {
103+
$Now = Get-Date
104+
New-GitHubPullRequest -Head "${{parameters.targetBranch}}" -Base $BaseBranch -Title "Localization Updates - $BaseBranch - $Now" -Verbose
105+
}
106+
displayName: Publish pull request
107+
condition: and(eq(variables['ChangesPushedToRepo'], '1'), succeeded())

build/pipelines/templates-v2/pipeline-full-release-build.yml

-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ stages:
104104
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
105105
versionListDownload: ${{ parameters.terminalInternalPackageVersion }}
106106

107-
- template: ./steps-fetch-and-prepare-localizations.yml
108-
parameters:
109-
includePseudoLoc: true
110-
111107
- ${{ if eq(parameters.buildWPF, true) }}:
112108
# Add an Any CPU build flavor for the WPF control bits
113109
- template: ./job-build-project.yml

build/pipelines/templates-v2/pipeline-onebranch-full-release-build.yml

-4
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ extends:
131131
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
132132
versionListDownload: ${{ parameters.terminalInternalPackageVersion }}
133133

134-
- template: ./build/pipelines/templates-v2/steps-fetch-and-prepare-localizations.yml@self
135-
parameters:
136-
includePseudoLoc: true
137-
138134
- ${{ if eq(parameters.buildWPF, true) }}:
139135
# Add an Any CPU build flavor for the WPF control bits
140136
- template: ./build/pipelines/templates-v2/job-build-project.yml@self

build/pipelines/templates-v2/steps-fetch-and-prepare-localizations.yml

-27
This file was deleted.

build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1

+16-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ $LocalizationsFromContextMenu | ForEach-Object {
1010
ForEach ($pair in $Languages.GetEnumerator()) {
1111
$LanguageDir = "./src/cascadia/CascadiaPackage/Resources/$($pair.Key)"
1212
$ResPath = "$LanguageDir/Resources.resw"
13+
$XmlDocument = $null
1314
$PreexistingResw = Get-Item $ResPath -EA:Ignore
1415
If ($null -eq $PreexistingResw) {
1516
Write-Host "Copying $($pair.Value.FullName) to $ResPath"
17+
$XmlDocument = [xml](Get-Content $pair.Value.FullName)
1618
New-Item -type Directory $LanguageDir -EA:Ignore
17-
Copy-Item $pair.Value.FullName $ResPath
1819
} Else {
1920
# Merge Them!
2021
Write-Host "Merging $($pair.Value.FullName) into $ResPath"
@@ -29,6 +30,19 @@ ForEach ($pair in $Languages.GetEnumerator()) {
2930
$newXml.root.data | % {
3031
$null = $existingXml.root.AppendChild($existingXml.ImportNode($_, $true))
3132
}
32-
$existingXml.Save($PreexistingResw.FullName)
33+
$XmlDocument = $existingXml # (which has been updated)
3334
}
35+
36+
# Reset paths to be absolute (for .NET)
37+
$LanguageDir = (Get-Item $LanguageDir).FullName
38+
$ResPath = "$LanguageDir/Resources.resw"
39+
# Force the "new" and "preexisting" paths to serialize with XmlWriter,
40+
# to ensure consistency.
41+
$writerSettings = [System.Xml.XmlWriterSettings]::new()
42+
$writerSettings.NewLineChars = "`r`n"
43+
$writerSettings.Indent = $true
44+
$writer = [System.Xml.XmlWriter]::Create($ResPath, $writerSettings)
45+
$XmlDocument.Save($writer)
46+
$writer.Flush()
47+
$writer.Close()
3448
}

doc/specs/#6899 - Action IDs/#6899 - Action IDs.md

+44-25
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ contexts without needing to replicate an entire json blob.
2323

2424
This spec was largely inspired by the following diagram from @DHowett:
2525

26-
![figure 1](data-mockup.png)
26+
![figure 1](data-mockup-002.png)
2727

2828
The goal is to introduce an `id` parameter by which actions could be uniquely
2929
referred to. If we'd ever like to use an action outside the list of `actions`, we
@@ -36,38 +36,54 @@ Discussion with the team lead to the understanding that the name `actions` would
3636
be even better, as a way of making the meaning of the "list of actions" more
3737
obvious.
3838

39-
When we're parsing `actions`, we'll make three passes:
40-
* The first pass will scan the list for objects with an `id` property. We'll
39+
We will then restructure `defaults.json`, and also users' settings files (via `fixUpUserSettings`), in the following manner:
40+
* Instead of each `command` json block containing both the `action` (along with additional arguments) and the `keys`, these will now be split up -
41+
* There will now be one json block for just the `command`/`action`, which will also contain the `id`. These json blocks will be in their own list called `actions`.
42+
* There will be another json block for the `keys`, which will refer to the action to be invoked by `id`. These json blocks will be in their own list called `keybindings`.
43+
44+
For example, let's take a look at the `split pane right` action in `defaults.json` as we currently have it:
45+
46+
`"actions": [..., { "command": { "action": "splitPane", "split": "right" }, "keys": "alt+shift+plus" }, ...]`
47+
48+
This will now become:
49+
50+
`"actions": [..., { "command": { "action": "splitPane", "split": "right" }, "id": "Terminal.SplitPaneRight" }, ...]`
51+
52+
`"keybindings": [..., { "keys": "alt+shift+plus", "id": "Terminal.SplitPaneRight" }, ...]`
53+
54+
Here is how we will parse settings file and construct the relevant settings model objects:
55+
* We will first scan the `actions` list. We'll
4156
attempt to parse those entries into `ActionAndArgs` which we'll store in the
42-
global `id->ActionAndArgs` map. If any entry doesn't have an `id` set, we'll
43-
skip it in this phase. If an entry doesn't have a `command` set, we'll ignore
44-
it in this pass.
45-
* The second pass will scan for _keybindings_. Any entries with `keys` set will
46-
create a `KeyChord->ActionAndArgs` entry in the keybindings map. If the entry
47-
has an `id` set, then we'll simply re-use the action we've already parsed for
48-
the `id`, from the action map. If there isn't an `id`, then we'll parse the
49-
action manually at this time. Entries without a `keys` set will be ignored in
50-
this pass.
51-
* The final pass will be to generate _commands_. Similar to the keybindings
52-
pass, we'll attempt to lookup actions for entries with an `id` set. If there
53-
isn't an `id`, then we'll parse the action manually at this time. We'll then
54-
get the name for the entry, either from the `name` property if it's set, or
55-
the action's `GenerateName` method.
57+
global `id->ActionAndArgs` map. All actions defined in `defaults.json` must have an `id` specified, and all actions provided by fragments must also have `id`s. Any actions from the defaults or fragments that do not provide `id`s will be ignored. As for user-specified commands, if no `id` is set, we will auto-generate one for that command based on the action and any additional arguments. For example, the `split pane right` command above might result in an autogenerated id `User.SplitPaneRight`.
58+
* Note: this step is also where we will generate _commands_. We will use the name provided in the entry if it's set or the action's `GenerateName` method.
59+
* Next we will scan the `keybindings` list. These entries will
60+
create a `KeyChord->ActionAndArgs` entry in the keybindings map. Since these objects should all contain an `id`, we will simply use the `id->ActionAndArgs` map we created in the previous step. Any object with `keys` set but no `id` will be ignored.
5661

57-
For a visual representation, let's assume the user has the following in their
58-
`actions`:
62+
For a visual representation:
5963

60-
![figure 2](data-mockup-actions.png)
64+
![figure 2](data-mockup-actions-ids-keys-maps.png)
6165

62-
We'll first parse the `actions` to generate the mapping of `id`->`Actions`:
66+
### Nested actions
6367

64-
![figure 3](data-mockup-actions-and-ids.png)
68+
We allow certain actions that take a form like this:
6569

66-
Then, we'll parse the `actions` to generate the mapping of keys to actions, with
67-
some actions already being defined in the map of `id`->`Actions`:
70+
```
71+
{
72+
// Select color scheme...
73+
"name": { "key": "SetColorSchemeParentCommandName" },
74+
"commands": [
75+
{
76+
"iterateOn": "schemes",
77+
"name": "${scheme.name}",
78+
"command": { "action": "setColorScheme", "colorScheme": "${scheme.name}" }
79+
}
80+
]
81+
}
82+
```
6883

69-
![figure 4](data-mockup-actions-and-ids-and-keys.png)
84+
For this case, having an `id` on the top level could potentially make sense when it comes to using that `id` in a menu, but not in the case of using that `id` for a keybinding. For the initial implementation, we will not support an `id` for these types of actions, which leaves us open to revisiting this in the future.
7085

86+
### Layering
7187

7288
When layering `actions`, if a later settings file contains an action with the
7389
same `id`, it will replace the current value. In this way, users can redefine
@@ -87,6 +103,9 @@ As we add additional menus to the Terminal, like the customization for the new
87103
tab dropdown, or the tab context menu, or the `TermControl` context menu, they
88104
could all refer to these actions by `id`, rather than duplicating the same json.
89105

106+
As for fragments, all actions in fragments _must_ have an `id`. If a fragment provides an action without an `id`, or provides an `id` that clashes with one of the actions in `defaults.json`, that action will be ignored.
107+
108+
> 👉 NOTE: This will mean that actions will now need an `OriginTag`, similar to profiles and color schemes
90109
91110
### Existing Scenarios
92111

Loading
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Demo shader to show passing in an image using
2+
// experimental.pixelShaderImagePath. This shader simply displays the Terminal
3+
// contents on top of the given image.
4+
//
5+
// The image loaded by the terminal will be placed into the `image` texture.
6+
7+
SamplerState samplerState;
8+
Texture2D shaderTexture : register(t0);
9+
Texture2D image : register(t1);
10+
11+
cbuffer PixelShaderSettings {
12+
float Time;
13+
float Scale;
14+
float2 Resolution;
15+
float4 Background;
16+
};
17+
18+
float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET
19+
{
20+
float4 terminalColor = shaderTexture.Sample(samplerState, tex);
21+
float4 imageColor = image.Sample(samplerState, tex);
22+
return lerp(imageColor, terminalColor, terminalColor.a);
23+
}

0 commit comments

Comments
 (0)