mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 14:19:45 +00:00
Compare commits
2 Commits
release-1.
...
dev/migrie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec03c17e76 | ||
|
|
26c1e684de |
@@ -25,7 +25,6 @@
|
||||
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
|
||||
"Microsoft.VisualStudio.Component.VC.ASAN",
|
||||
"Microsoft.VisualStudio.Component.VC.v142.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.VC.v142.ARM64",
|
||||
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
|
||||
|
||||
@@ -1200,11 +1200,11 @@ Global
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Debug|x86.Build.0 = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|Any CPU.ActiveCfg = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM.ActiveCfg = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM64.ActiveCfg = Debug|ARM64
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x64Test.ActiveCfg = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x64.ActiveCfg = Debug|x64
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x86.ActiveCfg = Debug|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
@@ -1271,6 +1271,7 @@ Global
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|ARM.ActiveCfg = Release|Win32
|
||||
@@ -2115,7 +2116,6 @@ Global
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x64Test.ActiveCfg = Debug|x64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x64Test.Build.0 = Debug|x64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||
@@ -2134,7 +2134,6 @@ Global
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x64Test.ActiveCfg = Release|x64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x64Test.Build.0 = Release|x64
|
||||
{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
|
||||
@@ -3242,10 +3241,13 @@ Global
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM64.Build.0 = Fuzzing|ARM64
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x86.Build.0 = Fuzzing|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
@@ -3319,6 +3321,7 @@ Global
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.Build.0 = Fuzzing|Win32
|
||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
|
||||
@@ -21,7 +21,7 @@ Related repositories include:
|
||||
|
||||
## Installing and running Windows Terminal
|
||||
|
||||
> 🔴 Note: Windows Terminal requires Windows 10 2004 (build 19041) or later
|
||||
> 🔴 Note: Windows Terminal requires Windows 10 1903 (build 18362) or later
|
||||
|
||||
### Microsoft Store [Recommended]
|
||||
|
||||
@@ -284,7 +284,7 @@ If you would like to ask a question that you feel doesn't warrant an issue
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* You must be running Windows 10 2004 (build >= 10.0.19041.0) or later to run
|
||||
* You must be running Windows 1903 (build >= 10.0.18362.0) or later to run
|
||||
Windows Terminal
|
||||
* You must [enable Developer Mode in the Windows Settings
|
||||
app](https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"config": {
|
||||
"base_url": "https://dev.azure.com/microsoft/os",
|
||||
"auth_token": "INSERT_PAT_HERE",
|
||||
"project": "OpenConsole",
|
||||
"type": "Bug",
|
||||
"unique_fields": [
|
||||
"Microsoft.VSTS.Common.CustomString03"
|
||||
],
|
||||
"comment": "<a href='{{ input_url }}'>This input</a> caused the <a href='{{ target_url }}'>fuzz target</a> {{ report.executable }} to crash. The faulting input SHA256 hash is {{ report.input_sha256 }} <br>",
|
||||
"ado_fields": {
|
||||
"System.AssignedTo": "INSERT_ASSIGNED_HERE",
|
||||
"System.Tags": "OneFuzz",
|
||||
"System.AreaPath": "OS\\WDX\\DXP\\WinDev\\Terminal",
|
||||
"OSG.Watson.Telemetry14DaysInMarketHits": "1",
|
||||
"System.IterationPath": "OS\\Future",
|
||||
"Microsoft.VSTS.Common.CustomString01": "{{ job.project }}",
|
||||
"Microsoft.VSTS.Common.CustomString02": "{{ job.name }}",
|
||||
"Microsoft.VSTS.Common.CustomString03": "{{ report.minimized_stack_function_lines_sha256}}",
|
||||
"System.Title": "[Fuzzing] - {{ report.crash_site }}",
|
||||
"Microsoft.VSTS.CMMI.HowFound": "Security: Fuzzing",
|
||||
"OSG.SecurityImpact": "Security Triage Requested",
|
||||
"OSG.SDLSeverity": "Moderate",
|
||||
"Microsoft.VSTS.TCM.ReproSteps": "The fuzzing target ({{ job.project }} {{ job.name }} {{ job.build }}) reported a crash. <br> {%if report.asan_log %} AddressSanitizer reported the following details: <br> <pre> {{ report.asan_log }} </pre> {% else %} Faulting call stack: <ul> {% for item in report.call_stack %} <li> {{ item }} </li> {% endfor %} </ul> <br> {% endif %} You can reproduce the issue remotely in OneFuzz by running the following command: <pre> {{ repro_cmd }} </pre>"
|
||||
},
|
||||
"on_duplicate": {
|
||||
"set_state": {"Resolved": "Active", "Closed": "Active"},
|
||||
"ado_fields": {
|
||||
"System.IterationPath": "OS\\Future"
|
||||
},
|
||||
"increment": ["OSG.Watson.Telemetry14DaysInMarketHits"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ $totalTestsExecutedCount = 0
|
||||
|
||||
# We assume that we only have one testRun with a given name that we care about
|
||||
# We only process the last testRun with a given name (based on completedDate)
|
||||
# The name of a testRun is set to the Helix queue that it was run on (e.g. windows.10.amd64.client21h1.xaml)
|
||||
# The name of a testRun is set to the Helix queue that it was run on (e.g. windows.10.amd64.client19h1.xaml)
|
||||
# If we have multiple test runs on the same queue that we care about, we will need to re-visit this logic
|
||||
foreach ($testRun in ($testRuns.value | Sort-Object -Property "completedDate" -Descending))
|
||||
{
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"Branch": [
|
||||
{
|
||||
"collection": "microsoft",
|
||||
"project": "OS",
|
||||
"repo": "os.2020",
|
||||
"name": "official/rs_wdx_dxp_windev",
|
||||
"workitem": "38106206",
|
||||
"CheckinFiles": [
|
||||
{
|
||||
"source": "WindowsTerminal.app.man",
|
||||
"path": "/redist/mspartners/ipa/WindowsTerminal",
|
||||
"type": "File"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Email": [
|
||||
{
|
||||
"sendTo": "condev",
|
||||
"sendOnErrorOnly": "False"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
<packages>
|
||||
<package id="MUXCustomBuildTasks" version="1.0.48" targetFramework="native" />
|
||||
<package id="Microsoft.Taef" version="10.60.210621002" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
<package id="Microsoft.PGO-Helpers.Cpp" version="0.2.22" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<NuGetPackageDirectory>$(MSBuildThisFileDirectory)..\..\packages</NuGetPackageDirectory>
|
||||
<PkgMicrosoft_PGO_Helpers_Cpp>$(NuGetPackageDirectory)\Microsoft.Internal.PGO-Helpers.Cpp.0.2.34</PkgMicrosoft_PGO_Helpers_Cpp>
|
||||
<PkgMicrosoft_PGO_Helpers_Cpp>$(NuGetPackageDirectory)\Microsoft.PGO-Helpers.Cpp.0.2.22</PkgMicrosoft_PGO_Helpers_Cpp>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Get version information -->
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Optional, defaults to main. Name of the branch which will be used for calculating branch point. -->
|
||||
<PGOBranch>release-1.13</PGOBranch>
|
||||
<PGOBranch>main</PGOBranch>
|
||||
|
||||
<!-- Mandatory. Name of the NuGet package which will contain PGO databases for consumption by build system. -->
|
||||
<PGOPackageName>Microsoft.Internal.Windows.Terminal.PGODatabase</PGOPackageName>
|
||||
@@ -20,12 +20,6 @@
|
||||
<!-- Mandatory. Minor version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionMinor>$(VersionMinor)</PGOPackageVersionMinor>
|
||||
|
||||
<!-- Mandatory, defaults to 0. Patch version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionPatch>0</PGOPackageVersionPatch>
|
||||
|
||||
<!-- Optional, defaults to empty. Prerelease version number of the PGO database which should match the version of the product. This can be hardcoded or obtained from other sources in build system. -->
|
||||
<PGOPackageVersionPrerelease></PGOPackageVersionPrerelease>
|
||||
|
||||
<!-- Mandatory. Path to nuget.config file for the project. Path is relative to where the props file will be. -->
|
||||
<PGONuGetConfigPath>$(MSBuildThisFileDirectory)..\..\nuget.config</PGONuGetConfigPath>
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ stages:
|
||||
- template: ./templates/build-console-audit-job.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
||||
- stage: Build_x64
|
||||
displayName: Build x64
|
||||
dependsOn: []
|
||||
@@ -62,7 +61,6 @@ stages:
|
||||
- template: ./templates/build-console-ci.yml
|
||||
parameters:
|
||||
platform: ARM64
|
||||
|
||||
- stage: Test_x64
|
||||
displayName: Test x64
|
||||
dependsOn: [Build_x64]
|
||||
@@ -78,16 +76,6 @@ stages:
|
||||
- template: ./templates/test-console-ci.yml
|
||||
parameters:
|
||||
platform: x86
|
||||
|
||||
- stage: Helix_x64
|
||||
displayName: Helix x64
|
||||
dependsOn: [Build_x64]
|
||||
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||
jobs:
|
||||
- template: ./templates/console-ci-helix-job.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
||||
- stage: Scripts
|
||||
displayName: Code Health Scripts
|
||||
dependsOn: []
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
trigger:
|
||||
batch: true
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
- samples/*
|
||||
- tools/*
|
||||
|
||||
pr: none
|
||||
|
||||
# 0.0.yyMM.dd##
|
||||
# 0.0.1904.0900
|
||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||
|
||||
stages:
|
||||
- stage: Build_Fuzz_Config
|
||||
displayName: Build Fuzzers
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates/build-console-fuzzing.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
- stage: OneFuzz
|
||||
displayName: Submit OneFuzz Job
|
||||
dependsOn: ['Build_Fuzz_Config']
|
||||
condition: succeeded()
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
variables:
|
||||
artifactName: fuzzingBuildOutput
|
||||
jobs:
|
||||
- job:
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: $(artifactName)
|
||||
downloadPath: $(Build.ArtifactStagingDirectory)
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.x'
|
||||
addToPath: true
|
||||
architecture: 'x64'
|
||||
- bash: |
|
||||
set -ex
|
||||
pip -q install onefuzz
|
||||
onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain) --client_secret $(client_secret)
|
||||
sed -i s/INSERT_PAT_HERE/$(ado_pat)/ build/Fuzz/notifications-ado.json
|
||||
sed -i s/INSERT_ASSIGNED_HERE/$(ado_assigned_to)/ build/Fuzz/notifications-ado.json
|
||||
displayName: Configure OneFuzz
|
||||
- bash: |
|
||||
onefuzz template libfuzzer basic --colocate_all_tasks --vm_count 1 --target_exe $target_exe_path --notification_config build/Fuzz/notifications-ado.json OpenConsole $test_name $(Build.SourceVersion) default
|
||||
displayName: Submit OneFuzz Job
|
||||
env:
|
||||
target_exe_path: $(Build.ArtifactStagingDirectory)/$(artifactName)/Fuzzing/x64/test/OpenConsoleFuzzer.exe
|
||||
test_name: WriteCharsLegacy
|
||||
@@ -22,10 +22,6 @@ parameters:
|
||||
displayName: "Run Compliance and Security Build"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: publishSymbolsToPublic
|
||||
displayName: "Publish Symbols to MSDL"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildTerminalVPack
|
||||
displayName: "Build Windows Terminal VPack"
|
||||
type: boolean
|
||||
@@ -52,43 +48,9 @@ parameters:
|
||||
- x64
|
||||
- x86
|
||||
- arm64
|
||||
- name: buildWindowsVersions
|
||||
type: object
|
||||
default:
|
||||
- Win10
|
||||
- Win11
|
||||
|
||||
variables:
|
||||
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"
|
||||
# because it truncates the value after the first period.
|
||||
# We also want to disable the suffix entirely if we're Release branded while
|
||||
# on a release branch.
|
||||
# main is special, however. XES ignores main. Since we never produce actual
|
||||
# shipping builds from main, we want to force it to have a beta label as
|
||||
# well.
|
||||
#
|
||||
# In effect:
|
||||
# BRANCH / BRANDING | Release | Preview
|
||||
# ------------------|----------------------------|-----------------------------
|
||||
# release-* | 1.12.20220427 | 1.13.20220427-preview
|
||||
# main | 1.14.20220427-experimental | 1.14.20220427-experimental
|
||||
# all others | 1.14.20220427-mybranch | 1.14.20220427-mybranch
|
||||
${{ if startsWith(variables['Build.SourceBranchName'], 'release-') }}:
|
||||
${{ if eq(parameters.branding, 'Release') }}:
|
||||
NoNuGetPackBetaVersion: true
|
||||
${{ else }}:
|
||||
NuGetPackBetaVersion: preview
|
||||
${{ elseif eq(variables['Build.SourceBranchName'], 'main') }}:
|
||||
NuGetPackBetaVersion: experimental
|
||||
# The NuGet packages have to use *somebody's* DLLs. We used to force them to
|
||||
# use the Win10 build outputs, but if there isn't a Win10 build we should use
|
||||
# the Win11 one.
|
||||
${{ if containsValue(parameters.buildWindowsVersions, 'Win10') }}:
|
||||
TerminalBestVersionForNuGetPackages: Win10
|
||||
${{ else }}:
|
||||
TerminalBestVersionForNuGetPackages: Win11
|
||||
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
resources:
|
||||
@@ -102,11 +64,9 @@ jobs:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ each platform in parameters.buildPlatforms }}:
|
||||
${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
||||
${{ config }}_${{ platform }}_${{ windowsVersion }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
TerminalTargetWindowsVersion: ${{ windowsVersion }}
|
||||
${{ config }}_${{ platform }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
displayName: Build
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
@@ -191,11 +151,6 @@ jobs:
|
||||
|
||||
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
||||
pwsh: true
|
||||
- task: PowerShell@2
|
||||
displayName: Copy the Context Menu Loc Resources to CascadiaPackage
|
||||
inputs:
|
||||
filePath: ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
|
||||
pwsh: true
|
||||
- task: PowerShell@2
|
||||
displayName: Generate NOTICE.html from NOTICE.md
|
||||
inputs:
|
||||
@@ -203,17 +158,13 @@ jobs:
|
||||
arguments: -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html
|
||||
pwsh: true
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- pwsh: |-
|
||||
./build/scripts/Patch-ManifestsToWindowsVersion.ps1 -NewWindowsVersion "10.0.22000.0"
|
||||
displayName: Update manifest target version to Win11 (if necessary)
|
||||
condition: and(succeeded(), eq(variables['TerminalTargetWindowsVersion'], 'Win11'))
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln
|
||||
condition: true
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
vsVersion: 16.0
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage;Terminal\WindowsTerminalUniversal /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -224,7 +175,7 @@ jobs:
|
||||
continueOnError: True
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
||||
ArtifactName: binlog-$(BuildPlatform)-$(TerminalTargetWindowsVersion)
|
||||
ArtifactName: binlog-$(BuildPlatform)
|
||||
- task: PowerShell@2
|
||||
displayName: Check MSIX for common regressions
|
||||
inputs:
|
||||
@@ -237,6 +188,7 @@ jobs:
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
|
||||
condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
vsVersion: 16.0
|
||||
@@ -286,10 +238,11 @@ jobs:
|
||||
displayName: Publish Artifact (appx)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/appx
|
||||
ArtifactName: appx-$(BuildPlatform)-$(BuildConfiguration)-$(TerminalTargetWindowsVersion)
|
||||
ArtifactName: appx-$(BuildPlatform)-$(BuildConfiguration)
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy PublicTerminalCore.dll to Artifacts
|
||||
condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
|
||||
inputs:
|
||||
Contents: >-
|
||||
**/PublicTerminalCore.dll
|
||||
@@ -300,9 +253,10 @@ jobs:
|
||||
flattenFolders: true
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (PublicTerminalCore)
|
||||
condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/wpf
|
||||
ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)-$(TerminalTargetWindowsVersion)
|
||||
ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)
|
||||
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish symbols path
|
||||
@@ -320,11 +274,6 @@ jobs:
|
||||
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- job: BundleAndSign
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
||||
${{ windowsVersion }}:
|
||||
TerminalTargetWindowsVersion: ${{ windowsVersion }}
|
||||
displayName: Create and sign AppX/MSIX bundles
|
||||
dependsOn: Build
|
||||
steps:
|
||||
@@ -337,21 +286,20 @@ jobs:
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Artifacts ${{ platform }} $(TerminalTargetWindowsVersion)
|
||||
inputs:
|
||||
artifactName: appx-${{ platform }}-Release-$(TerminalTargetWindowsVersion)
|
||||
# Add 3000 to the major version component, but only for the bundle.
|
||||
# This is to ensure that it is newer than "2022.xx.yy.zz" or whatever the original bundle versions were before
|
||||
# we switched to uniform naming.
|
||||
- pwsh: |-
|
||||
$VersionEpoch = 3000
|
||||
$Components = "$(XES_APPXMANIFESTVERSION)" -Split "\."
|
||||
$Components[0] = ([int]$Components[0] + $VersionEpoch)
|
||||
$BundleVersion = $Components -Join "."
|
||||
.\build\scripts\Create-AppxBundle.ps1 -InputPath "$(System.ArtifactsDirectory)" -ProjectName CascadiaPackage -BundleVersion $BundleVersion -OutputPath "$(System.ArtifactsDirectory)\Microsoft.WindowsTerminal_$(TerminalTargetWindowsVersion)_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Artifacts (*.appx, *.msix)
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: >-
|
||||
**/*.msix
|
||||
|
||||
**/*.appx
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Create WindowsTerminal*.msixbundle
|
||||
inputs:
|
||||
filePath: build\scripts\Create-AppxBundle.ps1
|
||||
arguments: -InputPath "$(System.ArtifactsDirectory)" -ProjectName CascadiaPackage -BundleVersion 0.0.0.0 -OutputPath "$(System.ArtifactsDirectory)\Microsoft.WindowsTerminal_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.msixbundle to ESRP for code signing
|
||||
inputs:
|
||||
@@ -386,12 +334,11 @@ jobs:
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: appxbundle-signed'
|
||||
inputs:
|
||||
PathtoPublish: $(System.ArtifactsDirectory)
|
||||
ArtifactName: appxbundle-signed-$(TerminalTargetWindowsVersion)
|
||||
ArtifactName: appxbundle-signed
|
||||
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- job: PackageAndSignWPF
|
||||
@@ -412,26 +359,31 @@ jobs:
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download ${{ platform }} PublicTerminalCore
|
||||
inputs:
|
||||
artifactName: wpf-dll-${{ platform }}-$(BuildConfiguration)-Win10
|
||||
itemPattern: '**/*.dll'
|
||||
downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
|
||||
extractTars: false
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download x86 PublicTerminalCore
|
||||
inputs:
|
||||
artifactName: wpf-dll-x86-$(BuildConfiguration)
|
||||
itemPattern: '**/*.dll'
|
||||
downloadPath: bin\Win32\$(BuildConfiguration)\
|
||||
extractTars: false
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download x64 PublicTerminalCore
|
||||
inputs:
|
||||
artifactName: wpf-dll-x64-$(BuildConfiguration)
|
||||
itemPattern: '**/*.dll'
|
||||
downloadPath: bin\x64\$(BuildConfiguration)\
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Move downloaded artifacts around
|
||||
displayName: Move downloaded artifacts up a level
|
||||
inputs:
|
||||
targetType: inline
|
||||
# Find all artifact files and move them up a directory. Ugh.
|
||||
script: |-
|
||||
script: >-
|
||||
Get-ChildItem bin -Recurse -Directory -Filter wpf-dll-* | % {
|
||||
$_ | Get-ChildItem -Recurse -File | % {
|
||||
Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
|
||||
}
|
||||
}
|
||||
Move-Item bin\x86 bin\Win32
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 5.10.0
|
||||
inputs:
|
||||
@@ -499,71 +451,6 @@ jobs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\nupkg
|
||||
ArtifactName: wpf-nupkg-$(BuildConfiguration)
|
||||
|
||||
- ${{ if eq(parameters.publishSymbolsToPublic, true) }}:
|
||||
- job: PublishSymbols
|
||||
displayName: Publish Symbols
|
||||
dependsOn: BundleAndSign
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
|
||||
# Download the appx-PLATFORM-CONFIG-VERSION artifact for every platform/version combo
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- ${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Symbols ${{ platform }} ${{ windowsVersion }}
|
||||
inputs:
|
||||
artifactName: appx-${{ platform }}-Release-${{ windowsVersion }}
|
||||
|
||||
# It seems easier to do this -- download every appxsym -- then enumerate all the PDBs in the build directory for the
|
||||
# public symbol push. Otherwise, we would have to list all of the PDB files one by one.
|
||||
- pwsh: |-
|
||||
mkdir $(Build.SourcesDirectory)/appxsym-temp
|
||||
Get-ChildItem "$(System.ArtifactsDirectory)" -Filter *.appxsym -Recurse | % {
|
||||
$src = $_.FullName
|
||||
$dest = Join-Path "$(Build.SourcesDirectory)/appxsym-temp/" $_.Name
|
||||
|
||||
mkdir $dest
|
||||
Write-Host "Extracting $src to $dest..."
|
||||
tar -x -v -f $src -C $dest
|
||||
}
|
||||
displayName: Extract symbols for public consumption
|
||||
|
||||
# Pull the Windows SDK for the developer tools like the debuggers so we can index sources later
|
||||
- template: .\templates\install-winsdk-steps.yml
|
||||
- task: PowerShell@2
|
||||
displayName: Source Index PDBs (the public ones)
|
||||
inputs:
|
||||
filePath: build\scripts\Index-Pdbs.ps1
|
||||
arguments: -SearchDir '$(Build.SourcesDirectory)/appxsym-temp' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
|
||||
# Publish the app symbols to the public MSDL symbol server
|
||||
# accessible via https://msdl.microsoft.com/download/symbols
|
||||
- task: PublishSymbols@2
|
||||
displayName: 'Publish app symbols to MSDL'
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.SourcesDirectory)/appxsym-temp'
|
||||
searchPattern: '**/*.pdb'
|
||||
SymbolsMaximumWaitTime: 30
|
||||
SymbolServerType: 'TeamServices'
|
||||
SymbolsProduct: 'Windows Terminal Application Binaries'
|
||||
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
||||
# The ADO task does not support indexing of GitHub sources.
|
||||
indexSources: false
|
||||
detailedLog: true
|
||||
# There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
|
||||
# To work around this issue, we just force LIB to be any dir that we know exists.
|
||||
# Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
|
||||
env:
|
||||
LIB: $(Build.SourcesDirectory)
|
||||
ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
|
||||
ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
|
||||
|
||||
|
||||
- ${{ if eq(parameters.buildTerminalVPack, true) }}:
|
||||
- job: VPack
|
||||
displayName: Create Windows vPack
|
||||
@@ -578,7 +465,7 @@ jobs:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Build Artifacts
|
||||
inputs:
|
||||
artifactName: appxbundle-signed-Win11
|
||||
artifactName: appxbundle-signed
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Rename and stage packages for vpack
|
||||
@@ -587,7 +474,7 @@ jobs:
|
||||
script: >-
|
||||
# Rename to known/fixed name for Windows build system
|
||||
|
||||
Get-ChildItem Microsoft.WindowsTerminal_Win11_*.msixbundle | Rename-Item -NewName { 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle' }
|
||||
Get-ChildItem Microsoft.WindowsTerminal_*.msixbundle | Rename-Item -NewName { 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle' }
|
||||
|
||||
|
||||
# Create vpack directory and place item inside
|
||||
@@ -595,25 +482,14 @@ jobs:
|
||||
mkdir WindowsTerminal.app
|
||||
|
||||
mv Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle .\WindowsTerminal.app\
|
||||
workingDirectory: $(System.ArtifactsDirectory)\appxbundle-signed-Win11
|
||||
workingDirectory: $(System.ArtifactsDirectory)\appxbundle-signed
|
||||
- task: PkgESVPack@12
|
||||
displayName: 'Package ES - VPack'
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
sourceDirectory: $(System.ArtifactsDirectory)\appxbundle-signed-Win11\WindowsTerminal.app
|
||||
description: VPack for the Windows Terminal Application
|
||||
sourceDirectory: $(System.ArtifactsDirectory)\appxbundle-signed\WindowsTerminal.app
|
||||
description: Windows Terminal pre-install application
|
||||
pushPkgName: WindowsTerminal.app
|
||||
owner: conhost
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Copy VPack Manifest to Drop'
|
||||
inputs:
|
||||
targetPath: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
artifactName: VPackManifest
|
||||
- task: PkgESFCIBGit@12
|
||||
displayName: 'Submit VPack Manifest to Windows'
|
||||
inputs:
|
||||
configPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
|
||||
artifactsDirectory: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
prTimeOut: 5
|
||||
owner: condev
|
||||
...
|
||||
|
||||
@@ -2,6 +2,8 @@ parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
minimumExpectedTestsExecutedCount: 10 # Sanity check for minimum expected tests to be reported
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
@@ -26,3 +28,21 @@ jobs:
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
condition: and(succeededOrFailed(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||
|
||||
- template: helix-runtests-job.yml
|
||||
parameters:
|
||||
name: 'RunTestsInHelix'
|
||||
dependsOn: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
condition: and(succeeded(), and(eq('${{ parameters.platform }}', 'x64'), not(eq(variables['Build.Reason'], 'PullRequest'))))
|
||||
testSuite: 'DevTestSuite'
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
|
||||
- template: helix-processtestresults-job.yml
|
||||
parameters:
|
||||
dependsOn:
|
||||
- RunTestsInHelix
|
||||
condition: and(succeededOrFailed(), and(eq('${{ parameters.platform }}', 'x64'), not(eq(variables['Build.Reason'], 'PullRequest'))))
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
minimumExpectedTestsExecutedCount: ${{ parameters.minimumExpectedTestsExecutedCount }}
|
||||
@@ -1,114 +0,0 @@
|
||||
parameters:
|
||||
configuration: 'Fuzzing'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS16-latest
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
clean: true
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 5.2.0'
|
||||
inputs:
|
||||
versionSpec: 5.2.0
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for solution
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: OpenConsole.sln
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||
del %TEMP%\vsinstalldir.txt
|
||||
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\OpenConsole.sln'
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
vsVersion: 16.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Rationalize build platform'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Arch = "$(BuildPlatform)"
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy result logs to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.wtl
|
||||
**/*onBuildMachineResults.xml
|
||||
${{ parameters.testLogPath }}
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy outputs needed for test runs to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.exe
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.dll
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.xml
|
||||
**/Microsoft.VCLibs.*.appx
|
||||
**/TestHostApp/*.exe
|
||||
**/TestHostApp/*.dll
|
||||
**/TestHostApp/*.xml
|
||||
!**/*.pdb
|
||||
!**/*.ipdb
|
||||
!**/*.obj
|
||||
!**/*.pch
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
condition: succeeded()
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish All Build Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'fuzzingBuildOutput'
|
||||
@@ -110,8 +110,6 @@ steps:
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.dll
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.xml
|
||||
**/Microsoft.VCLibs.*.appx
|
||||
**/*unit.test*.dll
|
||||
**/*unit.test*.manifest
|
||||
**/TestHostApp/*.exe
|
||||
**/TestHostApp/*.dll
|
||||
**/TestHostApp/*.xml
|
||||
@@ -128,7 +126,7 @@ steps:
|
||||
displayName: 'Publish All Build Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'drop'
|
||||
ArtifactName: 'drop'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy PGO databases needed for PGO instrumentation run'
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
minimumExpectedTestsExecutedCount: 10 # Sanity check for minimum expected tests to be reported
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
|
||||
jobs:
|
||||
- template: helix-runtests-job.yml
|
||||
parameters:
|
||||
name: 'RunTestsInHelix'
|
||||
# We're not setting dependsOn as we want to rely on the "stage" dependency above us
|
||||
testSuite: 'DevTestSuite'
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
|
||||
- template: helix-processtestresults-job.yml
|
||||
parameters:
|
||||
dependsOn:
|
||||
- RunTestsInHelix
|
||||
# the default condition is succeededOrFailed(), and the "stage" condition ensures we only run as needed
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
minimumExpectedTestsExecutedCount: ${{ parameters.minimumExpectedTestsExecutedCount }}
|
||||
@@ -8,7 +8,6 @@ parameters:
|
||||
|
||||
jobs:
|
||||
- job: ProcessTestResults
|
||||
displayName: Process Helix Results ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
condition: ${{ parameters.condition }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
pool:
|
||||
|
||||
@@ -14,12 +14,11 @@ parameters:
|
||||
platform: ''
|
||||
# if 'useBuildOutputFromBuildId' is set, we will default to using a build from this pipeline:
|
||||
useBuildOutputFromPipeline: $(System.DefinitionId)
|
||||
openHelixTargetQueues: 'windows.10.amd64.client21h1.open.xaml'
|
||||
closedHelixTargetQueues: 'windows.10.amd64.client21h1.xaml'
|
||||
openHelixTargetQueues: 'windows.10.amd64.client19h1.open.xaml'
|
||||
closedHelixTargetQueues: 'windows.10.amd64.client19h1.xaml'
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
displayName: Submit Helix ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
condition: ${{ parameters.condition }}
|
||||
pool:
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
solution: $(Build.SourcesDirectory)\OpenConsole.sln
|
||||
platform: $(buildPlatform)
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: '/t:MergePGOCounts /p:PGOBuildMode=Instrument /p:PGDPath=$(pgoArtifactsPath)\$(buildPlatform) /p:PGCRootPath=$(pgoArtifactsPath)\$(buildPlatform)'
|
||||
msbuildArguments: '/t:MergePGOCounts /p:PGDPath=$(pgoArtifactsPath)\$(buildPlatform) /p:PGCRootPath=$(pgoArtifactsPath)\$(buildPlatform)'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy merged pgd to artifact staging'
|
||||
@@ -67,4 +67,4 @@ jobs:
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathToPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
@@ -2,6 +2,8 @@ parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
minimumExpectedTestsExecutedCount: 10 # Sanity check for minimum expected tests to be reported
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
artifactName: 'drop'
|
||||
testLogPath: '$(Build.BinariesDirectory)\$(BuildPlatform)\$(BuildConfiguration)\testsOnBuildMachine.wtl'
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT license.
|
||||
|
||||
$LocalizationsFromContextMenu = Get-ChildItem ./src/cascadia/TerminalApp/Resources -Recurse -Filter ContextMenu.resw
|
||||
$Languages = [System.Collections.HashTable]::New()
|
||||
$LocalizationsFromContextMenu | ForEach-Object {
|
||||
$Languages[$_.Directory.Name] = $_
|
||||
}
|
||||
|
||||
ForEach ($pair in $Languages.GetEnumerator()) {
|
||||
$LanguageDir = "./src/cascadia/CascadiaPackage/Resources/$($pair.Key)"
|
||||
$ResPath = "$LanguageDir/Resources.resw"
|
||||
$PreexistingResw = Get-Item $ResPath -EA:Ignore
|
||||
If ($null -eq $PreexistingResw) {
|
||||
Write-Host "Copying $($pair.Value.FullName) to $ResPath"
|
||||
New-Item -type Directory $LanguageDir -EA:Ignore
|
||||
Copy-Item $pair.Value.FullName $ResPath
|
||||
} Else {
|
||||
# Merge Them!
|
||||
Write-Host "Merging $($pair.Value.FullName) into $ResPath"
|
||||
$existingXml = [xml](Get-Content $PreexistingResw.FullName)
|
||||
$newXml = [xml](Get-Content $pair.Value.FullName)
|
||||
$newDataKeys = $newXml.root.data.name
|
||||
$existingXml.root.data | % {
|
||||
If ($_.name -in $newDataKeys) {
|
||||
$null = $existingXml.root.RemoveChild($_)
|
||||
}
|
||||
}
|
||||
$newXml.root.data | % {
|
||||
$null = $existingXml.root.AppendChild($existingXml.ImportNode($_, $true))
|
||||
}
|
||||
$existingXml.Save($PreexistingResw.FullName)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT license.
|
||||
|
||||
Param(
|
||||
[string]$NewWindowsVersion = "10.0.22000.0"
|
||||
)
|
||||
|
||||
Get-ChildItem src/cascadia/CascadiaPackage -Recurse -Filter *.appxmanifest | ForEach-Object {
|
||||
$xml = [xml](Get-Content $_.FullName)
|
||||
$xml.Package.Dependencies.TargetDeviceFamily | Where-Object Name -Like "Windows*" | ForEach-Object {
|
||||
$_.MinVersion = $NewWindowsVersion
|
||||
}
|
||||
$xml.Save($_.FullName)
|
||||
}
|
||||
@@ -10,18 +10,4 @@
|
||||
<OpenConsoleDir>$(MSBuildThisFileDirectory)</OpenConsoleDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
For the Windows 10 build, we're targeting the prerelease version of Microsoft.UI.Xaml.
|
||||
This version emits every XAML DLL directly into our package.
|
||||
This is a workaround for us not having deliverable MSFT-21242953 on this version of Windows.
|
||||
-->
|
||||
<TerminalMUXVersion>2.7.2-prerelease.220406002</TerminalMUXVersion>
|
||||
<!--
|
||||
For the Windows 11-specific build, we're targeting the public version of Microsoft.UI.Xaml.
|
||||
This version emits a package dependency instead of embedding the dependency in our own package.
|
||||
-->
|
||||
<TerminalMUXVersion Condition="'$(TerminalTargetWindowsVersion)'=='Win11'">2.7.1</TerminalMUXVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
12
custom.props
12
custom.props
@@ -2,18 +2,6 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- This file is read by XES, which we use in our Release builds. -->
|
||||
<PropertyGroup Label="Version">
|
||||
<!--
|
||||
The Windows 11 build is going to have the same package name, so it *must* have a different version.
|
||||
The easiest way for us to do this is to add 1 to the revision field.
|
||||
In short, for a given Terminal build 1.11, we will emit two different versions (assume this is build
|
||||
4 on day 23 of the year):
|
||||
- 1.11.234.0 for Windows 10
|
||||
- 1.11.235.0 for Windows 11
|
||||
This presents a potential for conflicts if we want to ship two builds produced back to back on the
|
||||
same day... which is terribly unlikely.
|
||||
-->
|
||||
<VersionBuildRevision Condition="'$(TerminalTargetWindowsVersion)'=='Win11' and '$(VersionBuildRevision)'!=''">$([MSBuild]::Add($(VersionBuildRevision), 1))</VersionBuildRevision>
|
||||
|
||||
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
|
||||
<XesBaseYearForStoreVersion>2021</XesBaseYearForStoreVersion>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
|
||||
@@ -54,24 +54,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"BellSound": {
|
||||
"default": "",
|
||||
"description": "Sets the file location of the sound played when the application emits a BEL character. If the path is invalid no sound will be played. This property also accepts an array of sounds and the terminal will pick one at random.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"AppearanceConfig": {
|
||||
"properties": {
|
||||
"colorScheme": {
|
||||
@@ -503,7 +485,7 @@
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "This will override the profile's `elevate` setting."
|
||||
}
|
||||
},
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
@@ -879,7 +861,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
},
|
||||
"SetFullScreenAction": {
|
||||
"description": "Arguments for a setFullScreen action",
|
||||
@@ -899,7 +881,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
},
|
||||
"SetMaximizedAction": {
|
||||
"description": "Arguments for a setMaximized action",
|
||||
@@ -919,7 +901,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
},
|
||||
"WtAction": {
|
||||
"description": "Arguments corresponding to a wt Action",
|
||||
@@ -1651,7 +1633,7 @@
|
||||
"$ref": "#/$defs/CopyFormat"
|
||||
},
|
||||
"trimBlockSelection": {
|
||||
"default": true,
|
||||
"default": false,
|
||||
"description": "When set to true, trailing white-spaces will be removed from text in rectangular (block) selection while copied to your clipboard. When set to false, the white-spaces will be preserved.",
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -1727,7 +1709,7 @@
|
||||
},
|
||||
"startOnUserLogin": {
|
||||
"default": false,
|
||||
"description": "When set to true, this enables the launch of Terminal at startup. Setting this to false will disable the startup task entry. If the Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.",
|
||||
"description": "When set to true, this enables the launch of Windows Terminal at startup. Setting this to false will disable the startup task entry. If the Windows Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"firstWindowPreference": {
|
||||
@@ -1779,7 +1761,7 @@
|
||||
},
|
||||
"useAcrylicInTabRow": {
|
||||
"default": false,
|
||||
"description": "When set to true, the tab row will have an acrylic material background with 50% opacity.",
|
||||
"description": "When set to true, the tab row will have an acrylic background with 50% opacity.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"actions": {
|
||||
@@ -2077,11 +2059,6 @@
|
||||
"description": "Use to set a path to a pixel shader to use with the Terminal. Overrides `experimental.retroTerminalEffect`. This is an experimental feature, and its continued existence is not guaranteed.",
|
||||
"type": "string"
|
||||
},
|
||||
"experimental.useAtlasEngine": {
|
||||
"description": "Enable using the experimental new rendering engine for this profile. This is an experimental feature, and its continued existence is not guaranteed.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"fontFace": {
|
||||
"default": "Cascadia Mono",
|
||||
"description": "[deprecated] Define 'face' within the 'font' object instead.",
|
||||
@@ -2242,7 +2219,7 @@
|
||||
},
|
||||
"useAcrylic": {
|
||||
"default": false,
|
||||
"description": "When set to true, the window will have an acrylic material background. When set to false, the window will have a plain, untextured background.",
|
||||
"description": "When set to true, the window will have an acrylic background. When set to false, the window will have a plain, untextured background.",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# Fuzzing
|
||||
|
||||
## Setting up a fuzzer locally
|
||||
|
||||
OpenConsole can be built with a `Fuzzing` configuration. To set up a fuzzer, you'll need an `LLVMFuzzerTestOneInput` function. This serves as a way for the fuzzer to attach itself and inject tests into your fuzz target.
|
||||
|
||||
To build the fuzzer locally, build the OpenConsole solution in the `Fuzzing` configuration. This should output an executable that runs the fuzzer on the provided test case. In the case of PR #9604, the desired executable is located at `bin\x64\Fuzzing\OpenConsoleFuzzer.exe`.
|
||||
|
||||
### Resources
|
||||
- [LibFuzzer Docs](https://www.llvm.org/docs/LibFuzzer.html)
|
||||
- [#9604](https://github.com/microsoft/terminal/pull/9604)
|
||||
|
||||
## Setting up OneFuzz
|
||||
|
||||
OneFuzz allows us to run our fuzzers in CI and be alerted of new bugs found in this endeavor.
|
||||
|
||||
### Installing OneFuzz
|
||||
|
||||
You can download the latest OneFuzz CLI on their [releases page](https://github.com/microsoft/onefuzz/releases).
|
||||
|
||||
### Configuring OneFuzz
|
||||
|
||||
To run OneFuzz locally, you'll need to configure its endpoint, client ID, and client secret. Windows has a preset configuration available; this can be found at [this tutorial](https://www.osgwiki.com/wiki/Fuzzing_Service_-_Azure_Edge_and_Platform#Configure_OneFuzz_CLI) on osgwiki.
|
||||
|
||||
|
||||
|
||||
`onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain)`
|
||||
|
||||
**NOTE**: Our pipeline is already set up with these variables, so you don't need to worry about this when running this on Azure DevOps.
|
||||
|
||||
### Running a job on OneFuzz
|
||||
|
||||
You should now be able to run a job using the following command:
|
||||
|
||||
`onefuzz template libfuzzer basic <project> <name> <build> <pool> --target_exe <exe_path>`
|
||||
|
||||
- `project`: the name of the project
|
||||
- `name`: the name of the test
|
||||
- `build`: the identifier for the build (i.e. commit SHA1)
|
||||
- `pool`: the VM pool to run this on
|
||||
- `exe_path`: the fuzzer executable output from building your project
|
||||
|
||||
This should also output more information (i.e. job ID) about the newly created job in a JSON format.
|
||||
|
||||
### Enabling notifications
|
||||
|
||||
**NOTE**: Our pipeline is already set up with this functionality. However, here is a quick guide on how to get it set up and modify it to our liking.
|
||||
|
||||
OneFuzz supports multiple notification systems at once including MS Teams and Azure DevOps. See the resources below to learn more about setting these up.
|
||||
|
||||
Our pipeline has been set up to create Azure DevOps work items.
|
||||
|
||||
### Resources
|
||||
- [OneFuzz GitHub](https://github.com/microsoft/onefuzz)
|
||||
- [Getting started using OneFuzz](https://github.com/microsoft/onefuzz/blob/main/docs/getting-started.md)
|
||||
- [Releases Page](https://github.com/microsoft/onefuzz/releases)
|
||||
- [Notifications](https://github.com/microsoft/onefuzz/blob/main/docs/notifications.md)
|
||||
- [MS Teams](https://github.com/microsoft/onefuzz/blob/main/docs/notifications/teams.md)
|
||||
- [Azure DevOps](https://github.com/microsoft/onefuzz/blob/main/docs/notifications/ado.md)
|
||||
- [OSG Wiki - OneFuzz](https://www.osgwiki.com/wiki/Fuzzing_Service_-_Azure_Edge_and_Platform)
|
||||
@@ -140,12 +140,12 @@
|
||||
<!-- **END VC LIBS HACK** -->
|
||||
|
||||
<!-- This is required to get the package dependency in the AppXManifest. -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -147,13 +147,13 @@
|
||||
<!-- ========================= Globals ======================== -->
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
|
||||
@@ -80,13 +80,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.1" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -137,14 +137,14 @@
|
||||
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.1\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.1" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -97,14 +97,14 @@ OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text) :
|
||||
// Arguments:
|
||||
// - utf16Text - UTF-16 text range
|
||||
// - attribute - Color to apply over the entire range
|
||||
OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text, const TextAttribute& attribute, const size_t fillLimit) :
|
||||
OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text, const TextAttribute attribute) :
|
||||
_mode(Mode::Loose),
|
||||
_currentView(s_GenerateView(utf16Text, attribute)),
|
||||
_run(utf16Text),
|
||||
_attr(attribute),
|
||||
_distance(0),
|
||||
_pos(0),
|
||||
_fillLimit(fillLimit)
|
||||
_fillLimit(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
OutputCellIterator(const wchar_t& wch, const TextAttribute& attr, const size_t fillLimit = 0) noexcept;
|
||||
OutputCellIterator(const CHAR_INFO& charInfo, const size_t fillLimit = 0) noexcept;
|
||||
OutputCellIterator(const std::wstring_view utf16Text);
|
||||
OutputCellIterator(const std::wstring_view utf16Text, const TextAttribute& attribute, const size_t fillLimit = 0);
|
||||
OutputCellIterator(const std::wstring_view utf16Text, const TextAttribute attribute);
|
||||
OutputCellIterator(const gsl::span<const WORD> legacyAttributes) noexcept;
|
||||
OutputCellIterator(const gsl::span<const CHAR_INFO> charInfos) noexcept;
|
||||
OutputCellIterator(const gsl::span<const OutputCell> cells);
|
||||
|
||||
@@ -91,7 +91,7 @@ TextAttribute TextAttribute::StripErroneousVT16VersionsOfLegacyDefaults(const Te
|
||||
const auto bg{ attribute.GetBackground() };
|
||||
auto copy{ attribute };
|
||||
if (fg.IsIndex16() &&
|
||||
attribute.IsIntense() == WI_IsFlagSet(s_ansiDefaultForeground, FOREGROUND_INTENSITY) &&
|
||||
attribute.IsBold() == WI_IsFlagSet(s_ansiDefaultForeground, FOREGROUND_INTENSITY) &&
|
||||
fg.GetIndex() == (s_ansiDefaultForeground & ~FOREGROUND_INTENSITY))
|
||||
{
|
||||
// We don't want to turn 1;37m into 39m (or even 1;39m), as this was meant to mimic a legacy color.
|
||||
@@ -115,7 +115,7 @@ WORD TextAttribute::GetLegacyAttributes() const noexcept
|
||||
const BYTE fgIndex = _foreground.GetLegacyIndex(s_legacyDefaultForeground);
|
||||
const BYTE bgIndex = _background.GetLegacyIndex(s_legacyDefaultBackground);
|
||||
const WORD metaAttrs = _wAttrLegacy & META_ATTRS;
|
||||
const bool brighten = IsIntense() && _foreground.CanBeBrightened();
|
||||
const bool brighten = IsBold() && _foreground.CanBeBrightened();
|
||||
return fgIndex | (bgIndex << 4) | metaAttrs | (brighten ? FOREGROUND_INTENSITY : 0);
|
||||
}
|
||||
|
||||
@@ -255,9 +255,9 @@ void TextAttribute::SetRightVerticalDisplayed(const bool isDisplayed) noexcept
|
||||
WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_GRID_RVERTICAL, isDisplayed);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsIntense() const noexcept
|
||||
bool TextAttribute::IsBold() const noexcept
|
||||
{
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Intense);
|
||||
return WI_IsFlagSet(_extendedAttrs, ExtendedAttributes::Bold);
|
||||
}
|
||||
|
||||
bool TextAttribute::IsFaint() const noexcept
|
||||
@@ -305,9 +305,9 @@ bool TextAttribute::IsReverseVideo() const noexcept
|
||||
return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO);
|
||||
}
|
||||
|
||||
void TextAttribute::SetIntense(bool isIntense) noexcept
|
||||
void TextAttribute::SetBold(bool isBold) noexcept
|
||||
{
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Intense, isIntense);
|
||||
WI_UpdateFlag(_extendedAttrs, ExtendedAttributes::Bold, isBold);
|
||||
}
|
||||
|
||||
void TextAttribute::SetFaint(bool isFaint) noexcept
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
friend constexpr bool operator!=(const WORD& legacyAttr, const TextAttribute& attr) noexcept;
|
||||
|
||||
bool IsLegacy() const noexcept;
|
||||
bool IsIntense() const noexcept;
|
||||
bool IsBold() const noexcept;
|
||||
bool IsFaint() const noexcept;
|
||||
bool IsItalic() const noexcept;
|
||||
bool IsBlinking() const noexcept;
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
bool IsOverlined() const noexcept;
|
||||
bool IsReverseVideo() const noexcept;
|
||||
|
||||
void SetIntense(bool isIntense) noexcept;
|
||||
void SetBold(bool isBold) noexcept;
|
||||
void SetFaint(bool isFaint) noexcept;
|
||||
void SetItalic(bool isItalic) noexcept;
|
||||
void SetBlinking(bool isBlinking) noexcept;
|
||||
@@ -214,10 +214,10 @@ namespace WEX
|
||||
static WEX::Common::NoThrowString ToString(const TextAttribute& attr)
|
||||
{
|
||||
return WEX::Common::NoThrowString().Format(
|
||||
L"{FG:%s,BG:%s,intense:%d,wLegacy:(0x%04x),ext:(0x%02x)}",
|
||||
L"{FG:%s,BG:%s,bold:%d,wLegacy:(0x%04x),ext:(0x%02x)}",
|
||||
VerifyOutputTraits<TextColor>::ToString(attr._foreground).GetBuffer(),
|
||||
VerifyOutputTraits<TextColor>::ToString(attr._background).GetBuffer(),
|
||||
attr.IsIntense(),
|
||||
attr.IsBold(),
|
||||
attr._wAttrLegacy,
|
||||
static_cast<DWORD>(attr._extendedAttrs));
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ void TextColor::SetDefault() noexcept
|
||||
// - If brighten is true, and we've got a 16 color index in the "dark"
|
||||
// portion of the color table (indices [0,7]), then we'll look up the
|
||||
// bright version of this color (from indices [8,15]). This should be
|
||||
// true for TextAttributes that are "intense" and we're treating intense
|
||||
// as bright (which is the default behavior of most terminals.)
|
||||
// true for TextAttributes that are "Bold" and we're treating bold as
|
||||
// bright (which is the default behavior of most terminals.)
|
||||
// * If we're a default color, we'll return the default color provided.
|
||||
// Arguments:
|
||||
// - colorTable: The table of colors we should use to look up the value of
|
||||
|
||||
@@ -2034,8 +2034,20 @@ std::string TextBuffer::GenRTF(const TextAndColor& rows, const int fontHeightPoi
|
||||
const auto writeAccumulatedChars = [&](bool includeCurrent) {
|
||||
if (col >= startOffset)
|
||||
{
|
||||
const auto text = std::wstring_view{ rows.text.at(row) }.substr(startOffset, col - startOffset + includeCurrent);
|
||||
_AppendRTFText(contentBuilder, text);
|
||||
const auto unescapedText = ConvertToA(CP_UTF8, std::wstring_view(rows.text.at(row)).substr(startOffset, col - startOffset + includeCurrent));
|
||||
for (const auto c : unescapedText)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
case '{':
|
||||
case '}':
|
||||
contentBuilder << "\\" << c;
|
||||
break;
|
||||
default:
|
||||
contentBuilder << c;
|
||||
}
|
||||
}
|
||||
|
||||
startOffset = col;
|
||||
}
|
||||
@@ -2134,31 +2146,6 @@ std::string TextBuffer::GenRTF(const TextAndColor& rows, const int fontHeightPoi
|
||||
}
|
||||
}
|
||||
|
||||
void TextBuffer::_AppendRTFText(std::ostringstream& contentBuilder, const std::wstring_view& text)
|
||||
{
|
||||
for (const auto codeUnit : text)
|
||||
{
|
||||
if (codeUnit <= 127)
|
||||
{
|
||||
switch (codeUnit)
|
||||
{
|
||||
case L'\\':
|
||||
case L'{':
|
||||
case L'}':
|
||||
contentBuilder << "\\" << gsl::narrow<char>(codeUnit);
|
||||
break;
|
||||
default:
|
||||
contentBuilder << gsl::narrow<char>(codeUnit);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Windows uses unsigned wchar_t - RTF uses signed ones.
|
||||
contentBuilder << "\\u" << std::to_string(til::bit_cast<int16_t>(codeUnit)) << "?";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function Description:
|
||||
// - Reflow the contents from the old buffer into the new buffer. The new buffer
|
||||
// can have different dimensions than the old buffer. If it does, then this
|
||||
@@ -2197,8 +2184,7 @@ HRESULT TextBuffer::Reflow(TextBuffer& oldBuffer,
|
||||
bool foundOldVisible = false;
|
||||
HRESULT hr = S_OK;
|
||||
// Loop through all the rows of the old buffer and reprint them into the new buffer
|
||||
short iOldRow = 0;
|
||||
for (; iOldRow < cOldRowsTotal; iOldRow++)
|
||||
for (short iOldRow = 0; iOldRow < cOldRowsTotal; iOldRow++)
|
||||
{
|
||||
// Fetch the row and its "right" which is the last printable character.
|
||||
const ROW& row = oldBuffer.GetRowByOffset(iOldRow);
|
||||
@@ -2242,9 +2228,7 @@ HRESULT TextBuffer::Reflow(TextBuffer& oldBuffer,
|
||||
// Loop through every character in the current row (up to
|
||||
// the "right" boundary, which is one past the final valid
|
||||
// character)
|
||||
short iOldCol = 0;
|
||||
const auto copyRight = iRight;
|
||||
for (; iOldCol < copyRight; iOldCol++)
|
||||
for (short iOldCol = 0; iOldCol < iRight; iOldCol++)
|
||||
{
|
||||
if (iOldCol == cOldCursorPos.X && iOldRow == cOldCursorPos.Y)
|
||||
{
|
||||
@@ -2268,48 +2252,6 @@ HRESULT TextBuffer::Reflow(TextBuffer& oldBuffer,
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
// GH#32: Copy the attributes from the rest of the row into this new buffer.
|
||||
// From where we are in the old buffer, to the end of the row, copy the
|
||||
// remaining attributes.
|
||||
// - if the old buffer is smaller than the new buffer, then just copy
|
||||
// what we have, as it was. We already copied all _text_ with colors,
|
||||
// but it's possible for someone to just put some color into the
|
||||
// buffer to the right of that without any text (as just spaces). The
|
||||
// buffer looks weird to the user when we resize and it starts losing
|
||||
// those colors, so we need to copy them over too... as long as there
|
||||
// is space. The last attr in the row will be extended to the end of
|
||||
// the row in the new buffer.
|
||||
// - if the old buffer is WIDER, than we might have wrapped onto a new
|
||||
// line. Use the cursor's position's Y so that we know where the new
|
||||
// row is, and start writing at the cursor position. Again, the attr
|
||||
// in the last column of the old row will be extended to the end of the
|
||||
// row that the text was flowed onto.
|
||||
// - if the text in the old buffer didn't actually fill the whole
|
||||
// line in the new buffer, then we didn't wrap. That's fine. just
|
||||
// copy attributes from the old row till the end of the new row, and
|
||||
// move on.
|
||||
const auto newRowY = newCursor.GetPosition().Y;
|
||||
auto& newRow = newBuffer.GetRowByOffset(newRowY);
|
||||
auto newAttrColumn = newCursor.GetPosition().X;
|
||||
const auto newWidth = newBuffer.GetLineWidth(newRowY);
|
||||
// Stop when we get to the end of the buffer width, or the new position
|
||||
// for inserting an attr would be past the right of the new buffer.
|
||||
for (short copyAttrCol = iOldCol;
|
||||
copyAttrCol < cOldColsTotal && newAttrColumn < newWidth;
|
||||
copyAttrCol++, newAttrColumn++)
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO: MSFT: 19446208 - this should just use an iterator and the inserter...
|
||||
const auto textAttr = row.GetAttrRow().GetAttrByColumn(copyAttrCol);
|
||||
if (!newRow.GetAttrRow().SetAttrToEnd(newAttrColumn, textAttr))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
CATCH_LOG(); // Not worth dying over.
|
||||
}
|
||||
|
||||
// If we found the old row that the caller was interested in, set the
|
||||
// out value of that parameter to the cursor's current Y position (the
|
||||
// new location of the _end_ of that row in the buffer).
|
||||
@@ -2343,7 +2285,7 @@ HRESULT TextBuffer::Reflow(TextBuffer& oldBuffer,
|
||||
// only because we ran out of space.
|
||||
if (iRight < cOldColsTotal && !row.WasWrapForced())
|
||||
{
|
||||
if (!fFoundCursorPos && (iRight == cOldCursorPos.X && iOldRow == cOldCursorPos.Y))
|
||||
if (iRight == cOldCursorPos.X && iOldRow == cOldCursorPos.Y)
|
||||
{
|
||||
cNewCursorPos = newCursor.GetPosition();
|
||||
fFoundCursorPos = true;
|
||||
@@ -2394,34 +2336,6 @@ HRESULT TextBuffer::Reflow(TextBuffer& oldBuffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Finish copying buffer attributes to remaining rows below the last
|
||||
// printable character. This is to fix the `color 2f` scenario, where you
|
||||
// change the buffer colors then resize and everything below the last
|
||||
// printable char gets reset. See GH #12567
|
||||
auto newRowY = newCursor.GetPosition().Y + 1;
|
||||
const auto newHeight = newBuffer.GetSize().Height();
|
||||
const auto oldHeight = oldBuffer.GetSize().Height();
|
||||
for (;
|
||||
iOldRow < oldHeight && newRowY < newHeight;
|
||||
iOldRow++)
|
||||
{
|
||||
const ROW& row = oldBuffer.GetRowByOffset(iOldRow);
|
||||
|
||||
// Optimization: Since all these rows are below the last printable char,
|
||||
// we can reasonably assume that they are filled with just spaces.
|
||||
// That's convenient, we can just copy the attr row from the old buffer
|
||||
// into the new one, and resize the row to match. We'll rely on the
|
||||
// behavior of ATTR_ROW::Resize to trim down when narrower, or extend
|
||||
// the last attr when wider.
|
||||
auto& newRow = newBuffer.GetRowByOffset(newRowY);
|
||||
const auto newWidth = newBuffer.GetLineWidth(newRowY);
|
||||
newRow.GetAttrRow() = row.GetAttrRow();
|
||||
newRow.GetAttrRow().Resize(newWidth);
|
||||
|
||||
newRowY++;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
// Finish copying remaining parameters from the old text buffer to the new one
|
||||
|
||||
@@ -247,8 +247,6 @@ private:
|
||||
|
||||
void _PruneHyperlinks();
|
||||
|
||||
static void _AppendRTFText(std::ostringstream& contentBuilder, const std::wstring_view& text);
|
||||
|
||||
std::unordered_map<size_t, std::wstring> _idsAndPatterns;
|
||||
size_t _currentPatternId;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class TextAttributeTests
|
||||
TEST_METHOD(TestTextAttributeColorGetters);
|
||||
TEST_METHOD(TestReverseDefaultColors);
|
||||
TEST_METHOD(TestRoundtripDefaultColors);
|
||||
TEST_METHOD(TestIntenseAsBright);
|
||||
TEST_METHOD(TestBoldAsBright);
|
||||
|
||||
RenderSettings _renderSettings;
|
||||
const COLORREF _defaultFg = RGB(1, 2, 3);
|
||||
@@ -257,7 +257,7 @@ void TextAttributeTests::TestRoundtripDefaultColors()
|
||||
TextAttribute::SetLegacyDefaultAttributes(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
}
|
||||
|
||||
void TextAttributeTests::TestIntenseAsBright()
|
||||
void TextAttributeTests::TestBoldAsBright()
|
||||
{
|
||||
const auto& colorTable = _renderSettings.GetColorTable();
|
||||
const COLORREF darkBlack = til::at(colorTable, 0);
|
||||
@@ -267,8 +267,8 @@ void TextAttributeTests::TestIntenseAsBright()
|
||||
TextAttribute attr{};
|
||||
|
||||
// verify that calculated foreground/background are the same as the direct
|
||||
// values when not intense
|
||||
VERIFY_IS_FALSE(attr.IsIntense());
|
||||
// values when not bold
|
||||
VERIFY_IS_FALSE(attr.IsBold());
|
||||
|
||||
VERIFY_ARE_EQUAL(_defaultFg, attr.GetForeground().GetColor(colorTable, _defaultFgIndex));
|
||||
VERIFY_ARE_EQUAL(_defaultBg, attr.GetBackground().GetColor(colorTable, _defaultBgIndex));
|
||||
@@ -277,46 +277,46 @@ void TextAttributeTests::TestIntenseAsBright()
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(_defaultFg, _defaultBg), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
// with intense set, calculated foreground/background values shouldn't change for the default colors.
|
||||
attr.SetIntense(true);
|
||||
VERIFY_IS_TRUE(attr.IsIntense());
|
||||
// with bold set, calculated foreground/background values shouldn't change for the default colors.
|
||||
attr.SetBold(true);
|
||||
VERIFY_IS_TRUE(attr.IsBold());
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, true);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(_defaultFg, _defaultBg), _renderSettings.GetAttributeColors(attr));
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(_defaultFg, _defaultBg), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
attr.SetIndexedForeground(TextColor::DARK_BLACK);
|
||||
VERIFY_IS_TRUE(attr.IsIntense());
|
||||
VERIFY_IS_TRUE(attr.IsBold());
|
||||
|
||||
Log::Comment(L"Foreground should be bright black when intense is bright is enabled");
|
||||
Log::Comment(L"Foreground should be bright black when bold is bright is enabled");
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, true);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(brightBlack, _defaultBg), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
Log::Comment(L"Foreground should be dark black when intense is bright is disabled");
|
||||
Log::Comment(L"Foreground should be dark black when bold is bright is disabled");
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(darkBlack, _defaultBg), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
attr.SetIndexedBackground(TextColor::DARK_GREEN);
|
||||
VERIFY_IS_TRUE(attr.IsIntense());
|
||||
VERIFY_IS_TRUE(attr.IsBold());
|
||||
|
||||
Log::Comment(L"background should be unaffected by 'intense is bright'");
|
||||
Log::Comment(L"background should be unaffected by 'bold is bright'");
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, true);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(brightBlack, darkGreen), _renderSettings.GetAttributeColors(attr));
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(darkBlack, darkGreen), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
attr.SetIntense(false);
|
||||
VERIFY_IS_FALSE(attr.IsIntense());
|
||||
Log::Comment(L"when not intense, 'intense is bright' changes nothing");
|
||||
attr.SetBold(false);
|
||||
VERIFY_IS_FALSE(attr.IsBold());
|
||||
Log::Comment(L"when not bold, 'bold is bright' changes nothing");
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, true);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(darkBlack, darkGreen), _renderSettings.GetAttributeColors(attr));
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(darkBlack, darkGreen), _renderSettings.GetAttributeColors(attr));
|
||||
|
||||
Log::Comment(L"When set to a bright color, and intense, 'intense is bright' changes nothing");
|
||||
attr.SetIntense(true);
|
||||
Log::Comment(L"When set to a bright color, and bold, 'bold is bright' changes nothing");
|
||||
attr.SetBold(true);
|
||||
attr.SetIndexedForeground(TextColor::BRIGHT_BLACK);
|
||||
VERIFY_IS_TRUE(attr.IsIntense());
|
||||
VERIFY_IS_TRUE(attr.IsBold());
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, true);
|
||||
VERIFY_ARE_EQUAL(std::make_pair(brightBlack, darkGreen), _renderSettings.GetAttributeColors(attr));
|
||||
_renderSettings.SetRenderMode(RenderSettings::Mode::IntenseIsBright, false);
|
||||
|
||||
@@ -21,7 +21,6 @@ SOURCES = \
|
||||
|
||||
TARGETLIBS = \
|
||||
$(CONSOLE_OBJ_PATH)\buffer\out\lib\$(O)\ConBufferOut.lib \
|
||||
$(CONSOLE_OBJ_PATH)\renderer\base\lib\$(O)\ConRenderBase.lib \
|
||||
$(CONSOLE_OBJ_PATH)\types\lib\$(O)\ConTypes.lib \
|
||||
$(TARGETLIBS) \
|
||||
|
||||
|
||||
@@ -138,34 +138,36 @@
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- **BEGIN VC LIBS HACK** -->
|
||||
<!--
|
||||
Some of our dependencies still require a CRT, so we're going to ship the forwarders in our package and
|
||||
depend on the desktop CRT. This lets us unify the Windows 10 and Windows 11 builds around a common CRT.
|
||||
For our release builds, we're just going to integrate the UWPDesktop CRT into our package and delete the package dependencies.
|
||||
It's very difficult for users who do not have access to the store to get our dependency packages, and we want to be robust
|
||||
and deployable everywhere. Since these libraries can be redistributed, it's easiest if we simply redistribute them.
|
||||
See also the "VC LIBS HACK" section in WindowsTerminal.vcxproj.
|
||||
-->
|
||||
<!-- This target removes the FrameworkSdkReferences from before the AppX package targets manifest generation happens.
|
||||
This is part of the generic machinery that applies to every AppX. -->
|
||||
<Target Name="_OpenConsoleStripAllDependenciesFromPackageFirstManifest" BeforeTargets="_GenerateCurrentProjectAppxManifest">
|
||||
<ItemGroup>
|
||||
<FrameworkSdkReference Remove="@(FrameworkSdkReference)" Condition="'%(FrameworkSdkReference.SimpleName)'=='Microsoft.VCLibs'" />
|
||||
<FrameworkSdkPackage Remove="@(FrameworkSdkPackage)" Condition="'%(FrameworkSdkPackage.Name)'=='Microsoft.VCLibs.140.00' or '%(FrameworkSdkPackage.Name)'=='Microsoft.VCLibs.140.00.Debug'" />
|
||||
<ItemGroup Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
|
||||
<FrameworkSdkReference Remove="@(FrameworkSdkReference)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- This target removes the FrameworkSdkPackages from before the *desktop bridge* manifest generation happens. -->
|
||||
<Target Name="_OpenConsoleStripAllDependenciesFromPackageSecondManifest" BeforeTargets="_GenerateDesktopBridgeAppxManifest" DependsOnTargets="_ResolveVCLibDependencies">
|
||||
<ItemGroup>
|
||||
<FrameworkSdkReference Remove="@(FrameworkSdkReference)" Condition="'%(FrameworkSdkReference.SimpleName)'=='Microsoft.VCLibs'" />
|
||||
<FrameworkSdkPackage Remove="@(FrameworkSdkPackage)" Condition="'%(FrameworkSdkPackage.Name)'=='Microsoft.VCLibs.140.00' or '%(FrameworkSdkPackage.Name)'=='Microsoft.VCLibs.140.00.Debug'" />
|
||||
<ItemGroup Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
|
||||
<FrameworkSdkPackage Remove="@(FrameworkSdkPackage)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<!-- **END VC LIBS HACK** -->
|
||||
|
||||
<!-- This is required to get the package dependency in the AppXManifest. -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
</Target>
|
||||
|
||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
Version="0.0.1.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>ms-resource:AppStoreNameDev</DisplayName>
|
||||
<DisplayName>Windows Terminal Dev</DisplayName>
|
||||
<PublisherDisplayName>A Lone Developer</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -30,7 +30,7 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="EN-US" />
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -87,7 +87,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal-Dev"
|
||||
DisplayName="Terminal Dev"
|
||||
DisplayName="Windows Terminal Dev"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Version="0.5.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>ms-resource:AppStoreNamePre</DisplayName>
|
||||
<DisplayName>Windows Terminal Preview</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -31,95 +31,7 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="EN-US" />
|
||||
<Resource Language="EN-GB" />
|
||||
<Resource Language="AF-ZA" />
|
||||
<Resource Language="AM-ET" />
|
||||
<Resource Language="AR-SA" />
|
||||
<Resource Language="AS-IN" />
|
||||
<Resource Language="AZ-LATN-AZ" />
|
||||
<Resource Language="BG-BG" />
|
||||
<Resource Language="BN-IN" />
|
||||
<Resource Language="BS-LATN-BA" />
|
||||
<Resource Language="CA-ES" />
|
||||
<Resource Language="CA-ES-VALENCIA" />
|
||||
<Resource Language="CS-CZ" />
|
||||
<Resource Language="CY-GB" />
|
||||
<Resource Language="DA-DK" />
|
||||
<Resource Language="DE-DE" />
|
||||
<Resource Language="EL-GR" />
|
||||
<Resource Language="ES-ES" />
|
||||
<Resource Language="ES-MX" />
|
||||
<Resource Language="ET-EE" />
|
||||
<Resource Language="EU-ES" />
|
||||
<Resource Language="FA-IR" />
|
||||
<Resource Language="FI-FI" />
|
||||
<Resource Language="FIL-PH" />
|
||||
<Resource Language="FR-CA" />
|
||||
<Resource Language="FR-FR" />
|
||||
<Resource Language="GA-IE" />
|
||||
<Resource Language="GD-GB" />
|
||||
<Resource Language="GL-ES" />
|
||||
<Resource Language="GU-IN" />
|
||||
<Resource Language="HE-IL" />
|
||||
<Resource Language="HI-IN" />
|
||||
<Resource Language="HR-HR" />
|
||||
<Resource Language="HU-HU" />
|
||||
<Resource Language="HY-AM" />
|
||||
<Resource Language="ID-ID" />
|
||||
<Resource Language="IS-IS" />
|
||||
<Resource Language="IT-IT" />
|
||||
<Resource Language="JA-JP" />
|
||||
<Resource Language="KA-GE" />
|
||||
<Resource Language="KK-KZ" />
|
||||
<Resource Language="KM-KH" />
|
||||
<Resource Language="KN-IN" />
|
||||
<Resource Language="KO-KR" />
|
||||
<Resource Language="KOK-IN" />
|
||||
<Resource Language="LB-LU" />
|
||||
<Resource Language="LO-LA" />
|
||||
<Resource Language="LT-LT" />
|
||||
<Resource Language="LV-LV" />
|
||||
<Resource Language="MI-NZ" />
|
||||
<Resource Language="MK-MK" />
|
||||
<Resource Language="ML-IN" />
|
||||
<Resource Language="MR-IN" />
|
||||
<Resource Language="MS-MY" />
|
||||
<Resource Language="MT-MT" />
|
||||
<Resource Language="NB-NO" />
|
||||
<Resource Language="NE-NP" />
|
||||
<Resource Language="NL-NL" />
|
||||
<Resource Language="NN-NO" />
|
||||
<Resource Language="OR-IN" />
|
||||
<Resource Language="PA-IN" />
|
||||
<Resource Language="PL-PL" />
|
||||
<Resource Language="PT-BR" />
|
||||
<Resource Language="PT-PT" />
|
||||
<Resource Language="QPS-PLOC" />
|
||||
<Resource Language="QPS-PLOCA" />
|
||||
<Resource Language="QPS-PLOCM" />
|
||||
<Resource Language="QUZ-PE" />
|
||||
<Resource Language="RO-RO" />
|
||||
<Resource Language="RU-RU" />
|
||||
<Resource Language="SK-SK" />
|
||||
<Resource Language="SL-SI" />
|
||||
<Resource Language="SQ-AL" />
|
||||
<Resource Language="SR-CYRL-BA" />
|
||||
<Resource Language="SR-CYRL-RS" />
|
||||
<Resource Language="SR-LATN-RS" />
|
||||
<Resource Language="SV-SE" />
|
||||
<Resource Language="TA-IN" />
|
||||
<Resource Language="TE-IN" />
|
||||
<Resource Language="TH-TH" />
|
||||
<Resource Language="TR-TR" />
|
||||
<Resource Language="TT-RU" />
|
||||
<Resource Language="UG-CN" />
|
||||
<Resource Language="UK-UA" />
|
||||
<Resource Language="UR-PK" />
|
||||
<Resource Language="UZ-LATN-UZ" />
|
||||
<Resource Language="VI-VN" />
|
||||
<Resource Language="ZH-CN" />
|
||||
<Resource Language="ZH-TW" />
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -176,7 +88,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal-Pre"
|
||||
DisplayName="Terminal Preview"
|
||||
DisplayName="Windows Terminal Preview"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
@@ -235,9 +147,4 @@
|
||||
</uap7:SharedFonts>
|
||||
</uap7:Extension>
|
||||
</Extensions>
|
||||
|
||||
<mp:PhoneIdentity
|
||||
PhoneProductId="43878781-e1d0-4e2e-ae17-c4b63c8fb084"
|
||||
PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" />
|
||||
|
||||
</Package>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>ms-resource:AppStoreName</DisplayName>
|
||||
<DisplayName>Windows Terminal</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -31,95 +31,7 @@
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="EN-US" />
|
||||
<Resource Language="EN-GB" />
|
||||
<Resource Language="AF-ZA" />
|
||||
<Resource Language="AM-ET" />
|
||||
<Resource Language="AR-SA" />
|
||||
<Resource Language="AS-IN" />
|
||||
<Resource Language="AZ-LATN-AZ" />
|
||||
<Resource Language="BG-BG" />
|
||||
<Resource Language="BN-IN" />
|
||||
<Resource Language="BS-LATN-BA" />
|
||||
<Resource Language="CA-ES" />
|
||||
<Resource Language="CA-ES-VALENCIA" />
|
||||
<Resource Language="CS-CZ" />
|
||||
<Resource Language="CY-GB" />
|
||||
<Resource Language="DA-DK" />
|
||||
<Resource Language="DE-DE" />
|
||||
<Resource Language="EL-GR" />
|
||||
<Resource Language="ES-ES" />
|
||||
<Resource Language="ES-MX" />
|
||||
<Resource Language="ET-EE" />
|
||||
<Resource Language="EU-ES" />
|
||||
<Resource Language="FA-IR" />
|
||||
<Resource Language="FI-FI" />
|
||||
<Resource Language="FIL-PH" />
|
||||
<Resource Language="FR-CA" />
|
||||
<Resource Language="FR-FR" />
|
||||
<Resource Language="GA-IE" />
|
||||
<Resource Language="GD-GB" />
|
||||
<Resource Language="GL-ES" />
|
||||
<Resource Language="GU-IN" />
|
||||
<Resource Language="HE-IL" />
|
||||
<Resource Language="HI-IN" />
|
||||
<Resource Language="HR-HR" />
|
||||
<Resource Language="HU-HU" />
|
||||
<Resource Language="HY-AM" />
|
||||
<Resource Language="ID-ID" />
|
||||
<Resource Language="IS-IS" />
|
||||
<Resource Language="IT-IT" />
|
||||
<Resource Language="JA-JP" />
|
||||
<Resource Language="KA-GE" />
|
||||
<Resource Language="KK-KZ" />
|
||||
<Resource Language="KM-KH" />
|
||||
<Resource Language="KN-IN" />
|
||||
<Resource Language="KO-KR" />
|
||||
<Resource Language="KOK-IN" />
|
||||
<Resource Language="LB-LU" />
|
||||
<Resource Language="LO-LA" />
|
||||
<Resource Language="LT-LT" />
|
||||
<Resource Language="LV-LV" />
|
||||
<Resource Language="MI-NZ" />
|
||||
<Resource Language="MK-MK" />
|
||||
<Resource Language="ML-IN" />
|
||||
<Resource Language="MR-IN" />
|
||||
<Resource Language="MS-MY" />
|
||||
<Resource Language="MT-MT" />
|
||||
<Resource Language="NB-NO" />
|
||||
<Resource Language="NE-NP" />
|
||||
<Resource Language="NL-NL" />
|
||||
<Resource Language="NN-NO" />
|
||||
<Resource Language="OR-IN" />
|
||||
<Resource Language="PA-IN" />
|
||||
<Resource Language="PL-PL" />
|
||||
<Resource Language="PT-BR" />
|
||||
<Resource Language="PT-PT" />
|
||||
<Resource Language="QPS-PLOC" />
|
||||
<Resource Language="QPS-PLOCA" />
|
||||
<Resource Language="QPS-PLOCM" />
|
||||
<Resource Language="QUZ-PE" />
|
||||
<Resource Language="RO-RO" />
|
||||
<Resource Language="RU-RU" />
|
||||
<Resource Language="SK-SK" />
|
||||
<Resource Language="SL-SI" />
|
||||
<Resource Language="SQ-AL" />
|
||||
<Resource Language="SR-CYRL-BA" />
|
||||
<Resource Language="SR-CYRL-RS" />
|
||||
<Resource Language="SR-LATN-RS" />
|
||||
<Resource Language="SV-SE" />
|
||||
<Resource Language="TA-IN" />
|
||||
<Resource Language="TE-IN" />
|
||||
<Resource Language="TH-TH" />
|
||||
<Resource Language="TR-TR" />
|
||||
<Resource Language="TT-RU" />
|
||||
<Resource Language="UG-CN" />
|
||||
<Resource Language="UK-UA" />
|
||||
<Resource Language="UR-PK" />
|
||||
<Resource Language="UZ-LATN-UZ" />
|
||||
<Resource Language="VI-VN" />
|
||||
<Resource Language="ZH-CN" />
|
||||
<Resource Language="ZH-TW" />
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
@@ -176,7 +88,7 @@
|
||||
<uap3:Extension Category="windows.appExtension">
|
||||
<uap3:AppExtension Name="com.microsoft.windows.terminal.host"
|
||||
Id="Terminal"
|
||||
DisplayName="Terminal"
|
||||
DisplayName="Windows Terminal"
|
||||
Description="Terminal host built from microsoft/terminal open source repository"
|
||||
PublicFolder="Public">
|
||||
<uap3:Properties>
|
||||
@@ -235,9 +147,4 @@
|
||||
</uap7:SharedFonts>
|
||||
</uap7:Extension>
|
||||
</Extensions>
|
||||
|
||||
<mp:PhoneIdentity
|
||||
PhoneProductId="3a855625-ba50-46d5-b806-cb4520089c64"
|
||||
PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" />
|
||||
|
||||
</Package>
|
||||
|
||||
@@ -117,4 +117,22 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
<data name="AppName" xml:space="preserve">
|
||||
<value>Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppNameDev" xml:space="preserve">
|
||||
<value>Windows Terminal Dev</value>
|
||||
</data>
|
||||
<data name="AppNamePre" xml:space="preserve">
|
||||
<value>Windows Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppShortName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppShortNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
</data>
|
||||
<data name="AppShortNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -117,52 +117,13 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AppName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppStoreName" xml:space="preserve">
|
||||
<value>Windows Terminal</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppStoreNameDev" xml:space="preserve">
|
||||
<value>Windows Terminal Dev</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppStoreNamePre" xml:space="preserve">
|
||||
<value>Windows Terminal Preview</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppShortName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppShortNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppShortNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppDescription" xml:space="preserve">
|
||||
<value>The New Windows Terminal</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppDescriptionDev" xml:space="preserve">
|
||||
<value>The Windows Terminal, but Unofficial</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
<data name="AppDescriptionPre" xml:space="preserve">
|
||||
<value>Windows Terminal with a preview of upcoming features</value>
|
||||
<comment>{Locked}</comment>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
@@ -1983,7 +1983,7 @@ namespace SettingsModelLocalTests
|
||||
}
|
||||
}
|
||||
|
||||
// This test ensures GH#11597, GH#12520 don't regress.
|
||||
// This test ensures GH#11597 doesn't regress.
|
||||
void DeserializationTests::LoadFragmentsWithMultipleUpdates()
|
||||
{
|
||||
static constexpr std::wstring_view fragmentSource{ L"fragment" };
|
||||
@@ -1991,7 +1991,7 @@ namespace SettingsModelLocalTests
|
||||
"profiles": [
|
||||
{
|
||||
"updates": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"name": "NewName"
|
||||
"cursorShape": "filledBox"
|
||||
},
|
||||
{
|
||||
"updates": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
@@ -2011,7 +2011,5 @@ namespace SettingsModelLocalTests
|
||||
|
||||
VERIFY_IS_FALSE(loader.duplicateProfile);
|
||||
VERIFY_ARE_EQUAL(3u, loader.userSettings.profiles.size());
|
||||
// GH#12520: Fragments should be able to override the name of builtin profiles.
|
||||
VERIFY_ARE_EQUAL(L"NewName", loader.userSettings.profiles[0]->Name());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(LayerProfilesOnArray);
|
||||
TEST_METHOD(DuplicateProfileTest);
|
||||
TEST_METHOD(TestGenGuidsForProfiles);
|
||||
|
||||
TEST_METHOD(TestCorrectOldDefaultShellPaths);
|
||||
};
|
||||
|
||||
@@ -366,43 +367,31 @@ namespace SettingsModelLocalTests
|
||||
]
|
||||
})" };
|
||||
static constexpr std::string_view userProfiles{ R"({
|
||||
"profiles": {
|
||||
"defaults":
|
||||
"profiles": [
|
||||
{
|
||||
"commandline": "pwsh.exe"
|
||||
"name" : "powershell 1",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
"list":
|
||||
[
|
||||
{
|
||||
"name" : "powershell 1",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
{
|
||||
"name" : "powershell 2",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-0000-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 1",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 2",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-0000-5f56-a8ff-afceeeaa6101}"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"name" : "powershell 2",
|
||||
"commandline": "powershell.exe",
|
||||
"guid" : "{61c54bbd-0000-5271-96e7-009a87ff44bf}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 1",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
|
||||
},
|
||||
{
|
||||
"name" : "cmd 2",
|
||||
"commandline": "cmd.exe",
|
||||
"guid" : "{0caa0dad-0000-5f56-a8ff-afceeeaa6101}"
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
implementation::SettingsLoader loader{ userProfiles, inboxProfiles };
|
||||
loader.MergeInboxIntoUserSettings();
|
||||
loader.FinalizeLayering();
|
||||
loader.FixupUserSettings();
|
||||
|
||||
const auto settings = winrt::make_self<implementation::CascadiaSettings>(std::move(loader));
|
||||
const auto settings = winrt::make_self<implementation::CascadiaSettings>(userProfiles, inboxProfiles);
|
||||
const auto allProfiles = settings->AllProfiles();
|
||||
VERIFY_ARE_EQUAL(4u, allProfiles.Size());
|
||||
VERIFY_ARE_EQUAL(L"powershell 1", allProfiles.GetAt(0).Name());
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
If you don't have this, then you'll see an error like
|
||||
"(init.obj) : error LNK2005: DllMain already defined in MSVCRTD.lib(dll_dllmain_stub.obj)"
|
||||
-->
|
||||
<AdditionalOptions Condition="'$(Platform)'=='Win32'">%(AdditionalOptions) /INCLUDE:_DllMain@12</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Platform)'!='Win32'">%(AdditionalOptions) /INCLUDE:DllMain</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Platform)'=='Win32'">/INCLUDE:_DllMain@12</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Platform)'!='Win32'">/INCLUDE:DllMain</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -99,10 +99,10 @@
|
||||
<!-- From Microsoft.UI.Xaml.targets -->
|
||||
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
||||
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- We actually can just straight up reference MUX here, it's fine -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -38,7 +38,6 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(TryCreateWinRTType);
|
||||
TEST_METHOD(TestTerminalArgsForBinding);
|
||||
TEST_METHOD(CommandLineToArgvW);
|
||||
TEST_METHOD(NormalizeCommandLine);
|
||||
TEST_METHOD(GetProfileForArgsWithCommandline);
|
||||
TEST_METHOD(MakeSettingsForProfile);
|
||||
TEST_METHOD(MakeSettingsForDefaultProfileThatDoesntExist);
|
||||
@@ -85,8 +84,7 @@ namespace SettingsModelLocalTests
|
||||
for (int i = 0; i < expectedArgc; ++i)
|
||||
{
|
||||
const bool useQuotes = static_cast<bool>(rng(2));
|
||||
// We need to ensure there is at least one character
|
||||
const auto count = static_cast<size_t>(rng(64) + 1);
|
||||
const auto count = static_cast<size_t>(rng(64));
|
||||
const auto ch = static_cast<wchar_t>(rng('z' - 'a' + 1) + 'a');
|
||||
|
||||
if (i != 0)
|
||||
@@ -108,7 +106,6 @@ namespace SettingsModelLocalTests
|
||||
input.push_back(L'"');
|
||||
}
|
||||
}
|
||||
Log::Comment(NoThrowString().Format(input.c_str()));
|
||||
|
||||
int argc;
|
||||
wil::unique_hlocal_ptr<PWSTR[]> argv{ ::CommandLineToArgvW(input.c_str(), &argc) };
|
||||
@@ -123,67 +120,6 @@ namespace SettingsModelLocalTests
|
||||
VERIFY_ARE_EQUAL(0, memcmp(beg, expectedArgv.data(), expectedArgv.size()));
|
||||
}
|
||||
|
||||
// This unit test covers GH#12345.
|
||||
// * paths with more than 1 whitespace
|
||||
// * paths sharing a common prefix with another directory
|
||||
void TerminalSettingsTests::NormalizeCommandLine()
|
||||
{
|
||||
using namespace std::string_literals;
|
||||
|
||||
static constexpr auto touch = [](const auto& path) {
|
||||
std::ofstream file{ path };
|
||||
};
|
||||
|
||||
std::wstring guid;
|
||||
{
|
||||
GUID g{};
|
||||
THROW_IF_FAILED(CoCreateGuid(&g));
|
||||
guid = fmt::format(
|
||||
L"{:08x}-{:04x}-{:04x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
|
||||
g.Data1,
|
||||
g.Data2,
|
||||
g.Data3,
|
||||
g.Data4[0],
|
||||
g.Data4[1],
|
||||
g.Data4[2],
|
||||
g.Data4[3],
|
||||
g.Data4[4],
|
||||
g.Data4[5],
|
||||
g.Data4[6],
|
||||
g.Data4[7]);
|
||||
}
|
||||
|
||||
const auto tmpdir = std::filesystem::temp_directory_path();
|
||||
const auto dir1 = tmpdir / guid;
|
||||
const auto dir2 = tmpdir / (guid + L" two");
|
||||
const auto file1 = dir1 / L"file 1.exe";
|
||||
const auto file2 = dir2 / L"file 2.exe";
|
||||
|
||||
const auto cleanup = wil::scope_exit([&]() {
|
||||
std::error_code ec;
|
||||
remove_all(dir1, ec);
|
||||
remove_all(dir2, ec);
|
||||
});
|
||||
|
||||
create_directory(dir1);
|
||||
create_directory(dir2);
|
||||
touch(file1);
|
||||
touch(file2);
|
||||
|
||||
{
|
||||
const auto commandLine = file2.native() + LR"( -foo "bar1 bar2" -baz)"s;
|
||||
const auto expected = file2.native() + L"\0-foo\0bar1 bar2\0-baz"s;
|
||||
const auto actual = implementation::CascadiaSettings::NormalizeCommandLine(commandLine.c_str());
|
||||
VERIFY_ARE_EQUAL(expected, actual);
|
||||
}
|
||||
{
|
||||
const auto commandLine = L"C:\\";
|
||||
const auto expected = L"C:\\";
|
||||
const auto actual = implementation::CascadiaSettings::NormalizeCommandLine(commandLine);
|
||||
VERIFY_ARE_EQUAL(expected, actual);
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalSettingsTests::GetProfileForArgsWithCommandline()
|
||||
{
|
||||
// I'm exclusively using cmd.exe as I know exactly where it resides at.
|
||||
@@ -209,10 +145,6 @@ namespace SettingsModelLocalTests
|
||||
"guid": "{6239a42c-3333-49a3-80bd-e8fdd045185c}",
|
||||
"commandline": "cmd.exe /A /C",
|
||||
"connectionType": "{9a9977a7-1fe0-49c0-b6c0-13a0cd1c98a1}"
|
||||
},
|
||||
{
|
||||
"guid": "{6239a42c-4444-49a3-80bd-e8fdd045185c}",
|
||||
"commandline": "C:\\invalid.exe",
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -231,7 +163,7 @@ namespace SettingsModelLocalTests
|
||||
TestCase{ L"cmd.exe", 0 },
|
||||
// SearchPathW() normalization + case insensitive matching.
|
||||
TestCase{ L"cmd.exe /a", 1 },
|
||||
TestCase{ L"%SystemRoot%\\System32\\cmd.exe /A", 1 },
|
||||
TestCase{ L"C:\\Windows\\System32\\cmd.exe /A", 1 },
|
||||
// Test that we don't pick the equally long but different "/A /B" variant.
|
||||
TestCase{ L"C:\\Windows\\System32\\cmd.exe /A /C", 1 },
|
||||
// Test that we don't pick the shorter "/A" variant,
|
||||
@@ -241,9 +173,6 @@ namespace SettingsModelLocalTests
|
||||
// Ignore profiles with a connection type, like the Azure cloud shell.
|
||||
// Instead it should pick any other prefix.
|
||||
TestCase{ L"C:\\Windows\\System32\\cmd.exe /A /C", 1 },
|
||||
// Failure to normalize a path (e.g. because the path doesn't exist)
|
||||
// should yield the unmodified input string (see NormalizeCommandLine).
|
||||
TestCase{ L"C:\\invalid.exe /A /B", 4 },
|
||||
// Return base layer profile for missing profiles.
|
||||
TestCase{ L"C:\\Windows\\regedit.exe", -1 },
|
||||
};
|
||||
|
||||
@@ -92,11 +92,11 @@
|
||||
<!-- From Microsoft.UI.Xaml.targets -->
|
||||
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
||||
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- We actually can just straight up reference MUX here, it's fine -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
|
||||
<Import Project="$(OpenConsoleDir)\src\common.build.post.props" />
|
||||
|
||||
|
||||
@@ -353,14 +353,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
// - <none>
|
||||
void Monarch::HandleActivatePeasant(const Remoting::WindowActivatedArgs& args)
|
||||
{
|
||||
if (args == nullptr)
|
||||
{
|
||||
// MSFT:35731327, GH #12624. There's a chance that the way the
|
||||
// window gets set up for defterm, the ActivatedArgs haven't been
|
||||
// created for this window yet. Check here and just ignore them if
|
||||
// they're null. They'll come back with real args soon
|
||||
return;
|
||||
}
|
||||
// Start by making a local copy of these args. It's easier for us if our
|
||||
// tracking of these args is all in-proc. That way, the only thing that
|
||||
// could fail due to the peasant dying is _this first copy_.
|
||||
@@ -426,9 +418,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
// - <none>
|
||||
void Monarch::_doHandleActivatePeasant(const winrt::com_ptr<implementation::WindowActivatedArgs>& localArgs)
|
||||
{
|
||||
// We're sure that localArgs isn't null here, we checked before in our
|
||||
// one caller (in Monarch::HandleActivatePeasant)
|
||||
|
||||
const auto newLastActiveTime = localArgs->ActivatedTime().time_since_epoch().count();
|
||||
|
||||
// * Check all the current lists to look for this peasant.
|
||||
|
||||
@@ -27,7 +27,7 @@ constexpr GUID Monarch_clsid
|
||||
0x7eb1,
|
||||
0x4f3e,
|
||||
{
|
||||
0x85, 0xf5, 0x8b, 0xdd, 0x73, 0x86, 0xcc, 0xe4
|
||||
0x85, 0xf5, 0x8b, 0xdd, 0x73, 0x86, 0xcc, 0xe3
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace Microsoft.Terminal.Remoting
|
||||
String TabTitle;
|
||||
};
|
||||
|
||||
interface IMonarch
|
||||
{
|
||||
[default_interface] runtimeclass Monarch {
|
||||
Monarch();
|
||||
|
||||
UInt64 GetPID();
|
||||
UInt64 AddPeasant(IPeasant peasant);
|
||||
@@ -67,9 +67,4 @@ namespace Microsoft.Terminal.Remoting
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> WindowClosed;
|
||||
event Windows.Foundation.TypedEventHandler<Object, QuitAllRequestedArgs> QuitAllRequested;
|
||||
};
|
||||
|
||||
runtimeclass Monarch : [default] IMonarch
|
||||
{
|
||||
Monarch();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,11 +25,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
struct ProposeCommandlineResult : public ProposeCommandlineResultT<ProposeCommandlineResult>
|
||||
{
|
||||
public:
|
||||
ProposeCommandlineResult(const Remoting::ProposeCommandlineResult& other) :
|
||||
_Id{ other.Id() },
|
||||
_WindowName{ other.WindowName() },
|
||||
_ShouldCreateWindow{ other.ShouldCreateWindow() } {};
|
||||
|
||||
WINRT_PROPERTY(Windows::Foundation::IReference<uint64_t>, Id);
|
||||
WINRT_PROPERTY(winrt::hstring, WindowName);
|
||||
WINRT_PROPERTY(bool, ShouldCreateWindow, true);
|
||||
|
||||
@@ -6,11 +6,7 @@ Class Name:
|
||||
- SummonWindowBehavior.h
|
||||
|
||||
Abstract:
|
||||
- This is a helper class for encapsulating all the information about how a
|
||||
window should be summoned. Includes info like if we should switch desktops or
|
||||
monitors, if we should dropdown (and how fast), and if we should toggle to
|
||||
hidden if we're already visible. Used by the Monarch to tell a Peasant how it
|
||||
should behave.
|
||||
- TODO!
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "CommandlineArgs.h"
|
||||
#include "../inc/WindowingBehavior.h"
|
||||
#include "FindTargetWindowArgs.h"
|
||||
#include "ProposeCommandlineResult.h"
|
||||
|
||||
#include "WindowManager.g.cpp"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
@@ -78,153 +77,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManager::_proposeToMonarch(const Remoting::CommandlineArgs& args,
|
||||
std::optional<uint64_t>& givenID,
|
||||
winrt::hstring& givenName)
|
||||
{
|
||||
// these two errors are Win32 errors, convert them to HRESULTS so we can actually compare below.
|
||||
static constexpr HRESULT RPC_SERVER_UNAVAILABLE_HR = HRESULT_FROM_WIN32(RPC_S_SERVER_UNAVAILABLE);
|
||||
static constexpr HRESULT RPC_CALL_FAILED_HR = HRESULT_FROM_WIN32(RPC_S_CALL_FAILED);
|
||||
|
||||
// The monarch may respond back "you should be a new
|
||||
// window, with ID,name of (id, name)". Really the responses are:
|
||||
// * You should not create a new window
|
||||
// * Create a new window (but without a given ID or name). The
|
||||
// Monarch will assign your ID/name later
|
||||
// * Create a new window, and you'll have this ID or name
|
||||
// - This is the case where the user provides `wt -w 1`, and
|
||||
// there's no existing window 1
|
||||
|
||||
// You can emulate the monarch dying by: starting a terminal, sticking a
|
||||
// breakpoint in
|
||||
// TerminalApp!winrt::TerminalApp::implementation::AppLogic::_doFindTargetWindow,
|
||||
// starting a defterm, and when that BP gets hit, kill the original
|
||||
// monarch, and see what happens here.
|
||||
|
||||
bool proposedCommandline = false;
|
||||
Remoting::ProposeCommandlineResult result{ nullptr };
|
||||
while (!proposedCommandline)
|
||||
{
|
||||
try
|
||||
{
|
||||
// MSFT:38542548 _We believe_ that this is the source of the
|
||||
// crash here. After we get the result, stash it's values into a
|
||||
// local copy, so that we can check them later. If the Monarch
|
||||
// dies between now and the inspection of
|
||||
// `result.ShouldCreateWindow` below, we don't want to explode
|
||||
// (since _proposeToMonarch is not try/caught).
|
||||
Remoting::ProposeCommandlineResult outOfProcResult = _monarch.ProposeCommandline(args);
|
||||
result = winrt::make<implementation::ProposeCommandlineResult>(outOfProcResult);
|
||||
|
||||
proposedCommandline = true;
|
||||
}
|
||||
catch (const winrt::hresult_error& e)
|
||||
{
|
||||
// We did not successfully ask the king what to do. They
|
||||
// hopefully just died here. That's okay, let's just go ask the
|
||||
// next in the line of succession. At the very worst, we'll find
|
||||
// _us_, (likely last in the line).
|
||||
//
|
||||
// If the king returned some _other_ error here, than lets
|
||||
// bubble that up because that's a real issue.
|
||||
//
|
||||
// I'm checking both these here. I had previously got a
|
||||
// RPC_S_CALL_FAILED about here once.
|
||||
if (e.code() == RPC_SERVER_UNAVAILABLE_HR || e.code() == RPC_CALL_FAILED_HR)
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_proposeToMonarch_kingDied",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
// We failed to ask the monarch. It must have died. Try and
|
||||
// find the real monarch. Don't perform an election, that
|
||||
// assumes we have a peasant, which we don't yet.
|
||||
_createMonarchAndCallbacks();
|
||||
// _createMonarchAndCallbacks will initialize _isKing
|
||||
if (_isKing)
|
||||
{
|
||||
// We became the king. We don't need to ProposeCommandline to ourself, we're just
|
||||
// going to do it.
|
||||
//
|
||||
// Return early, because there's nothing else for us to do here.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_proposeToMonarch_becameKing",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
// In WindowManager::ProposeCommandline, had we been the
|
||||
// king originally, we would have started by setting
|
||||
// this to true. We became the monarch here, so set it
|
||||
// here as well.
|
||||
_shouldCreateWindow = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Here, we created the new monarch, it wasn't us, so we're
|
||||
// gonna go through the while loop again and ask the new
|
||||
// king.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_proposeToMonarch_tryAgain",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_proposeToMonarch_unexpectedResultFromKing",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
LOG_CAUGHT_EXCEPTION();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// If the monarch (maybe us) failed for _any other reason_ than
|
||||
// them dying. This IS quite unexpected. Let this bubble out.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_proposeToMonarch_unexpectedExceptionFromKing",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
LOG_CAUGHT_EXCEPTION();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// Here, the monarch (not us) has replied to the message. Get the
|
||||
// valuables out of the response:
|
||||
_shouldCreateWindow = result.ShouldCreateWindow();
|
||||
if (result.Id())
|
||||
{
|
||||
givenID = result.Id().Value();
|
||||
}
|
||||
givenName = result.WindowName();
|
||||
|
||||
// TraceLogging doesn't have a good solution for logging an
|
||||
// optional. So we have to repeat the calls here:
|
||||
if (givenID)
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_ProposeCommandline",
|
||||
TraceLoggingBoolean(_shouldCreateWindow, "CreateWindow", "true iff we should create a new window"),
|
||||
TraceLoggingUInt64(givenID.value(), "Id", "The ID we should assign our peasant"),
|
||||
TraceLoggingWideString(givenName.c_str(), "Name", "The name we should assign this window"),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_ProposeCommandline",
|
||||
TraceLoggingBoolean(_shouldCreateWindow, "CreateWindow", "true iff we should create a new window"),
|
||||
TraceLoggingPointer(nullptr, "Id", "No ID provided"),
|
||||
TraceLoggingWideString(givenName.c_str(), "Name", "The name we should assign this window"),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
}
|
||||
}
|
||||
void WindowManager::ProposeCommandline(const Remoting::CommandlineArgs& args)
|
||||
{
|
||||
// If we're the king, we _definitely_ want to process the arguments, we were
|
||||
@@ -236,11 +88,46 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
winrt::hstring givenName{};
|
||||
if (!_isKing)
|
||||
{
|
||||
_proposeToMonarch(args, givenID, givenName);
|
||||
}
|
||||
// The monarch may respond back "you should be a new
|
||||
// window, with ID,name of (id, name)". Really the responses are:
|
||||
// * You should not create a new window
|
||||
// * Create a new window (but without a given ID or name). The
|
||||
// Monarch will assign your ID/name later
|
||||
// * Create a new window, and you'll have this ID or name
|
||||
// - This is the case where the user provides `wt -w 1`, and
|
||||
// there's no existing window 1
|
||||
|
||||
// During _proposeToMonarch, it's possible that we found that the king was dead, and we're the new king. Cool! Do this now.
|
||||
if (_isKing)
|
||||
const auto result = _monarch.ProposeCommandline(args);
|
||||
_shouldCreateWindow = result.ShouldCreateWindow();
|
||||
if (result.Id())
|
||||
{
|
||||
givenID = result.Id().Value();
|
||||
}
|
||||
givenName = result.WindowName();
|
||||
// TraceLogging doesn't have a good solution for logging an
|
||||
// optional. So we have to repeat the calls here:
|
||||
if (givenID)
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_ProposeCommandline",
|
||||
TraceLoggingBoolean(_shouldCreateWindow, "CreateWindow", "true iff we should create a new window"),
|
||||
TraceLoggingUInt64(givenID.value(), "Id", "The ID we should assign our peasant"),
|
||||
TraceLoggingWideString(givenName.c_str(), "Name", "The name we should assign this window"),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_ProposeCommandline",
|
||||
TraceLoggingBoolean(_shouldCreateWindow, "CreateWindow", "true iff we should create a new window"),
|
||||
TraceLoggingPointer(nullptr, "Id", "No ID provided"),
|
||||
TraceLoggingWideString(givenName.c_str(), "Name", "The name we should assign this window"),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're the monarch, we don't need to propose anything. We're just
|
||||
// going to do it.
|
||||
@@ -308,10 +195,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
_createPeasantThread();
|
||||
}
|
||||
|
||||
// This right here will just tell us to stash the args away for the
|
||||
// future. The AppHost hasnt yet set up the callbacks, and the rest
|
||||
// of the app hasn't started at all. We'll note them and come back
|
||||
// later.
|
||||
_peasant.ExecuteCommandline(args);
|
||||
}
|
||||
// Otherwise, we'll do _nothing_.
|
||||
@@ -341,8 +224,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
//
|
||||
// * If we're running unpackaged: the .winmd must be a sibling of the .exe
|
||||
// * If we're running packaged: the .winmd must be in the package root
|
||||
_monarch = create_instance<Remoting::IMonarch>(Monarch_clsid,
|
||||
CLSCTX_LOCAL_SERVER);
|
||||
_monarch = create_instance<Remoting::Monarch>(Monarch_clsid,
|
||||
CLSCTX_LOCAL_SERVER);
|
||||
}
|
||||
|
||||
// NOTE: This can throw! Callers include:
|
||||
@@ -356,52 +239,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
void WindowManager::_createMonarchAndCallbacks()
|
||||
{
|
||||
_createMonarch();
|
||||
|
||||
if (_monarch == nullptr)
|
||||
{
|
||||
// See MSFT:38540483, GH#12774 for details.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_NullMonarchTryAgain",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
// Here we're gonna just give it a quick second try.Probably not
|
||||
// definitive, but might help.
|
||||
_createMonarch();
|
||||
}
|
||||
|
||||
if (_monarch == nullptr)
|
||||
{
|
||||
// See MSFT:38540483, GH#12774 for details.
|
||||
if constexpr (Feature_IsolatedMonarchMode::IsEnabled())
|
||||
{
|
||||
// Fall back to having a in proc monarch. Were now isolated from
|
||||
// other windows. This is a pretty torn state, but at least we
|
||||
// didn't just explode.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_NullMonarchIsolateMode",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
_monarch = winrt::make<winrt::Microsoft::Terminal::Remoting::implementation::Monarch>();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The monarch is null. We're hoping that we can find another,
|
||||
// hopefully us. We're gonna go back around the loop again and
|
||||
// see what happens. If this is really an infinite loop (where
|
||||
// the OS won't even give us back US as the monarch), then I
|
||||
// suppose we'll find out soon enough.
|
||||
TraceLoggingWrite(g_hRemotingProvider,
|
||||
"WindowManager_NullMonarchTryAgain",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
winrt::hresult_error(E_UNEXPECTED, L"Did not expect the Monarch to ever be null");
|
||||
}
|
||||
}
|
||||
|
||||
// We're pretty confident that we have a Monarch here.
|
||||
|
||||
// Save the result of checking if we're the king. We want to avoid
|
||||
// unnecessary calls back and forth if we can.
|
||||
_isKing = _areWeTheKing();
|
||||
@@ -415,11 +252,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
|
||||
if (_peasant)
|
||||
{
|
||||
if (const auto& lastActivated{ _peasant.GetLastActivatedArgs() })
|
||||
{
|
||||
// Inform the monarch of the time we were last activated
|
||||
_monarch.HandleActivatePeasant(lastActivated);
|
||||
}
|
||||
// Inform the monarch of the time we were last activated
|
||||
_monarch.HandleActivatePeasant(_peasant.GetLastActivatedArgs());
|
||||
}
|
||||
|
||||
if (!_isKing)
|
||||
@@ -705,7 +539,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
|
||||
void WindowManager::SummonAllWindows()
|
||||
{
|
||||
_monarch.SummonAllWindows();
|
||||
if constexpr (Feature_NotificationIcon::IsEnabled())
|
||||
{
|
||||
_monarch.SummonAllWindows();
|
||||
}
|
||||
}
|
||||
|
||||
Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Terminal::Remoting::PeasantInfo> WindowManager::GetPeasantInfos()
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
bool _shouldCreateWindow{ false };
|
||||
bool _isKing{ false };
|
||||
DWORD _registrationHostClass{ 0 };
|
||||
winrt::Microsoft::Terminal::Remoting::IMonarch _monarch{ nullptr };
|
||||
winrt::Microsoft::Terminal::Remoting::Monarch _monarch{ nullptr };
|
||||
winrt::Microsoft::Terminal::Remoting::Peasant _peasant{ nullptr };
|
||||
|
||||
wil::unique_event _monarchWaitInterrupt;
|
||||
@@ -82,10 +82,6 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
void _waitOnMonarchThread();
|
||||
void _raiseFindTargetWindowRequested(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs& args);
|
||||
|
||||
void _proposeToMonarch(const Remoting::CommandlineArgs& args,
|
||||
std::optional<uint64_t>& givenID,
|
||||
winrt::hstring& givenName);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
<package id="Microsoft.PGO-Helpers.Cpp" version="0.2.22" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -70,14 +70,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// Apply the reverts in reverse order - If we had multiple previews
|
||||
// stacked on top of each other, then this will ensure the first one in
|
||||
// is the last one out.
|
||||
const auto cleanup = wil::scope_exit([this]() {
|
||||
_restorePreviewFuncs.clear();
|
||||
});
|
||||
|
||||
for (const auto& f : _restorePreviewFuncs)
|
||||
for (auto i{ _restorePreviewFuncs.rbegin() }; i < _restorePreviewFuncs.rend(); i++)
|
||||
{
|
||||
auto f = *i;
|
||||
f();
|
||||
}
|
||||
_restorePreviewFuncs.clear();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -96,8 +94,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (const auto& scheme{ _settings.GlobalSettings().ColorSchemes().TryLookup(args.SchemeName()) })
|
||||
{
|
||||
const auto backup = _restorePreviewFuncs.empty();
|
||||
|
||||
_ApplyToActiveControls([&](const auto& control) {
|
||||
// Stash a copy of the current scheme.
|
||||
auto originalScheme{ control.ColorScheme() };
|
||||
@@ -105,38 +101,34 @@ namespace winrt::TerminalApp::implementation
|
||||
// Apply the new scheme.
|
||||
control.ColorScheme(scheme.ToCoreScheme());
|
||||
|
||||
if (backup)
|
||||
{
|
||||
// Each control will emplace a revert into the
|
||||
// _restorePreviewFuncs for itself.
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
// On dismiss, restore the original scheme.
|
||||
control.ColorScheme(originalScheme);
|
||||
});
|
||||
}
|
||||
// Each control will emplace a revert into the
|
||||
// _restorePreviewFuncs for itself.
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
// On dismiss, restore the original scheme.
|
||||
control.ColorScheme(originalScheme);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalPage::_PreviewAdjustOpacity(const Settings::Model::AdjustOpacityArgs& args)
|
||||
{
|
||||
const auto backup = _restorePreviewFuncs.empty();
|
||||
// Clear the saved preview funcs because we don't need to add a restore each time
|
||||
// the preview changes, we only need to be able to restore the last one.
|
||||
_restorePreviewFuncs.clear();
|
||||
|
||||
_ApplyToActiveControls([&](const auto& control) {
|
||||
// Stash a copy of the original opacity.
|
||||
auto originalOpacity{ control.BackgroundOpacity() };
|
||||
|
||||
// Apply the new opacity
|
||||
control.AdjustOpacity(args.Opacity() / 100.0, args.Relative());
|
||||
control.AdjustOpacity(args.Opacity(), args.Relative());
|
||||
|
||||
if (backup)
|
||||
{
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
// On dismiss:
|
||||
// Don't adjust relatively, just set outright.
|
||||
control.AdjustOpacity(originalOpacity, false);
|
||||
});
|
||||
}
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
// On dismiss:
|
||||
// Don't adjust relatively, just set outright.
|
||||
control.AdjustOpacity(::base::saturated_cast<int>(originalOpacity * 100), false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!-- Include the MUX Controls resources -->
|
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
|
||||
ControlsResourcesVersion="Version2" />
|
||||
ControlsResourcesVersion="Version1" />
|
||||
<ResourceDictionary>
|
||||
|
||||
<!--
|
||||
@@ -46,143 +46,28 @@
|
||||
Color="{ThemeResource SystemErrorTextColor}" />
|
||||
|
||||
<!-- Suppress top padding -->
|
||||
<Thickness x:Key="TabViewHeaderPadding">9,0,5,0</Thickness>
|
||||
<Thickness x:Key="TabViewHeaderPadding">9,0,8,0</Thickness>
|
||||
|
||||
<!-- Shadow that can be used by any control. -->
|
||||
<ThemeShadow x:Name="SharedShadow" />
|
||||
|
||||
<!-- Colored button which changes on hover/press -->
|
||||
<Style x:Key="ColorButtonStyle"
|
||||
TargetType="Button">
|
||||
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
|
||||
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
|
||||
<Setter Property="FocusVisualMargin" Value="-3" />
|
||||
<Setter Property="Width" Value="32" />
|
||||
<Setter Property="Height" Value="32" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Border x:Name="ColorButtonBackground"
|
||||
Background="{TemplateBinding Background}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="Opacity">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="0.9" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ButtonBorderBrushPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="Opacity">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="0.8" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ButtonBorderBrushPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ButtonBackgroundDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ButtonBorderBrushDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- Remove when implementing WinUI 2.6 -->
|
||||
<Thickness x:Key="FlyoutContentPadding">12</Thickness>
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<!-- Define resources for Dark mode here -->
|
||||
|
||||
<!--
|
||||
Originally, we were using the raw value of
|
||||
ApplicationPageBackgroundThemeBrush here, which is
|
||||
evaluated as SolidBackgroundFillColorBase. If we try
|
||||
to use those resources directly though, we don't get
|
||||
the properly themed versions. Presumably because the
|
||||
App itself can't have it's RequestedTheme changed at
|
||||
runtime.
|
||||
|
||||
However, after more discussion with the WinUI
|
||||
team, we determined that those colors don't
|
||||
provide enough contrast. The color here (and in
|
||||
light mode) were chosen for greater contrast.
|
||||
|
||||
See GH #12356 for more history on the subject.
|
||||
-->
|
||||
<SolidColorBrush x:Key="TabViewBackground"
|
||||
Color="#0a0a0a" />
|
||||
Color="#FF333333" />
|
||||
|
||||
<StaticResource x:Key="UnfocusedBorderBrush"
|
||||
ResourceKey="ApplicationPageBackgroundThemeBrush" />
|
||||
<SolidColorBrush x:Key="UnfocusedBorderBrush"
|
||||
Color="#FF333333" />
|
||||
</ResourceDictionary>
|
||||
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<!-- Define resources for Light mode here -->
|
||||
|
||||
<!--
|
||||
GH #12398 has more history on this value, as well as GH #12400
|
||||
-->
|
||||
<SolidColorBrush x:Key="TabViewBackground"
|
||||
Color="#dadada" />
|
||||
Color="#FFCCCCCC" />
|
||||
|
||||
<StaticResource x:Key="UnfocusedBorderBrush"
|
||||
ResourceKey="ApplicationPageBackgroundThemeBrush" />
|
||||
</ResourceDictionary>
|
||||
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<!-- Define resources for HighContrast mode here -->
|
||||
|
||||
<!--
|
||||
MSFT:38264744
|
||||
You'd think that if a key wasn't present in a ThemeDictionary,
|
||||
it'd fall back to the original value. You'd be wrong - if you
|
||||
provide a Light&dark version of a resource, but not the
|
||||
HighContrast version, the resource loader will fall back to the
|
||||
Light value.
|
||||
|
||||
SystemColorButtonFaceColorBrush is the default background color for WinUI's TabViewBackground under high contrast mode.
|
||||
-->
|
||||
<StaticResource x:Key="TabViewBackground"
|
||||
ResourceKey="SystemColorButtonFaceColorBrush" />
|
||||
<SolidColorBrush x:Key="UnfocusedBorderBrush"
|
||||
Color="#FFCCCCCC" />
|
||||
</ResourceDictionary>
|
||||
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
@@ -189,18 +189,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
else if (const auto& realArgs = args.ActionArgs().try_as<SplitPaneArgs>())
|
||||
{
|
||||
if (const auto& newTerminalArgs{ realArgs.TerminalArgs() })
|
||||
{
|
||||
if (const auto index = realArgs.TerminalArgs().ProfileIndex())
|
||||
{
|
||||
if (gsl::narrow<uint32_t>(index.Value()) >= _settings.ActiveProfiles().Size())
|
||||
{
|
||||
args.Handled(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_SplitPane(realArgs.SplitDirection(),
|
||||
// This is safe, we're already filtering so the value is (0, 1)
|
||||
::base::saturated_cast<float>(realArgs.SplitSize()),
|
||||
@@ -317,18 +305,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
else if (const auto& realArgs = args.ActionArgs().try_as<NewTabArgs>())
|
||||
{
|
||||
if (const auto& newTerminalArgs{ realArgs.TerminalArgs() })
|
||||
{
|
||||
if (const auto index = newTerminalArgs.ProfileIndex())
|
||||
{
|
||||
if (gsl::narrow<uint32_t>(index.Value()) >= _settings.ActiveProfiles().Size())
|
||||
{
|
||||
args.Handled(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_IF_FAILED(_OpenNewTab(realArgs.TerminalArgs()));
|
||||
args.Handled(true);
|
||||
}
|
||||
@@ -733,6 +709,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// This might cause a UAC prompt. The elevation is performed on a
|
||||
// background thread, as to not block the UI thread.
|
||||
// Arguments:
|
||||
// - elevate: If true, launch the new Terminal elevated using `runas`
|
||||
// - newTerminalArgs: A NewTerminalArgs describing the terminal instance
|
||||
// that should be spawned. The Profile should be filled in with the GUID
|
||||
// of the profile we want to launch.
|
||||
@@ -740,7 +717,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Important: Don't take the param by reference, since we'll be doing work
|
||||
// on another thread.
|
||||
fire_and_forget TerminalPage::_OpenNewWindow(const NewTerminalArgs newTerminalArgs)
|
||||
fire_and_forget TerminalPage::_OpenNewWindow(const bool elevate,
|
||||
const NewTerminalArgs newTerminalArgs)
|
||||
{
|
||||
// Hop to the BG thread
|
||||
co_await winrt::resume_background();
|
||||
@@ -767,8 +745,9 @@ namespace winrt::TerminalApp::implementation
|
||||
SHELLEXECUTEINFOW seInfo{ 0 };
|
||||
seInfo.cbSize = sizeof(seInfo);
|
||||
seInfo.fMask = SEE_MASK_NOASYNC;
|
||||
// `runas` will cause the shell to launch this child process elevated.
|
||||
// `open` will just run the executable normally.
|
||||
seInfo.lpVerb = L"open";
|
||||
seInfo.lpVerb = elevate ? L"runas" : L"open";
|
||||
seInfo.lpFile = exePath.c_str();
|
||||
seInfo.lpParameters = cmdline.c_str();
|
||||
seInfo.nShow = SW_SHOWNORMAL;
|
||||
@@ -802,7 +781,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Manually fill in the evaluated profile.
|
||||
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
|
||||
_OpenNewWindow(newTerminalArgs);
|
||||
_OpenNewWindow(false, newTerminalArgs);
|
||||
actionArgs.Handled(true);
|
||||
}
|
||||
|
||||
@@ -868,54 +847,18 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
_UpdateTeachingTipTheme(WindowRenamer().try_as<winrt::Windows::UI::Xaml::FrameworkElement>());
|
||||
WindowRenamer().IsOpen(true);
|
||||
|
||||
// BODGY: GH#12021
|
||||
//
|
||||
// TeachingTip doesn't provide an Opened event.
|
||||
// (microsoft/microsoft-ui-xaml#1607). But we want to focus the renamer
|
||||
// text box when it's opened. We can't do that immediately, the TextBox
|
||||
// technically isn't in the visual tree yet. We have to wait for it to
|
||||
// get added some time after we call IsOpen. How do we do that reliably?
|
||||
// Usually, for this kind of thing, we'd just use a one-off
|
||||
// LayoutUpdated event, as a notification that the TextBox was added to
|
||||
// the tree. HOWEVER:
|
||||
// * The _first_ time this is fired, when the box is _first_ opened,
|
||||
// tossing focus doesn't work on the first LayoutUpdated. It does
|
||||
// work on the second LayoutUpdated. Okay, so we'll wait for two
|
||||
// LayoutUpdated events, and focus on the second.
|
||||
// * On subsequent opens: We only ever get a single LayoutUpdated.
|
||||
// Period. But, you can successfully focus it on that LayoutUpdated.
|
||||
//
|
||||
// So, we'll keep track of how many LayoutUpdated's we've _ever_ gotten.
|
||||
// If we've had at least 2, then we can focus the text box.
|
||||
// PAIN: We can't immediately focus the textbox in the TeachingTip. It's
|
||||
// not technically focusable until it is opened. However, it doesn't
|
||||
// provide an event to tell us when it is opened. That's tracked in
|
||||
// microsoft/microsoft-ui-xaml#1607. So for now, the user _needs_ to
|
||||
// click on the text box manually.
|
||||
//
|
||||
// We're also not using a ContentDialog for this, because in Xaml
|
||||
// Islands a text box in a ContentDialog won't receive _any_ keypresses.
|
||||
// Fun!
|
||||
// WindowRenamerTextBox().Focus(FocusState::Programmatic);
|
||||
_renamerLayoutUpdatedRevoker.revoke();
|
||||
_renamerLayoutUpdatedRevoker = WindowRenamerTextBox().LayoutUpdated(winrt::auto_revoke, [weakThis = get_weak()](auto&&, auto&&) {
|
||||
if (auto self{ weakThis.get() })
|
||||
{
|
||||
auto& count{ self->_renamerLayoutCount };
|
||||
|
||||
// Don't just always increment this, we don't want to deal with overflow situations
|
||||
if (count < 2)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= 2)
|
||||
{
|
||||
self->_renamerLayoutUpdatedRevoker.revoke();
|
||||
self->WindowRenamerTextBox().Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
});
|
||||
// Make sure to mark that enter was not pressed in the renamer quite
|
||||
// yet. More details in TerminalPage::_WindowRenamerKeyDown.
|
||||
_renamerPressedEnter = false;
|
||||
WindowRenamer().IsOpen(true);
|
||||
|
||||
args.Handled(true);
|
||||
}
|
||||
@@ -1027,7 +970,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (const auto& realArgs = args.ActionArgs().try_as<AdjustOpacityArgs>())
|
||||
{
|
||||
const auto res = _ApplyToActiveControls([&](auto& control) {
|
||||
control.AdjustOpacity(realArgs.Opacity() / 100.0, realArgs.Relative());
|
||||
control.AdjustOpacity(realArgs.Opacity(), realArgs.Relative());
|
||||
});
|
||||
args.Handled(res);
|
||||
}
|
||||
|
||||
@@ -504,26 +504,8 @@ namespace winrt::TerminalApp::implementation
|
||||
if (keyboardServiceIsDisabled)
|
||||
{
|
||||
_root->ShowKeyboardServiceWarning();
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider,
|
||||
"KeyboardServiceWasDisabled",
|
||||
TraceLoggingDescription("Event emitted when the keyboard service is disabled, and we warned them about it"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// For when the warning was disabled in the settings
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider,
|
||||
"KeyboardServiceWarningWasDisabledBySetting",
|
||||
TraceLoggingDescription("Event emitted when the user has disabled the KB service warning"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
|
||||
}
|
||||
|
||||
if (FAILED(_settingsLoadedResult))
|
||||
{
|
||||
@@ -1092,18 +1074,18 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Gets the title of the currently focused terminal control. If there
|
||||
// isn't a control selected for any reason, returns "Terminal"
|
||||
// isn't a control selected for any reason, returns "Windows Terminal"
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title of the focused control if there is one, else "Terminal"
|
||||
// - the title of the focused control if there is one, else "Windows Terminal"
|
||||
hstring AppLogic::Title()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
return _root->Title();
|
||||
}
|
||||
return { L"Terminal" };
|
||||
return { L"Windows Terminal" };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1490,24 +1472,6 @@ namespace winrt::TerminalApp::implementation
|
||||
return _root != nullptr ? _root->ShouldUsePersistedLayout(_settings) : false;
|
||||
}
|
||||
|
||||
bool AppLogic::ShouldImmediatelyHandoffToElevated()
|
||||
{
|
||||
if (!_loadedInitialSettings)
|
||||
{
|
||||
// Load settings if we haven't already
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
return _root != nullptr ? _root->ShouldImmediatelyHandoffToElevated(_settings) : false;
|
||||
}
|
||||
void AppLogic::HandoffToElevated()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
_root->HandoffToElevated(_settings);
|
||||
}
|
||||
}
|
||||
|
||||
void AppLogic::SaveWindowLayoutJsons(const Windows::Foundation::Collections::IVector<hstring>& layouts)
|
||||
{
|
||||
std::vector<WindowLayout> converted;
|
||||
@@ -1605,24 +1569,38 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
bool AppLogic::GetMinimizeToNotificationArea()
|
||||
{
|
||||
if (!_loadedInitialSettings)
|
||||
if constexpr (Feature_NotificationIcon::IsEnabled())
|
||||
{
|
||||
// Load settings if we haven't already
|
||||
LoadSettings();
|
||||
}
|
||||
if (!_loadedInitialSettings)
|
||||
{
|
||||
// Load settings if we haven't already
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
return _settings.GlobalSettings().MinimizeToNotificationArea();
|
||||
return _settings.GlobalSettings().MinimizeToNotificationArea();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool AppLogic::GetAlwaysShowNotificationIcon()
|
||||
{
|
||||
if (!_loadedInitialSettings)
|
||||
if constexpr (Feature_NotificationIcon::IsEnabled())
|
||||
{
|
||||
// Load settings if we haven't already
|
||||
LoadSettings();
|
||||
}
|
||||
if (!_loadedInitialSettings)
|
||||
{
|
||||
// Load settings if we haven't already
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
return _settings.GlobalSettings().AlwaysShowNotificationIcon();
|
||||
return _settings.GlobalSettings().AlwaysShowNotificationIcon();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool AppLogic::GetShowTitleInTitlebar()
|
||||
|
||||
@@ -81,8 +81,6 @@ namespace winrt::TerminalApp::implementation
|
||||
bool AlwaysOnTop() const;
|
||||
|
||||
bool ShouldUsePersistedLayout();
|
||||
bool ShouldImmediatelyHandoffToElevated();
|
||||
void HandoffToElevated();
|
||||
hstring GetWindowLayoutJson(Microsoft::Terminal::Settings::Model::LaunchPosition position);
|
||||
void SaveWindowLayoutJsons(const Windows::Foundation::Collections::IVector<hstring>& layouts);
|
||||
void IdentifyWindow();
|
||||
|
||||
@@ -33,8 +33,6 @@ namespace TerminalApp
|
||||
SystemMenuItemHandler Handler { get; };
|
||||
};
|
||||
|
||||
// See IDialogPresenter and TerminalPage's DialogPresenter for more
|
||||
// information.
|
||||
[default_interface] runtimeclass AppLogic : IDirectKeyListener, IDialogPresenter
|
||||
{
|
||||
AppLogic();
|
||||
@@ -95,8 +93,6 @@ namespace TerminalApp
|
||||
TaskbarState TaskbarState{ get; };
|
||||
|
||||
Boolean ShouldUsePersistedLayout();
|
||||
Boolean ShouldImmediatelyHandoffToElevated();
|
||||
void HandoffToElevated();
|
||||
String GetWindowLayoutJson(Microsoft.Terminal.Settings.Model.LaunchPosition position);
|
||||
void SaveWindowLayoutJsons(Windows.Foundation.Collections.IVector<String> layouts);
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ namespace winrt::TerminalApp::implementation
|
||||
void ColorPickupFlyout::ColorButton_Click(IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const&)
|
||||
{
|
||||
auto button{ sender.as<Windows::UI::Xaml::Controls::Button>() };
|
||||
auto rectClr{ button.Background().as<Windows::UI::Xaml::Media::SolidColorBrush>() };
|
||||
auto rectangle{ button.Content().as<Windows::UI::Xaml::Shapes::Rectangle>() };
|
||||
auto rectClr{ rectangle.Fill().as<Windows::UI::Xaml::Media::SolidColorBrush>() };
|
||||
_ColorSelectedHandlers(rectClr.Color());
|
||||
Hide();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
Placement="Bottom"
|
||||
ShouldConstrainToRootBounds="False"
|
||||
mc:Ignorable="d">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
@@ -25,105 +23,164 @@
|
||||
MaximumRowsOrColumns="4"
|
||||
Orientation="Horizontal">
|
||||
<VariableSizedWrapGrid.Resources>
|
||||
<Style x:Name="ColorPickerColorButtonStyle"
|
||||
BasedOn="{StaticResource ColorButtonStyle}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Style TargetType="Rectangle">
|
||||
<Setter Property="Width" Value="30" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
</Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Padding" Value="-1" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource SystemBaseLowColor}" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource ColorPickerColorButtonStyle}"
|
||||
TargetType="Button" />
|
||||
</VariableSizedWrapGrid.Resources>
|
||||
|
||||
<Button x:Uid="CrimsonColorButton"
|
||||
AutomationProperties.Name="Crimson"
|
||||
Background="Crimson"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Crimson" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="SteelBlueColorButton"
|
||||
AutomationProperties.Name="SteelBlue"
|
||||
Background="SteelBlue"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SteelBlue" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="MediumSeaGreenColorButton"
|
||||
AutomationProperties.Name="MediumSeaGreen"
|
||||
Background="MediumSeaGreen"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="MediumSeaGreen" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="DarkOrangeColorButton"
|
||||
AutomationProperties.Name="DarkOrange"
|
||||
Background="DarkOrange"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DarkOrange" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="MediumVioletRedColorButton"
|
||||
AutomationProperties.Name="MediumVioletRed"
|
||||
Background="MediumVioletRed"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="MediumVioletRed" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="DodgerBlueColorButton"
|
||||
AutomationProperties.Name="DodgerBlue"
|
||||
Background="DodgerBlue"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DodgerBlue" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="LimeGreenColorButton"
|
||||
AutomationProperties.Name="LimeGreen"
|
||||
Background="LimeGreen"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="LimeGreen" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="YellowColorButton"
|
||||
AutomationProperties.Name="Yellow"
|
||||
Background="Yellow"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Yellow" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="BlueVioletColorButton"
|
||||
AutomationProperties.Name="BlueViolet"
|
||||
Background="BlueViolet"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="BlueViolet" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="SlateBlueColorButton"
|
||||
AutomationProperties.Name="SlateBlue"
|
||||
Background="SlateBlue"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SlateBlue" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="LimeColorButton"
|
||||
AutomationProperties.Name="Lime"
|
||||
Background="Lime"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Lime" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="TanColorButton"
|
||||
AutomationProperties.Name="Tan"
|
||||
Background="Tan"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Tan" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="MagentaColorButton"
|
||||
AutomationProperties.Name="Magenta"
|
||||
Background="Magenta"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Magenta" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="CyanColorButton"
|
||||
AutomationProperties.Name="Cyan"
|
||||
Background="Cyan"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="Cyan" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="SkyBlueColorButton"
|
||||
AutomationProperties.Name="SkyBlue"
|
||||
Background="SkyBlue"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="SkyBlue" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Uid="DarkGrayColorButton"
|
||||
AutomationProperties.Name="DarkGray"
|
||||
Background="DarkGray"
|
||||
Click="ColorButton_Click" />
|
||||
Click="ColorButton_Click">
|
||||
<Button.Content>
|
||||
<Rectangle Fill="DarkGray" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</VariableSizedWrapGrid>
|
||||
</Grid>
|
||||
<StackPanel Margin="0,12,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Grid Margin="0,12,0,0"
|
||||
Padding="-2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="ClearColorButton"
|
||||
x:Uid="TabColorClearButton"
|
||||
Grid.Column="0"
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Click="ClearColorButton_Click"
|
||||
Content="Reset" />
|
||||
<ToggleButton x:Name="CustomColorButton"
|
||||
x:Uid="TabColorCustomButton"
|
||||
Grid.Column="1"
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Click="ShowColorPickerButton_Click"
|
||||
Content="Custom"
|
||||
IsChecked="False" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<StackPanel x:Name="customColorPanel"
|
||||
Margin="16,0,0,0"
|
||||
Spacing="12"
|
||||
Visibility="Collapsed">
|
||||
<Grid x:Name="customColorPanel"
|
||||
Margin="16,0,0,0"
|
||||
Visibility="Collapsed">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<muxc:ColorPicker x:Name="customColorPicker"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,12"
|
||||
ColorChanged="ColorPicker_ColorChanged"
|
||||
FontSize="10"
|
||||
IsAlphaEnabled="False"
|
||||
@@ -141,6 +198,6 @@
|
||||
Click="CustomColorButton_Click"
|
||||
Content="OK"
|
||||
Style="{ThemeResource AccentButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
|
||||
@@ -39,6 +39,17 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
_switchToMode(CommandPaletteMode::ActionMode);
|
||||
|
||||
if (CommandPaletteShadow())
|
||||
{
|
||||
// Hook up the shadow on the command palette to the backdrop that
|
||||
// will actually show it. This needs to be done at runtime, and only
|
||||
// if the shadow actually exists. ThemeShadow isn't supported below
|
||||
// version 18362.
|
||||
CommandPaletteShadow().Receivers().Append(_shadowBackdrop());
|
||||
// "raise" the command palette up by 16 units, so it will cast a shadow.
|
||||
_backdrop().Translation({ 0, 0, 16 });
|
||||
}
|
||||
|
||||
// Whatever is hosting us will enable us by setting our visibility to
|
||||
// "Visible". When that happens, set focus to our search box.
|
||||
RegisterPropertyChangedCallback(UIElement::VisibilityProperty(), [this](auto&&, auto&&) {
|
||||
@@ -153,16 +164,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - the approximate number of items visible in the list (in other words the size of the page)
|
||||
uint32_t CommandPalette::_getNumVisibleItems()
|
||||
{
|
||||
if (const auto container = _filteredActionsView().ContainerFromIndex(0))
|
||||
{
|
||||
if (const auto item = container.try_as<winrt::Windows::UI::Xaml::Controls::ListViewItem>())
|
||||
{
|
||||
const auto itemHeight = ::base::saturated_cast<int>(item.ActualHeight());
|
||||
const auto listHeight = ::base::saturated_cast<int>(_filteredActionsView().ActualHeight());
|
||||
return listHeight / itemHeight;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
const auto container = _filteredActionsView().ContainerFromIndex(0);
|
||||
const auto item = container.try_as<winrt::Windows::UI::Xaml::Controls::ListViewItem>();
|
||||
const auto itemHeight = ::base::saturated_cast<int>(item.ActualHeight());
|
||||
const auto listHeight = ::base::saturated_cast<int>(_filteredActionsView().ActualHeight());
|
||||
return listHeight / itemHeight;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -816,15 +822,16 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
const auto currentNeedleHasResults{ _filteredActions.Size() > 0 };
|
||||
_noMatchesText().Visibility(currentNeedleHasResults ? Visibility::Collapsed : Visibility::Visible);
|
||||
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(_searchBox()) })
|
||||
if (!currentNeedleHasResults)
|
||||
{
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
currentNeedleHasResults ?
|
||||
winrt::hstring{ fmt::format(std::wstring_view{ RS_(L"CommandPalette_MatchesAvailable") }, _filteredActions.Size()) } :
|
||||
NoMatchesText(), // what to announce if results were found
|
||||
L"CommandPaletteResultAnnouncement" /* unique name for this group of notifications */);
|
||||
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(_searchBox()) })
|
||||
{
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
NoMatchesText(), // NoMatchesText contains the right text for the current mode
|
||||
L"CommandPaletteResultAnnouncement" /* unique name for this notification */);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
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:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -23,6 +24,13 @@
|
||||
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<!--
|
||||
ThemeShadow is only on 18362. This "Windows10version1903" bit
|
||||
adds it conditionally
|
||||
-->
|
||||
<Windows10version1903:ThemeShadow x:Name="CommandPaletteShadow" />
|
||||
|
||||
<!-- This creates an instance of our CommandKeyChordVisibilityConverter we can reference below -->
|
||||
<local:EmptyStringVisibilityConverter x:Key="CommandKeyChordVisibilityConverter" />
|
||||
<local:EmptyStringVisibilityConverter x:Key="ParsedCommandLineTextVisibilityConverter" />
|
||||
@@ -134,11 +142,16 @@
|
||||
Text="{x:Bind Item.KeyChordText, Mode=OneWay}" />
|
||||
</Border>
|
||||
|
||||
<!-- xE70E is ChevronUp. Rotated 90 degrees, it's _ChevronRight_ -->
|
||||
<FontIcon Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph="" />
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Glyph="">
|
||||
|
||||
<FontIcon.RenderTransform>
|
||||
<RotateTransform Angle="90" CenterX="0.5" CenterY="0.5" />
|
||||
</FontIcon.RenderTransform>
|
||||
</FontIcon>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -186,20 +199,20 @@
|
||||
Orientation="Horizontal">
|
||||
|
||||
<FontIcon Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind Item.(local:TabPaletteItem.TabStatus).BellIndicator, Mode=OneWay}" />
|
||||
|
||||
<FontIcon Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind Item.(local:TabPaletteItem.TabStatus).IsPaneZoomed, Mode=OneWay}" />
|
||||
|
||||
<FontIcon x:Name="HeaderLockIcon"
|
||||
Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind Item.(local:TabPaletteItem.TabStatus).IsReadOnlyActive, Mode=OneWay}" />
|
||||
@@ -215,13 +228,48 @@
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Style x:Key="CommandPaletteBackground"
|
||||
TargetType="Grid">
|
||||
<Setter Property="Background" Value="#333333" />
|
||||
</Style>
|
||||
<!-- TextBox colors ! -->
|
||||
<SolidColorBrush x:Key="TextControlBackground"
|
||||
Color="#333333" />
|
||||
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush"
|
||||
Color="#B5B5B5" />
|
||||
<SolidColorBrush x:Key="TextControlForeground"
|
||||
Color="#B5B5B5" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrush"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForeground"
|
||||
Color="#B5B5B5" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundPointerOver"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlForegroundPointerOver"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver"
|
||||
Color="#FF4343" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundFocused"
|
||||
Color="#333333" />
|
||||
<SolidColorBrush x:Key="TextControlForegroundFocused"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushFocused"
|
||||
Color="#404040" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPressed"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed"
|
||||
Color="#FF4343" />
|
||||
|
||||
<!-- KeyChordText styles -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="KeyChordTextBlockStyle"
|
||||
@@ -233,9 +281,9 @@
|
||||
<Style x:Key="ParsedCommandLineBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
|
||||
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="ParsedCommandLineTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
@@ -243,13 +291,42 @@
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Style x:Key="CommandPaletteBackground"
|
||||
TargetType="Grid">
|
||||
<Setter Property="Background" Value="#CCCCCC" />
|
||||
</Style>
|
||||
<!-- TextBox colors ! -->
|
||||
<SolidColorBrush x:Key="TextControlBackground"
|
||||
Color="#CCCCCC" />
|
||||
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrush"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForeground"
|
||||
Color="#636363" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundPointerOver"
|
||||
Color="#DADADA" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver"
|
||||
Color="#FF4343" />
|
||||
|
||||
<SolidColorBrush x:Key="TextControlBackgroundFocused"
|
||||
Color="#CCCCCC" />
|
||||
<SolidColorBrush x:Key="TextControlBorderBrushFocused"
|
||||
Color="#636363" />
|
||||
<SolidColorBrush x:Key="TextControlButtonForegroundPressed"
|
||||
Color="#FFFFFF" />
|
||||
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed"
|
||||
Color="#FF4343" />
|
||||
|
||||
<!-- KeyChordText styles -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="KeyChordTextBlockStyle"
|
||||
@@ -261,9 +338,9 @@
|
||||
<Style x:Key="ParsedCommandLineBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
|
||||
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||
<Setter Property="CornerRadius" Value="1" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
||||
</Style>
|
||||
<Style x:Key="ParsedCommandLineTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
@@ -271,6 +348,10 @@
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<Style x:Key="CommandPaletteBackground"
|
||||
TargetType="Grid">
|
||||
<Setter Property="Background" Value="{ThemeResource SystemColorWindowColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- KeyChordText styles (use XAML defaults for High Contrast theme) -->
|
||||
<Style x:Key="KeyChordBorderStyle"
|
||||
@@ -300,23 +381,37 @@
|
||||
<RowDefinition Height="2*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--
|
||||
Setting the row/col span of this shadow backdrop is a bit of a hack. In
|
||||
order to receive pointer events, an element needs to be _not_ transparent.
|
||||
However, we want to be able to eat all the clicks outside the immediate
|
||||
bounds of the command palette, and we don't want a semi-transparent overlay
|
||||
over all of the UI. Fortunately, if we make this _shadowBackdrop the size of
|
||||
the entire page, then it can be mostly transparent, and cause the root grid
|
||||
to receive clicks _anywhere_ in its bounds.
|
||||
-->
|
||||
|
||||
<Grid x:Name="_shadowBackdrop"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent" />
|
||||
|
||||
<Grid x:Name="_backdrop"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="8"
|
||||
Padding="0,8,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Background="{ThemeResource FlyoutPresenterBackground}"
|
||||
BorderBrush="{ThemeResource FlyoutBorderThemeBrush}"
|
||||
BorderThickness="{ThemeResource FlyoutBorderThemeThickness}"
|
||||
Windows10version1903:Shadow="{StaticResource CommandPaletteShadow}"
|
||||
CornerRadius="{ThemeResource OverlayCornerRadius}"
|
||||
PointerPressed="_backdropPointerPressed"
|
||||
Shadow="{StaticResource SharedShadow}"
|
||||
Translation="0,0,32">
|
||||
Style="{ThemeResource CommandPaletteBackground}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
@@ -324,7 +419,7 @@
|
||||
|
||||
<TextBox x:Name="_searchBox"
|
||||
Grid.Row="0"
|
||||
Margin="8,0,8,8"
|
||||
Margin="8"
|
||||
Padding="18,8,8,8"
|
||||
IsSpellCheckEnabled="False"
|
||||
PlaceholderText="{x:Bind SearchBoxPlaceholderText, Mode=OneWay}"
|
||||
@@ -333,39 +428,45 @@
|
||||
|
||||
<TextBlock x:Name="_prefixCharacter"
|
||||
Grid.Row="0"
|
||||
Margin="8,0,8,8"
|
||||
Padding="8,0,0,0"
|
||||
Margin="16,16,0,-8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{x:Bind PrefixCharacter, Mode=OneWay}"
|
||||
Visibility="{x:Bind PrefixCharacter, Mode=OneWay, Converter={StaticResource ParentCommandVisibilityConverter}}" />
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Margin="8,0,8,8"
|
||||
Padding="16,0,16,4"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{x:Bind ParentCommandName, Mode=OneWay, Converter={StaticResource ParentCommandVisibilityConverter}}">
|
||||
|
||||
<Button x:Name="_parentCommandBackButton"
|
||||
x:Uid="ParentCommandBackButton"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Click="_moveBackButtonClicked"
|
||||
ClickMode="Press">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="11"
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph="" />
|
||||
</Button>
|
||||
|
||||
<TextBlock x:Name="_parentCommandText"
|
||||
Padding="16,4"
|
||||
Grid.Row="1"
|
||||
Padding="16,0,16,4"
|
||||
VerticalAlignment="Center"
|
||||
FontStyle="Italic"
|
||||
Text="{x:Bind ParentCommandName, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock x:Name="_noMatchesText"
|
||||
Grid.Row="1"
|
||||
Padding="16"
|
||||
FontStyle="Italic"
|
||||
Text="{x:Bind NoMatchesText, Mode=OneWay}"
|
||||
Visibility="Collapsed" />
|
||||
|
||||
<Border Grid.Row="1"
|
||||
Margin="8,0,8,8"
|
||||
Padding="16,12"
|
||||
Padding="16"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Style="{ThemeResource ParsedCommandLineBorderStyle}"
|
||||
@@ -379,20 +480,8 @@
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<Border x:Name="_noMatchesText"
|
||||
Grid.Row="3"
|
||||
Height="36"
|
||||
Margin="8,0,8,8"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock Padding="12,0"
|
||||
VerticalAlignment="Center"
|
||||
FontStyle="Italic"
|
||||
Text="{x:Bind NoMatchesText, Mode=OneWay}" />
|
||||
</Border>
|
||||
|
||||
<ListView x:Name="_filteredActionsView"
|
||||
Grid.Row="3"
|
||||
Padding="4,-2,4,6"
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
|
||||
@@ -62,19 +62,6 @@ static std::wstring _normalizeIconPath(std::wstring_view path)
|
||||
// - <none>
|
||||
winrt::fire_and_forget Jumplist::UpdateJumplist(const CascadiaSettings& settings) noexcept
|
||||
{
|
||||
if (!settings)
|
||||
{
|
||||
// By all accounts, this shouldn't be null. Seemingly however (GH
|
||||
// #12360), it sometimes is. So just check this case here and log a
|
||||
// message.
|
||||
TraceLoggingWrite(g_hTerminalAppProvider,
|
||||
"Jumplist_UpdateJumplist_NullSettings",
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
co_return;
|
||||
}
|
||||
|
||||
// make sure to capture the settings _before_ the co_await
|
||||
const auto strongSettings = settings;
|
||||
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Color x:Key="CloseButtonColor">#C42B1C</Color>
|
||||
<x:Double x:Key="CaptionButtonStrokeWidth">1.0</x:Double>
|
||||
<StaticResource x:Key="CaptionButtonBackgroundPointerOver"
|
||||
ResourceKey="SubtleFillColorSecondary" />
|
||||
ResourceKey="SystemControlBackgroundBaseLowBrush" />
|
||||
<StaticResource x:Key="CaptionButtonBackgroundPressed"
|
||||
ResourceKey="SubtleFillColorTertiary" />
|
||||
ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
|
||||
<StaticResource x:Key="CaptionButtonStroke"
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonStrokeColor"
|
||||
@@ -37,26 +36,23 @@
|
||||
Color="Transparent" />
|
||||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
|
||||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver"
|
||||
Color="{ThemeResource CloseButtonColor}" />
|
||||
Color="#e81123" />
|
||||
<SolidColorBrush x:Key="CloseButtonStrokePointerOver"
|
||||
Color="White" />
|
||||
<SolidColorBrush x:Key="CloseButtonBackgroundPressed"
|
||||
Opacity="0.9"
|
||||
Color="{ThemeResource CloseButtonColor}" />
|
||||
Color="#f1707a" />
|
||||
<SolidColorBrush x:Key="CloseButtonStrokePressed"
|
||||
Opacity="0.7"
|
||||
Color="White" />
|
||||
Color="Black" />
|
||||
<SolidColorBrush x:Key="CloseButtonBackground"
|
||||
Color="#00e81123" />
|
||||
<Color x:Key="CloseButtonBackgroundColor">#00e81123</Color>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Color x:Key="CloseButtonColor">#C42B1C</Color>
|
||||
<x:Double x:Key="CaptionButtonStrokeWidth">1.0</x:Double>
|
||||
<StaticResource x:Key="CaptionButtonBackgroundPointerOver"
|
||||
ResourceKey="SubtleFillColorSecondary" />
|
||||
ResourceKey="SystemControlBackgroundBaseLowBrush" />
|
||||
<StaticResource x:Key="CaptionButtonBackgroundPressed"
|
||||
ResourceKey="SubtleFillColorTertiary" />
|
||||
ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
|
||||
<StaticResource x:Key="CaptionButtonStroke"
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonStrokeColor"
|
||||
@@ -69,21 +65,19 @@
|
||||
Color="Transparent" />
|
||||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
|
||||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver"
|
||||
Color="{ThemeResource CloseButtonColor}" />
|
||||
Color="#e81123" />
|
||||
<SolidColorBrush x:Key="CloseButtonStrokePointerOver"
|
||||
Color="White" />
|
||||
<SolidColorBrush x:Key="CloseButtonBackgroundPressed"
|
||||
Opacity="0.9"
|
||||
Color="{ThemeResource CloseButtonColor}" />
|
||||
Color="#f1707a" />
|
||||
<SolidColorBrush x:Key="CloseButtonStrokePressed"
|
||||
Opacity="0.7"
|
||||
Color="White" />
|
||||
Color="Black" />
|
||||
<SolidColorBrush x:Key="CloseButtonBackground"
|
||||
Color="#00e81123" />
|
||||
<Color x:Key="CloseButtonBackgroundColor">#00e81123</Color>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<x:Double x:Key="CaptionButtonStrokeWidth">2.0</x:Double>
|
||||
<x:Double x:Key="CaptionButtonStrokeWidth">3.0</x:Double>
|
||||
<SolidColorBrush x:Key="CaptionButtonBackground"
|
||||
Color="{ThemeResource SystemColorButtonFaceColor}" />
|
||||
<StaticResource x:Key="CaptionButtonBackgroundColor"
|
||||
@@ -171,7 +165,7 @@
|
||||
<ColorAnimation Storyboard.TargetName="ButtonBaseElement"
|
||||
Storyboard.TargetProperty="(UIElement.Background).(SolidColorBrush.Color)"
|
||||
To="{ThemeResource CaptionButtonBackgroundColor}"
|
||||
Duration="0:0:0.15" />
|
||||
Duration="0:0:0.2" />
|
||||
<ColorAnimation Storyboard.TargetName="Path"
|
||||
Storyboard.TargetProperty="(UIElement.Stroke).(SolidColorBrush.Color)"
|
||||
To="{ThemeResource CaptionButtonStrokeColor}"
|
||||
@@ -253,10 +247,9 @@
|
||||
Click="_MaximizeClick"
|
||||
Style="{StaticResource CaptionButton}">
|
||||
<Button.Resources>
|
||||
<!-- These paths are complicated, but taken directly from WinUI's WindowCaptionButton paths. -->
|
||||
<ResourceDictionary>
|
||||
<x:String x:Key="CaptionButtonPath">M 1.516 -0.001 L 7.451 0.009 C 8.751 0.019 9 1 8.981 1.477 L 9.002 7.558 M 9.002 7.547 C 8.929 8.669 8 9 7.43 9.015 L 1.464 9.005 C 0.374 8.973 0 8 -0.004 7.484 L -0.004 1.477 C 0 1 0.415 0.009 1.527 -0.001</x:String>
|
||||
<x:String x:Key="CaptionButtonPathWindowMaximized">M 1.516 -0.001 L 7.451 0.009 C 8.751 0.019 9 1 8.981 1.477 L 9.002 7.558 M 11 6 L 11 2 C 11 0 10 -2 8.011 -1.946 L 7.06 -1.969 L 3 -2 M 9.002 7.547 C 8.929 8.669 8 9 7.43 9.015 L 1.464 9.005 C 0.374 8.973 0 8 -0.004 7.484 L -0.004 1.477 C 0 1 0.415 0.009 1.527 -0.001</x:String>
|
||||
<x:String x:Key="CaptionButtonPath">M 0 0 H 10 V 10 H 0 V 0</x:String>
|
||||
<x:String x:Key="CaptionButtonPathWindowMaximized">M 0 2 h 8 v 8 h -8 v -8 M 2 2 v -2 h 8 v 8 h -2</x:String>
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
<ToolTipService.ToolTip>
|
||||
|
||||
@@ -33,6 +33,7 @@ static const Duration AnimationDuration = DurationHelper::FromTimeSpan(winrt::Wi
|
||||
|
||||
winrt::Windows::UI::Xaml::Media::SolidColorBrush Pane::s_focusedBorderBrush = { nullptr };
|
||||
winrt::Windows::UI::Xaml::Media::SolidColorBrush Pane::s_unfocusedBorderBrush = { nullptr };
|
||||
winrt::Windows::Media::Playback::MediaPlayer Pane::s_bellPlayer = { nullptr };
|
||||
|
||||
Pane::Pane(const Profile& profile, const TermControl& control, const bool lastFocused) :
|
||||
_control{ control },
|
||||
@@ -69,6 +70,36 @@ Pane::Pane(const Profile& profile, const TermControl& control, const bool lastFo
|
||||
_FocusFirstChild();
|
||||
e.Handled(true);
|
||||
});
|
||||
|
||||
if (!s_bellPlayer)
|
||||
{
|
||||
try
|
||||
{
|
||||
s_bellPlayer = winrt::Windows::Media::Playback::MediaPlayer();
|
||||
if (s_bellPlayer)
|
||||
{
|
||||
// BODGY
|
||||
//
|
||||
// Manually leak a ref to the MediaPlayer we just instantiated.
|
||||
// We're doing this just like the way we do in AppHost with the
|
||||
// App itself.
|
||||
//
|
||||
// We have to do this because there's some bug in the OS with
|
||||
// the way a MediaPlayer gets torn down. At time of writing (Nov
|
||||
// 2021), if you search for `remove_SoundLevelChanged` in the OS
|
||||
// repo, you'll find a pile of bugs.
|
||||
//
|
||||
// We tried moving the MediaPlayer singleton up to the
|
||||
// TerminalPage, but alas, that teardown had the same problem.
|
||||
// So _whatever_. We'll leak it here. It needs to last the
|
||||
// lifetime of the app anyways, and it'll get cleaned up when the
|
||||
// Terminal is closed, so whatever.
|
||||
winrt::Windows::Media::Playback::MediaPlayer p{ s_bellPlayer };
|
||||
::winrt::detach_abi(p);
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
|
||||
Pane::Pane(std::shared_ptr<Pane> first,
|
||||
@@ -1030,54 +1061,17 @@ void Pane::_ControlConnectionStateChangedHandler(const winrt::Windows::Foundatio
|
||||
|
||||
winrt::fire_and_forget Pane::_playBellSound(winrt::Windows::Foundation::Uri uri)
|
||||
{
|
||||
auto weakThis{ weak_from_this() };
|
||||
auto weakThis{ shared_from_this() };
|
||||
|
||||
co_await winrt::resume_foreground(_root.Dispatcher());
|
||||
if (auto pane{ weakThis.lock() })
|
||||
if (auto pane{ weakThis.get() })
|
||||
{
|
||||
// BODGY
|
||||
// GH#12258: We learned that if you leave the MediaPlayer open, and
|
||||
// press the media keys (like play/pause), then the OS will _replay the
|
||||
// bell_. So we have to re-create the MediaPlayer each time we want to
|
||||
// play the bell, to make sure a subsequent play doesn't come through
|
||||
// and reactivate the old one.
|
||||
|
||||
if (!_bellPlayer)
|
||||
{
|
||||
// The MediaPlayer might not exist on Windows N SKU.
|
||||
try
|
||||
{
|
||||
_bellPlayer = winrt::Windows::Media::Playback::MediaPlayer();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
if (_bellPlayer)
|
||||
if (s_bellPlayer)
|
||||
{
|
||||
const auto source{ winrt::Windows::Media::Core::MediaSource::CreateFromUri(uri) };
|
||||
const auto item{ winrt::Windows::Media::Playback::MediaPlaybackItem(source) };
|
||||
_bellPlayer.Source(item);
|
||||
_bellPlayer.Play();
|
||||
|
||||
// This lambda will clean up the bell player when we're done with it.
|
||||
auto weakThis2{ weak_from_this() };
|
||||
_mediaEndedRevoker = _bellPlayer.MediaEnded(winrt::auto_revoke, [weakThis2](auto&&, auto&&) {
|
||||
if (auto self{ weakThis2.lock() })
|
||||
{
|
||||
if (self->_bellPlayer)
|
||||
{
|
||||
// We need to make sure clear out the current track
|
||||
// that's being played, again, so that the system can't
|
||||
// come through and replay it. In testing, we needed to
|
||||
// do this, closing the MediaPlayer alone wasn't good
|
||||
// enough.
|
||||
self->_bellPlayer.Pause();
|
||||
self->_bellPlayer.Source(nullptr);
|
||||
self->_bellPlayer.Close();
|
||||
}
|
||||
self->_mediaEndedRevoker.revoke();
|
||||
self->_bellPlayer = nullptr;
|
||||
}
|
||||
});
|
||||
s_bellPlayer.Source(item);
|
||||
s_bellPlayer.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1179,19 +1173,6 @@ void Pane::Shutdown()
|
||||
// Lock the create/close lock so that another operation won't concurrently
|
||||
// modify our tree
|
||||
std::unique_lock lock{ _createCloseLock };
|
||||
|
||||
// Clear out our media player callbacks, and stop any playing media. This
|
||||
// will prevent the callback from being triggered after we've closed, and
|
||||
// also make sure that our sound stops when we're closed.
|
||||
_mediaEndedRevoker.revoke();
|
||||
if (_bellPlayer)
|
||||
{
|
||||
_bellPlayer.Pause();
|
||||
_bellPlayer.Source(nullptr);
|
||||
_bellPlayer.Close();
|
||||
}
|
||||
_bellPlayer = nullptr;
|
||||
|
||||
if (_IsLeaf())
|
||||
{
|
||||
_control.Close();
|
||||
|
||||
@@ -241,8 +241,7 @@ private:
|
||||
|
||||
bool _zoomed{ false };
|
||||
|
||||
winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };
|
||||
winrt::Windows::Media::Playback::MediaPlayer::MediaEnded_revoker _mediaEndedRevoker;
|
||||
static winrt::Windows::Media::Playback::MediaPlayer s_bellPlayer;
|
||||
|
||||
bool _IsLeaf() const noexcept;
|
||||
bool _HasFocusedChild() const noexcept;
|
||||
|
||||
@@ -117,46 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AppName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppStoreName" xml:space="preserve">
|
||||
<value>Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppStoreNameDev" xml:space="preserve">
|
||||
<value>Windows Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppStoreNamePre" xml:space="preserve">
|
||||
<value>Windows Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppShortName" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="AppShortNameDev" xml:space="preserve">
|
||||
<value>Terminal Dev</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppShortNamePre" xml:space="preserve">
|
||||
<value>Terminal Preview</value>
|
||||
</data>
|
||||
<data name="AppDescription" xml:space="preserve">
|
||||
<value>The New Windows Terminal</value>
|
||||
</data>
|
||||
<data name="AppDescriptionDev" xml:space="preserve">
|
||||
<value>The Windows Terminal, but Unofficial</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
</data>
|
||||
<data name="AppDescriptionPre" xml:space="preserve">
|
||||
<value>Windows Terminal with a preview of upcoming features</value>
|
||||
</data>
|
||||
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
|
||||
<value>Open in Terminal (Dev)</value>
|
||||
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
|
||||
|
||||
@@ -728,8 +728,4 @@
|
||||
<value>Open Settings</value>
|
||||
<comment>This is a call-to-action hyperlink; it will open the settings.</comment>
|
||||
</data>
|
||||
<data name="CommandPalette_MatchesAvailable" xml:space="preserve">
|
||||
<value>Suggestions found: {0}</value>
|
||||
<comment>{0} will be replaced with a number.</comment>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -98,6 +98,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
auto fontFamily = winrt::WUX::Media::FontFamily(L"Segoe MDL2 Assets");
|
||||
auto glyph = L"\xE713"; // This is the Setting icon (looks like a gear)
|
||||
|
||||
// The TabViewItem Icon needs MUX while the IconSourceElement in the CommandPalette needs WUX...
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Close
|
||||
Controls::MenuFlyoutItem closeTabMenuItem;
|
||||
Controls::FontIcon closeSymbol;
|
||||
closeSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
closeSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
closeSymbol.Glyph(L"\xE711");
|
||||
|
||||
closeTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -251,5 +251,4 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,22 @@
|
||||
MinHeight="16"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0,0,0,1</Thickness>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0,0,0,1</Thickness>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0,0,0,1</Thickness>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<StackPanel x:Name="HeaderStackPanel"
|
||||
Orientation="Horizontal">
|
||||
<mux:ProgressRing x:Name="HeaderProgressRing"
|
||||
@@ -32,19 +48,19 @@
|
||||
-->
|
||||
<FontIcon x:Name="HeaderBellIndicator"
|
||||
Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind TabStatus.BellIndicator, Mode=OneWay}" />
|
||||
<FontIcon x:Name="HeaderZoomIcon"
|
||||
Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind TabStatus.IsPaneZoomed, Mode=OneWay}" />
|
||||
<FontIcon x:Name="HeaderLockIcon"
|
||||
Margin="0,0,8,0"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind TabStatus.IsReadOnlyActive, Mode=OneWay}" />
|
||||
@@ -52,10 +68,10 @@
|
||||
Text="{x:Bind Title, Mode=OneWay}"
|
||||
Visibility="Visible" />
|
||||
<TextBox x:Name="HeaderRenamerTextBox"
|
||||
Height="24"
|
||||
Height="16"
|
||||
MinHeight="0"
|
||||
MaxWidth="{x:Bind RenamerMaxWidth, Mode=OneWay}"
|
||||
Padding="4,4,4,3"
|
||||
Padding="4,0,4,0"
|
||||
FontSize="12"
|
||||
IsSpellCheckEnabled="False"
|
||||
LostFocus="RenameBoxLostFocusHandler"
|
||||
|
||||
@@ -66,12 +66,6 @@ namespace winrt::TerminalApp::implementation
|
||||
try
|
||||
{
|
||||
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs) };
|
||||
// GH#11114: GetProfileForArgs can return null if the index is higher
|
||||
// than the number of available profiles.
|
||||
if (!profile)
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
const auto settings{ TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, *_bindings) };
|
||||
|
||||
// Try to handle auto-elevation
|
||||
|
||||
@@ -9,16 +9,12 @@
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||
Background="{ThemeResource TabViewBackground}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!-- GH#13143: Make sure that the Background is actually TabViewBackground here, not Transparent. This is load bearing, for showTabsInTitlebar=false. -->
|
||||
|
||||
<mux:TabView x:Name="TabView"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
AllowDropTabs="True"
|
||||
Background="Transparent"
|
||||
CanDragTabs="True"
|
||||
CanReorderTabs="True"
|
||||
IsAddTabButtonVisible="false"
|
||||
@@ -28,7 +24,7 @@
|
||||
<!-- EA18 is the "Shield" glyph -->
|
||||
<FontIcon x:Uid="ElevationShield"
|
||||
Margin="9,4,0,4"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="16"
|
||||
Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"
|
||||
Glyph=""
|
||||
@@ -36,93 +32,84 @@
|
||||
</mux:TabView.TabStripHeader>
|
||||
|
||||
<mux:TabView.TabStripFooter>
|
||||
<Grid>
|
||||
<!-- Remove this border after WinUI 2.8 -->
|
||||
<Border Height="1"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||
|
||||
<mux:SplitButton x:Name="NewTabButton"
|
||||
x:Uid="NewTabSplitButton"
|
||||
Height="24"
|
||||
Margin="0,4"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
AutomationProperties.AccessibilityView="Control"
|
||||
BorderThickness="0"
|
||||
Click="OnNewTabButtonClick"
|
||||
Content=""
|
||||
DragOver="OnNewTabButtonDragOver"
|
||||
Drop="OnNewTabButtonDrop"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Placement="Mouse">
|
||||
<TextBlock IsTextSelectionEnabled="False">
|
||||
<Run x:Uid="NewTabRun" /> <LineBreak />
|
||||
<Run x:Uid="NewPaneRun"
|
||||
FontStyle="Italic" /> <LineBreak />
|
||||
<Run x:Uid="NewWindowRun"
|
||||
FontStyle="Italic" />
|
||||
</TextBlock>
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
<!-- U+E710 is the fancy plus icon. -->
|
||||
<mux:SplitButton.Resources>
|
||||
<!-- Override the SplitButton* resources to match the tab view's button's styles. -->
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewButtonBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewButtonForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewButtonBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewButtonForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewButtonBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewButtonForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewButtonBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewButtonForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewButtonBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewButtonForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewButtonBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewButtonForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<x:Double x:Key="SplitButtonPrimaryButtonSize">31</x:Double>
|
||||
<x:Double x:Key="SplitButtonSecondaryButtonSize">31</x:Double>
|
||||
</ResourceDictionary>
|
||||
</mux:SplitButton.Resources>
|
||||
</mux:SplitButton>
|
||||
</Grid>
|
||||
<mux:SplitButton x:Name="NewTabButton"
|
||||
x:Uid="NewTabSplitButton"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
AutomationProperties.AccessibilityView="Control"
|
||||
BorderThickness="0"
|
||||
Click="OnNewTabButtonClick"
|
||||
Content=""
|
||||
CornerRadius="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}"
|
||||
DragOver="OnNewTabButtonDragOver"
|
||||
Drop="OnNewTabButtonDrop"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
FontWeight="SemiLight"
|
||||
UseLayoutRounding="true">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Placement="Mouse">
|
||||
<TextBlock IsTextSelectionEnabled="False">
|
||||
<Run x:Uid="NewTabRun" /> <LineBreak />
|
||||
<Run x:Uid="NewPaneRun"
|
||||
FontStyle="Italic" /> <LineBreak />
|
||||
<Run x:Uid="NewWindowRun"
|
||||
FontStyle="Italic" />
|
||||
</TextBlock>
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
<!-- U+E710 is the fancy plus icon. -->
|
||||
<mux:SplitButton.Resources>
|
||||
<!-- Override the SplitButton* resources to match the tab view's button's styles. -->
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</mux:SplitButton.Resources>
|
||||
</mux:SplitButton>
|
||||
</mux:TabView.TabStripFooter>
|
||||
|
||||
</mux:TabView>
|
||||
|
||||
@@ -400,13 +400,13 @@
|
||||
<!-- ========================= Globals ======================== -->
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
|
||||
</Target>
|
||||
|
||||
@@ -156,6 +156,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (_settings.GlobalSettings().UseAcrylicInTabRow())
|
||||
{
|
||||
const auto res = Application::Current().Resources();
|
||||
|
||||
const auto lightKey = winrt::box_value(L"Light");
|
||||
const auto darkKey = winrt::box_value(L"Dark");
|
||||
const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground");
|
||||
@@ -211,24 +212,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Inform the host that our titlebar content has changed.
|
||||
_SetTitleBarContentHandlers(*this, _tabRow);
|
||||
|
||||
// GH#13143 Manually set the tab row's background to transparent here.
|
||||
//
|
||||
// We're doing it this way because ThemeResources are tricky. We
|
||||
// default in XAML to using the appropriate ThemeResource background
|
||||
// color for our TabRow. When tabs in the titlebar are _disabled_,
|
||||
// this will ensure that the tab row has the correct theme-dependent
|
||||
// value. When tabs in the titlebar are _enabled_ (the default),
|
||||
// we'll switch the BG to Transparent, to let the Titlebar Control's
|
||||
// background be used as the BG for the tab row.
|
||||
//
|
||||
// We can't do it the other way around (default to Transparent, only
|
||||
// switch to a color when disabling tabs in the titlebar), because
|
||||
// looking up the correct ThemeResource from and App dictionary is a
|
||||
// capital-H Hard problem.
|
||||
const auto transparent = Media::SolidColorBrush();
|
||||
transparent.Color(Windows::UI::Colors::Transparent());
|
||||
_tabRow.Background(transparent);
|
||||
}
|
||||
|
||||
// Hookup our event handlers to the ShortcutActionDispatch
|
||||
@@ -241,7 +224,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_newTabButton.Click([weakThis{ get_weak() }](auto&&, auto&&) {
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
page->_OpenNewTerminalViaDropdown(NewTerminalArgs());
|
||||
page->_OpenNewTerminal(NewTerminalArgs());
|
||||
}
|
||||
});
|
||||
_newTabButton.Drop([weakThis{ get_weak() }](Windows::Foundation::IInspectable const&, winrt::Windows::UI::Xaml::DragEventArgs e) {
|
||||
@@ -315,118 +298,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// - true if the ApplicationState should be used.
|
||||
bool TerminalPage::ShouldUsePersistedLayout(CascadiaSettings& settings) const
|
||||
{
|
||||
return settings.GlobalSettings().FirstWindowPreference() == FirstWindowPreference::PersistedWindowLayout;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - This is a bit of trickiness: If we're running unelevated, and the user
|
||||
// passed in only --elevate actions, the we don't _actually_ want to
|
||||
// restore the layouts here. We're not _actually_ about to create the
|
||||
// window. We're simply going to toss the commandlines
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - true if we're not elevated but all relevant pane-spawning actions are elevated
|
||||
bool TerminalPage::ShouldImmediatelyHandoffToElevated(const CascadiaSettings& settings) const
|
||||
{
|
||||
// GH#12267: Don't forget about defterm handoff here. If we're being
|
||||
// created for embedding, then _yea_, we don't need to handoff to an
|
||||
// elevated window.
|
||||
if (!_startupActions || IsElevated() || _shouldStartInboundListener)
|
||||
{
|
||||
// there arent startup actions, or we're elevated. In that case, go for it.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that there's at least one action that's not just an elevated newTab action.
|
||||
for (const auto& action : _startupActions)
|
||||
{
|
||||
NewTerminalArgs newTerminalArgs{ nullptr };
|
||||
|
||||
if (action.Action() == ShortcutAction::NewTab)
|
||||
{
|
||||
const auto& args{ action.Args().try_as<NewTabArgs>() };
|
||||
if (args)
|
||||
{
|
||||
newTerminalArgs = args.TerminalArgs();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This was a nt action that didn't have any args. The default
|
||||
// profile may want to be elevated, so don't just early return.
|
||||
}
|
||||
}
|
||||
else if (action.Action() == ShortcutAction::SplitPane)
|
||||
{
|
||||
const auto& args{ action.Args().try_as<SplitPaneArgs>() };
|
||||
if (args)
|
||||
{
|
||||
newTerminalArgs = args.TerminalArgs();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This was a nt action that didn't have any args. The default
|
||||
// profile may want to be elevated, so don't just early return.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This was not a new tab or split pane action.
|
||||
// This doesn't affect the outcome
|
||||
continue;
|
||||
}
|
||||
|
||||
// It's possible that newTerminalArgs is null here.
|
||||
// GetProfileForArgs should be resilient to that.
|
||||
const auto profile{ settings.GetProfileForArgs(newTerminalArgs) };
|
||||
if (profile.Elevate())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// The profile didn't want to be elevated, and we aren't elevated.
|
||||
// We're going to open at least one tab, so return false.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Escape hatch for immediately dispatching requests to elevated windows
|
||||
// when first launched. At this point in startup, the window doesn't exist
|
||||
// yet, XAML hasn't been started, but we need to dispatch these actions.
|
||||
// We can't just go through ProcessStartupActions, because that processes
|
||||
// the actions async using the XAML dispatcher (which doesn't exist yet)
|
||||
// - DON'T CALL THIS if you haven't already checked
|
||||
// ShouldImmediatelyHandoffToElevated. If you're thinking about calling
|
||||
// this outside of the one place it's used, that's probably the wrong
|
||||
// solution.
|
||||
// Arguments:
|
||||
// - settings: the settings we should use for dispatching these actions. At
|
||||
// this point in startup, we hadn't otherwise been initialized with these,
|
||||
// so use them now.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::HandoffToElevated(const CascadiaSettings& settings)
|
||||
{
|
||||
if (!_startupActions)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Hookup our event handlers to the ShortcutActionDispatch
|
||||
_settings = settings;
|
||||
_HookupKeyBindings(_settings.ActionMap());
|
||||
_RegisterActionCallbacks();
|
||||
|
||||
for (const auto& action : _startupActions)
|
||||
{
|
||||
// only process new tabs and split panes. They're all going to the elevated window anyways.
|
||||
if (action.Action() == ShortcutAction::NewTab || action.Action() == ShortcutAction::SplitPane)
|
||||
{
|
||||
_actionDispatch->DoAction(action);
|
||||
}
|
||||
}
|
||||
return Feature_PersistedWindowLayout::IsEnabled() &&
|
||||
settings.GlobalSettings().FirstWindowPreference() == FirstWindowPreference::PersistedWindowLayout;
|
||||
}
|
||||
|
||||
// Method Description;
|
||||
@@ -474,7 +347,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
NewTerminalArgs args;
|
||||
args.StartingDirectory(winrt::hstring{ path.wstring() });
|
||||
this->_OpenNewTerminalViaDropdown(args);
|
||||
this->_OpenNewTerminal(args);
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hTerminalAppProvider,
|
||||
@@ -683,11 +556,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// However, we need to make sure to close this window in that scenario.
|
||||
// Since there aren't any _tabs_ in this window, we won't ever get a
|
||||
// closed event. So do it manually.
|
||||
//
|
||||
// GH#12267: Make sure that we don't instantly close ourselves when
|
||||
// we're readying to accept a defterm connection. In that case, we don't
|
||||
// have a tab yet, but will once we're initialized.
|
||||
if (_tabs.Size() == 0 && !(_shouldStartInboundListener || _isEmbeddingInboundListener))
|
||||
if (_tabs.Size() == 0)
|
||||
{
|
||||
_LastTabClosedHandlers(*this, nullptr);
|
||||
}
|
||||
@@ -703,7 +572,10 @@ namespace winrt::TerminalApp::implementation
|
||||
// Notes link, and privacy policy link.
|
||||
void TerminalPage::_ShowAboutDialog()
|
||||
{
|
||||
_ShowDialogHelper(L"AboutDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
presenter.ShowDialog(FindName(L"AboutDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
}
|
||||
|
||||
winrt::hstring TerminalPage::ApplicationDisplayName()
|
||||
@@ -723,18 +595,6 @@ namespace winrt::TerminalApp::implementation
|
||||
ShellExecute(nullptr, nullptr, currentPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper to show a content dialog
|
||||
// - We only open a content dialog if there isn't one open already
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowDialogHelper(const std::wstring_view& name)
|
||||
{
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(name).try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Displays a dialog to warn the user that they are about to close all open windows.
|
||||
// Once the user clicks the OK button, shut down the application.
|
||||
@@ -743,7 +603,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// when this is called, nothing happens. See _ShowDialog for details
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowQuitDialog()
|
||||
{
|
||||
return _ShowDialogHelper(L"QuitDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(L"QuitDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -755,14 +619,22 @@ namespace winrt::TerminalApp::implementation
|
||||
// when this is called, nothing happens. See _ShowDialog for details
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowCloseWarningDialog()
|
||||
{
|
||||
return _ShowDialogHelper(L"CloseAllDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(L"CloseAllDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Displays a dialog for warnings found while closing the terminal tab marked as read-only
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowCloseReadOnlyDialog()
|
||||
{
|
||||
return _ShowDialogHelper(L"CloseReadOnlyDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(L"CloseReadOnlyDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -775,7 +647,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// when this is called, nothing happens. See _ShowDialog for details
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowMultiLinePasteWarningDialog()
|
||||
{
|
||||
return _ShowDialogHelper(L"MultiLinePasteDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(L"MultiLinePasteDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -786,7 +662,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// when this is called, nothing happens. See _ShowDialog for details
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowLargePasteWarningDialog()
|
||||
{
|
||||
return _ShowDialogHelper(L"LargePasteDialog");
|
||||
if (auto presenter{ _dialogPresenter.get() })
|
||||
{
|
||||
co_return co_await presenter.ShowDialog(FindName(L"LargePasteDialog").try_as<WUX::Controls::ContentDialog>());
|
||||
}
|
||||
co_return ContentDialogResult::None;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -872,7 +752,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
NewTerminalArgs newTerminalArgs{ profileIndex };
|
||||
page->_OpenNewTerminalViaDropdown(newTerminalArgs);
|
||||
page->_OpenNewTerminal(newTerminalArgs);
|
||||
}
|
||||
});
|
||||
newTabFlyout.Items().Append(profileMenuItem);
|
||||
@@ -919,7 +799,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
WUX::Controls::FontIcon commandPaletteIcon{};
|
||||
commandPaletteIcon.Glyph(L"\xE945");
|
||||
commandPaletteIcon.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
commandPaletteIcon.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
commandPaletteFlyout.Icon(commandPaletteIcon);
|
||||
|
||||
commandPaletteFlyout.Click({ this, &TerminalPage::_CommandPaletteButtonOnClick });
|
||||
@@ -966,7 +846,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_newTabButton.Flyout().ShowAt(_newTabButton);
|
||||
}
|
||||
|
||||
void TerminalPage::_OpenNewTerminalViaDropdown(const NewTerminalArgs newTerminalArgs)
|
||||
void TerminalPage::_OpenNewTerminal(const NewTerminalArgs newTerminalArgs)
|
||||
{
|
||||
// if alt is pressed, open a pane
|
||||
const CoreWindow window = CoreWindow::GetForCurrentThread();
|
||||
@@ -982,21 +862,12 @@ namespace winrt::TerminalApp::implementation
|
||||
WI_IsFlagSet(lShiftState, CoreVirtualKeyStates::Down) ||
|
||||
WI_IsFlagSet(rShiftState, CoreVirtualKeyStates::Down) };
|
||||
|
||||
const auto ctrlState{ window.GetKeyState(VirtualKey::Control) };
|
||||
const auto rCtrlState = window.GetKeyState(VirtualKey::RightControl);
|
||||
const auto lCtrlState = window.GetKeyState(VirtualKey::LeftControl);
|
||||
const auto ctrlPressed{ WI_IsFlagSet(ctrlState, CoreVirtualKeyStates::Down) ||
|
||||
WI_IsFlagSet(rCtrlState, CoreVirtualKeyStates::Down) ||
|
||||
WI_IsFlagSet(lCtrlState, CoreVirtualKeyStates::Down) };
|
||||
|
||||
// Check for DebugTap
|
||||
bool debugTap = this->_settings.GlobalSettings().DebugFeaturesEnabled() &&
|
||||
WI_IsFlagSet(lAltState, CoreVirtualKeyStates::Down) &&
|
||||
WI_IsFlagSet(rAltState, CoreVirtualKeyStates::Down);
|
||||
|
||||
const bool dispatchToElevatedWindow = ctrlPressed && !IsElevated();
|
||||
|
||||
if ((shiftPressed || dispatchToElevatedWindow) && !debugTap)
|
||||
if (shiftPressed && !debugTap)
|
||||
{
|
||||
// Manually fill in the evaluated profile.
|
||||
if (newTerminalArgs.ProfileIndex() != nullptr)
|
||||
@@ -1008,15 +879,7 @@ namespace winrt::TerminalApp::implementation
|
||||
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
|
||||
}
|
||||
}
|
||||
|
||||
if (dispatchToElevatedWindow)
|
||||
{
|
||||
_OpenElevatedWT(newTerminalArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
_OpenNewWindow(newTerminalArgs);
|
||||
}
|
||||
this->_OpenNewWindow(false, newTerminalArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1203,12 +1066,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Called when the users pressed keyBindings while CommandPalette is open.
|
||||
// - As of GH#8480, this is also bound to the TabRowControl's KeyUp event.
|
||||
// That should only fire when focus is in the tab row, which is hard to
|
||||
// do. Notably, that's possible:
|
||||
// - When you have enough tabs to make the little scroll arrows appear,
|
||||
// click one, then hit tab
|
||||
// - When Narrator is in Scan mode (which is the a11y bug we're fixing here)
|
||||
// - This method is effectively an extract of TermControl::_KeyHandler and TermControl::_TryHandleKeyBinding.
|
||||
// Arguments:
|
||||
// - e: the KeyRoutedEventArgs containing info about the keystroke.
|
||||
@@ -1786,30 +1643,7 @@ namespace winrt::TerminalApp::implementation
|
||||
std::shared_ptr<Pane> newPane)
|
||||
{
|
||||
const auto focusedTab{ _GetFocusedTabImpl() };
|
||||
|
||||
// Clever hack for a crash in startup, with multiple sub-commands. Say
|
||||
// you have the following commandline:
|
||||
//
|
||||
// wtd nt -p "elevated cmd" ; sp -p "elevated cmd" ; sp -p "Command Prompt"
|
||||
//
|
||||
// Where "elevated cmd" is an elevated profile.
|
||||
//
|
||||
// In that scenario, we won't dump off the commandline immediately to an
|
||||
// elevated window, because it's got the final unelevated split in it.
|
||||
// However, when we get to that command, there won't be a tab yet. So
|
||||
// we'd crash right about here.
|
||||
//
|
||||
// Instead, let's just promote this first split to be a tab instead.
|
||||
// Crash avoided, and we don't need to worry about inserting a new-tab
|
||||
// command in at the start.
|
||||
if (!focusedTab && _tabs.Size() == 0)
|
||||
{
|
||||
_CreateNewTabFromPane(newPane);
|
||||
}
|
||||
else
|
||||
{
|
||||
_SplitPane(*focusedTab, splitDirection, splitSize, newPane);
|
||||
}
|
||||
_SplitPane(*focusedTab, splitDirection, splitSize, newPane);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1921,11 +1755,11 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Gets the title of the currently focused terminal control. If there
|
||||
// isn't a control selected for any reason, returns "Terminal"
|
||||
// isn't a control selected for any reason, returns "Windows Terminal"
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title of the focused control if there is one, else "Terminal"
|
||||
// - the title of the focused control if there is one, else "Windows Terminal"
|
||||
hstring TerminalPage::Title()
|
||||
{
|
||||
if (_settings.GlobalSettings().ShowTitleInTitlebar())
|
||||
@@ -1943,7 +1777,7 @@ namespace winrt::TerminalApp::implementation
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
return { L"Terminal" };
|
||||
return { L"Windows Terminal" };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -2141,9 +1975,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
// If the requesting terminal is in bracketed paste mode, then we don't need to warn about a multi-line paste.
|
||||
bool warnMultiLine = _settings.GlobalSettings().WarnAboutMultiLinePaste() &&
|
||||
!eventArgs.BracketedPasteEnabled();
|
||||
bool warnMultiLine = _settings.GlobalSettings().WarnAboutMultiLinePaste();
|
||||
if (warnMultiLine)
|
||||
{
|
||||
const auto isNewLineLambda = [](auto c) { return c == L'\n' || c == L'\r'; };
|
||||
@@ -2159,6 +1991,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
if (warnMultiLine)
|
||||
{
|
||||
const auto focusedTab = _GetFocusedTabImpl();
|
||||
// Do not warn about multi line pasting if the current tab has bracketed paste enabled.
|
||||
warnMultiLine = warnMultiLine && !focusedTab->GetActiveTerminalControl().BracketedPasteEnabled();
|
||||
}
|
||||
|
||||
// We have to initialize the dialog here to be able to change the text of the text block within it
|
||||
FindName(L"MultiLinePasteDialog").try_as<WUX::Controls::ContentDialog>();
|
||||
ClipboardText().Text(text);
|
||||
@@ -3100,12 +2939,9 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
NewTerminalArgs newTerminalArgs;
|
||||
newTerminalArgs.Commandline(connection.Commandline());
|
||||
// GH #12370: We absolutely cannot allow a defterm connection to
|
||||
// auto-elevate. Defterm doesn't work for elevated scenarios in the
|
||||
// first place. If we try accepting the connection, the spawning an
|
||||
// elevated version of the Terminal with that profile... that's a
|
||||
// recipe for disaster. We won't ever open up a tab in this window.
|
||||
newTerminalArgs.Elevate(false);
|
||||
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs) };
|
||||
const auto settings{ TerminalSettings::CreateWithProfile(_settings, profile, *_bindings) };
|
||||
|
||||
_CreateNewTabFromPane(_MakePane(newTerminalArgs, false, connection));
|
||||
|
||||
// Request a summon of this window to the foreground
|
||||
@@ -3613,26 +3449,6 @@ namespace winrt::TerminalApp::implementation
|
||||
// of thing with co_return winrt::make<RenameWindowResult>(false).
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Used to track if the user pressed enter with the renamer open. If we
|
||||
// immediately focus it after hitting Enter on the command palette, then
|
||||
// the Enter keydown will dismiss the command palette and open the
|
||||
// renamer, and then the enter keyup will go to the renamer. So we need to
|
||||
// make sure both a down and up go to the renamer.
|
||||
// Arguments:
|
||||
// - e: the KeyRoutedEventArgs describing the key that was released
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_WindowRenamerKeyDown(const IInspectable& /*sender*/,
|
||||
winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e)
|
||||
{
|
||||
const auto key = e.OriginalKey();
|
||||
if (key == Windows::System::VirtualKey::Enter)
|
||||
{
|
||||
_renamerPressedEnter = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Manually handle Enter and Escape for committing and dismissing a window
|
||||
// rename. This is highly similar to the TabHeaderControl's KeyUp handler.
|
||||
@@ -3643,18 +3459,16 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_WindowRenamerKeyUp(const IInspectable& sender,
|
||||
winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e)
|
||||
{
|
||||
const auto key = e.OriginalKey();
|
||||
if (key == Windows::System::VirtualKey::Enter && _renamerPressedEnter)
|
||||
if (e.OriginalKey() == Windows::System::VirtualKey::Enter)
|
||||
{
|
||||
// User is done making changes, close the rename box
|
||||
_WindowRenamerActionClick(sender, nullptr);
|
||||
}
|
||||
else if (key == Windows::System::VirtualKey::Escape)
|
||||
else if (e.OriginalKey() == Windows::System::VirtualKey::Escape)
|
||||
{
|
||||
// User wants to discard the changes they made
|
||||
WindowRenamerTextBox().Text(WindowName());
|
||||
WindowRenamer().IsOpen(false);
|
||||
_renamerPressedEnter = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void Create();
|
||||
|
||||
bool ShouldUsePersistedLayout(Microsoft::Terminal::Settings::Model::CascadiaSettings& settings) const;
|
||||
bool ShouldImmediatelyHandoffToElevated(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings) const;
|
||||
void HandoffToElevated(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
|
||||
std::optional<uint32_t> LoadPersistedLayoutIdx(Microsoft::Terminal::Settings::Model::CascadiaSettings& settings) const;
|
||||
winrt::Microsoft::Terminal::Settings::Model::WindowLayout LoadPersistedLayout(Microsoft::Terminal::Settings::Model::CascadiaSettings& settings) const;
|
||||
Microsoft::Terminal::Settings::Model::WindowLayout GetWindowLayout();
|
||||
@@ -215,12 +213,6 @@ namespace winrt::TerminalApp::implementation
|
||||
std::shared_ptr<Toast> _windowIdToast{ nullptr };
|
||||
std::shared_ptr<Toast> _windowRenameFailedToast{ nullptr };
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::TextBox::LayoutUpdated_revoker _renamerLayoutUpdatedRevoker;
|
||||
int _renamerLayoutCount{ 0 };
|
||||
bool _renamerPressedEnter{ false };
|
||||
|
||||
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowDialogHelper(const std::wstring_view& name);
|
||||
|
||||
void _ShowAboutDialog();
|
||||
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowQuitDialog();
|
||||
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowCloseWarningDialog();
|
||||
@@ -234,9 +226,9 @@ namespace winrt::TerminalApp::implementation
|
||||
void _CreateNewTabFromPane(std::shared_ptr<Pane> pane);
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _CreateConnectionFromSettings(Microsoft::Terminal::Settings::Model::Profile profile, Microsoft::Terminal::Settings::Model::TerminalSettings settings);
|
||||
|
||||
winrt::fire_and_forget _OpenNewWindow(const Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
|
||||
winrt::fire_and_forget _OpenNewWindow(const bool elevate, const Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
|
||||
|
||||
void _OpenNewTerminalViaDropdown(const Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
|
||||
void _OpenNewTerminal(const Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
|
||||
|
||||
bool _displayingCloseDialog{ false };
|
||||
void _SettingsButtonOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
|
||||
@@ -417,7 +409,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _WindowRenamerActionClick(const IInspectable& sender, const IInspectable& eventArgs);
|
||||
void _RequestWindowRename(const winrt::hstring& newName);
|
||||
void _WindowRenamerKeyDown(const IInspectable& sender, winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
|
||||
void _WindowRenamerKeyUp(const IInspectable& sender, winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
|
||||
|
||||
void _UpdateTeachingTipTheme(winrt::Windows::UI::Xaml::FrameworkElement element);
|
||||
|
||||
@@ -21,14 +21,11 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<local:TabRowControl x:Name="TabRow"
|
||||
Grid.Row="0"
|
||||
KeyUp="_KeyDownHandler" />
|
||||
Grid.Row="0" />
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<StackPanel Grid.Row="1">
|
||||
<mux:InfoBar x:Name="KeyboardServiceWarningInfoBar"
|
||||
x:Load="False"
|
||||
CornerRadius="0"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
@@ -43,7 +40,6 @@
|
||||
<mux:InfoBar x:Name="CloseOnExitInfoBar"
|
||||
x:Uid="CloseOnExitInfoBar"
|
||||
x:Load="False"
|
||||
CornerRadius="0"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
@@ -58,7 +54,6 @@
|
||||
x:Uid="SetAsDefaultInfoBar"
|
||||
x:Load="False"
|
||||
CloseButtonClick="_SetAsDefaultDismissHandler"
|
||||
CornerRadius="0"
|
||||
IsClosable="True"
|
||||
IsIconVisible="True"
|
||||
IsOpen="False"
|
||||
@@ -75,26 +70,8 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
|
||||
<!--
|
||||
GH#12775 et. al: After switching to ControlsV2, it seems that
|
||||
delay-loading a dialog causes the ContentDialog to be assigned a
|
||||
Height equal to it's content size. If we DON'T assign the
|
||||
ContentDialog a Row, I believe it's assigned Row 0 by default. So,
|
||||
when the dialog gets opened, the dialog seemingly causes a giant
|
||||
hole to appear in the body of the app.
|
||||
|
||||
Assigning all the dialogs to Row 2 (where the rest of the content
|
||||
is) makes the "hole" appear in the same space as the rest of the
|
||||
TabContent, fixing the issue.
|
||||
|
||||
Note that the actual content in a content dialog gets parented to
|
||||
the PopupRoot, so it actually always appeared in the correct place, it's
|
||||
just this weird hole that appeared in Row 0.
|
||||
-->
|
||||
|
||||
<ContentDialog x:Name="AboutDialog"
|
||||
x:Uid="AboutDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Close">
|
||||
<StackPanel Orientation="Vertical">
|
||||
@@ -116,25 +93,21 @@
|
||||
|
||||
<ContentDialog x:Name="QuitDialog"
|
||||
x:Uid="QuitDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary" />
|
||||
|
||||
<ContentDialog x:Name="CloseAllDialog"
|
||||
x:Uid="CloseAllDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary" />
|
||||
|
||||
<ContentDialog x:Name="CloseReadOnlyDialog"
|
||||
x:Uid="CloseReadOnlyDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Close" />
|
||||
|
||||
<ContentDialog x:Name="MultiLinePasteDialog"
|
||||
x:Uid="MultiLinePasteDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary">
|
||||
<StackPanel>
|
||||
@@ -154,13 +127,11 @@
|
||||
|
||||
<ContentDialog x:Name="LargePasteDialog"
|
||||
x:Uid="LargePasteDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary" />
|
||||
|
||||
<ContentDialog x:Name="ControlNoticeDialog"
|
||||
x:Uid="ControlNoticeDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary">
|
||||
<TextBlock IsTextSelectionEnabled="True"
|
||||
@@ -171,7 +142,6 @@
|
||||
|
||||
<ContentDialog x:Name="CouldNotOpenUriDialog"
|
||||
x:Uid="CouldNotOpenUriDialog"
|
||||
Grid.Row="2"
|
||||
x:Load="False"
|
||||
DefaultButton="Primary">
|
||||
<TextBlock IsTextSelectionEnabled="True"
|
||||
@@ -213,7 +183,6 @@
|
||||
IsLightDismissEnabled="True">
|
||||
<mux:TeachingTip.Content>
|
||||
<TextBox x:Name="WindowRenamerTextBox"
|
||||
KeyDown="_WindowRenamerKeyDown"
|
||||
KeyUp="_WindowRenamerKeyUp"
|
||||
Text="{x:Bind WindowName, Mode=OneWay}" />
|
||||
</mux:TeachingTip.Content>
|
||||
|
||||
@@ -1178,7 +1178,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// "Color..."
|
||||
Controls::MenuFlyoutItem chooseColorMenuItem;
|
||||
Controls::FontIcon colorPickSymbol;
|
||||
colorPickSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
colorPickSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
colorPickSymbol.Glyph(L"\xE790");
|
||||
|
||||
chooseColorMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -1209,7 +1209,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// "Rename Tab"
|
||||
Controls::FontIcon renameTabSymbol;
|
||||
renameTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
renameTabSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
renameTabSymbol.Glyph(L"\xE8AC"); // Rename
|
||||
|
||||
renameTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -1226,7 +1226,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// "Duplicate Tab"
|
||||
Controls::FontIcon duplicateTabSymbol;
|
||||
duplicateTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
duplicateTabSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
duplicateTabSymbol.Glyph(L"\xF5ED");
|
||||
|
||||
duplicateTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -1243,7 +1243,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// "Split Tab"
|
||||
Controls::FontIcon splitTabSymbol;
|
||||
splitTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
splitTabSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
splitTabSymbol.Glyph(L"\xF246"); // ViewDashboard
|
||||
|
||||
splitTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -1260,7 +1260,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// "Split Tab"
|
||||
Controls::FontIcon exportTabSymbol;
|
||||
exportTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
|
||||
exportTabSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
exportTabSymbol.Glyph(L"\xE74E"); // Save
|
||||
|
||||
exportTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
@@ -1398,40 +1398,17 @@ namespace winrt::TerminalApp::implementation
|
||||
Media::SolidColorBrush selectedTabBrush{};
|
||||
Media::SolidColorBrush deselectedTabBrush{};
|
||||
Media::SolidColorBrush fontBrush{};
|
||||
Media::SolidColorBrush secondaryFontBrush{};
|
||||
Media::SolidColorBrush hoverTabBrush{};
|
||||
Media::SolidColorBrush subtleFillColorSecondaryBrush;
|
||||
Media::SolidColorBrush subtleFillColorTertiaryBrush;
|
||||
// calculate the luminance of the current color and select a font
|
||||
// color based on that
|
||||
// see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
||||
if (TerminalApp::ColorHelper::IsBrightColor(color))
|
||||
{
|
||||
fontBrush.Color(winrt::Windows::UI::Colors::Black());
|
||||
auto secondaryFontColor = winrt::Windows::UI::Colors::Black();
|
||||
// For alpha value see: https://github.com/microsoft/microsoft-ui-xaml/blob/7a33ad772d77d908aa6b316ec24e6d2eb3ebf571/dev/CommonStyles/Common_themeresources_any.xaml#L269
|
||||
secondaryFontColor.A = 0x9E;
|
||||
secondaryFontBrush.Color(secondaryFontColor);
|
||||
auto subtleFillColorSecondary = winrt::Windows::UI::Colors::Black();
|
||||
subtleFillColorSecondary.A = 0x09;
|
||||
subtleFillColorSecondaryBrush.Color(subtleFillColorSecondary);
|
||||
auto subtleFillColorTertiary = winrt::Windows::UI::Colors::Black();
|
||||
subtleFillColorTertiary.A = 0x06;
|
||||
subtleFillColorTertiaryBrush.Color(subtleFillColorTertiary);
|
||||
}
|
||||
else
|
||||
{
|
||||
fontBrush.Color(winrt::Windows::UI::Colors::White());
|
||||
auto secondaryFontColor = winrt::Windows::UI::Colors::White();
|
||||
// For alpha value see: https://github.com/microsoft/microsoft-ui-xaml/blob/7a33ad772d77d908aa6b316ec24e6d2eb3ebf571/dev/CommonStyles/Common_themeresources_any.xaml#L14
|
||||
secondaryFontColor.A = 0xC5;
|
||||
secondaryFontBrush.Color(secondaryFontColor);
|
||||
auto subtleFillColorSecondary = winrt::Windows::UI::Colors::White();
|
||||
subtleFillColorSecondary.A = 0x0F;
|
||||
subtleFillColorSecondaryBrush.Color(subtleFillColorSecondary);
|
||||
auto subtleFillColorTertiary = winrt::Windows::UI::Colors::White();
|
||||
subtleFillColorTertiary.A = 0x0A;
|
||||
subtleFillColorTertiaryBrush.Color(subtleFillColorTertiary);
|
||||
}
|
||||
|
||||
hoverTabBrush.Color(TerminalApp::ColorHelper::GetAccentColor(color));
|
||||
@@ -1468,14 +1445,6 @@ namespace winrt::TerminalApp::implementation
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPressed"), secondaryFontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPointerOver"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderPressedCloseButtonForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderPointerOverCloseButtonForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), subtleFillColorTertiaryBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), subtleFillColorSecondaryBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundPressed"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundPointerOver"), fontBrush);
|
||||
@@ -1512,22 +1481,12 @@ namespace winrt::TerminalApp::implementation
|
||||
L"TabViewItemHeaderBackground",
|
||||
L"TabViewItemHeaderBackgroundSelected",
|
||||
L"TabViewItemHeaderBackgroundPointerOver",
|
||||
L"TabViewItemHeaderBackgroundPressed",
|
||||
L"TabViewItemHeaderForeground",
|
||||
L"TabViewItemHeaderForegroundSelected",
|
||||
L"TabViewItemHeaderForegroundPointerOver",
|
||||
L"TabViewItemHeaderBackgroundPressed",
|
||||
L"TabViewItemHeaderForegroundPressed",
|
||||
L"TabViewItemHeaderCloseButtonForeground",
|
||||
L"TabViewItemHeaderCloseButtonForegroundPressed",
|
||||
L"TabViewItemHeaderCloseButtonForegroundPointerOver",
|
||||
L"TabViewItemHeaderPressedCloseButtonForeground",
|
||||
L"TabViewItemHeaderPointerOverCloseButtonForeground",
|
||||
L"TabViewItemHeaderSelectedCloseButtonForeground",
|
||||
L"TabViewItemHeaderCloseButtonBackgroundPressed",
|
||||
L"TabViewItemHeaderCloseButtonBackgroundPointerOver",
|
||||
L"TabViewButtonForegroundActiveTab",
|
||||
L"TabViewButtonForegroundPressed",
|
||||
L"TabViewButtonForegroundPointerOver"
|
||||
L"TabViewButtonForegroundActiveTab"
|
||||
};
|
||||
|
||||
// simply clear any of the colors in the tab's dict
|
||||
|
||||
@@ -43,12 +43,5 @@
|
||||
<local:MinMaxCloseControl x:Name="MinMaxCloseControl"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right" />
|
||||
|
||||
<!-- This border needs to be added manually until GH#10320 is fixed -->
|
||||
<Border Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Height="1"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -89,13 +89,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||
</Target>
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.1" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.2-prerelease.220406002" targetFramework="native" />
|
||||
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
<package id="Microsoft.PGO-Helpers.Cpp" version="0.2.22" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||
<package id="vcpkg-cpprestsdk" version="2.10.14" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.PGO-Helpers.Cpp" version="0.2.34" targetFramework="native" />
|
||||
<package id="Microsoft.PGO-Helpers.Cpp" version="0.2.22" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -478,7 +478,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
if (_renderEngine)
|
||||
{
|
||||
_renderEngine->EnableTransparentBackground(_isBackgroundTransparent());
|
||||
_renderer->NotifyPaintFrame();
|
||||
}
|
||||
|
||||
auto eventArgs = winrt::make_self<TransparencyChangedEventArgs>(newOpacity);
|
||||
@@ -620,7 +619,19 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_runtimeUseAcrylic = true;
|
||||
}
|
||||
|
||||
const auto sizeChanged = _setFontSizeUnderLock(_settings->FontSize());
|
||||
// Initialize our font information.
|
||||
const auto fontFace = _settings->FontFace();
|
||||
const short fontHeight = ::base::saturated_cast<short>(_settings->FontSize());
|
||||
const auto fontWeight = _settings->FontWeight();
|
||||
// The font width doesn't terribly matter, we'll only be using the
|
||||
// height to look it up
|
||||
// The other params here also largely don't matter.
|
||||
// The family is only used to determine if the font is truetype or
|
||||
// not, but DX doesn't use that info at all.
|
||||
// The Codepage is additionally not actually used by the DX engine at all.
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, fontHeight }, CP_UTF8, false };
|
||||
_actualFontFaceName = { fontFace };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
// Update the terminal core with its new Core settings
|
||||
_terminal->UpdateSettings(*_settings);
|
||||
@@ -639,7 +650,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
_updateAntiAliasingMode();
|
||||
|
||||
if (sizeChanged)
|
||||
// Refresh our font with the renderer
|
||||
const auto actualFontOldSize = _actualFont.GetSize();
|
||||
_updateFont();
|
||||
const auto actualFontNewSize = _actualFont.GetSize();
|
||||
if (actualFontNewSize != actualFontOldSize)
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
@@ -752,22 +767,30 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - Set the font size of the terminal control.
|
||||
// Arguments:
|
||||
// - fontSize: The size of the font.
|
||||
// Return Value:
|
||||
// - Returns true if you need to call _refreshSizeUnderLock().
|
||||
bool ControlCore::_setFontSizeUnderLock(int fontSize)
|
||||
void ControlCore::_setFontSize(int fontSize)
|
||||
{
|
||||
// Make sure we have a non-zero font size
|
||||
const auto newSize = std::max<short>(gsl::narrow_cast<short>(fontSize), 1);
|
||||
const auto fontFace = _settings->FontFace();
|
||||
const auto fontWeight = _settings->FontWeight();
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, newSize }, CP_UTF8, false };
|
||||
_actualFontFaceName = { fontFace };
|
||||
_desiredFont = { _actualFont };
|
||||
try
|
||||
{
|
||||
// Make sure we have a non-zero font size
|
||||
const auto newSize = std::max<short>(gsl::narrow_cast<short>(fontSize), 1);
|
||||
const auto fontFace = _settings->FontFace();
|
||||
const auto fontWeight = _settings->FontWeight();
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, newSize }, CP_UTF8, false };
|
||||
_actualFontFaceName = { fontFace };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
const auto before = _actualFont.GetSize();
|
||||
_updateFont();
|
||||
const auto after = _actualFont.GetSize();
|
||||
return before != after;
|
||||
auto lock = _terminal->LockForWriting();
|
||||
|
||||
// Refresh our font with the renderer
|
||||
_updateFont();
|
||||
|
||||
// Resize the terminal's BUFFER to match the new font size. This does
|
||||
// NOT change the size of the window, because that can lead to more
|
||||
// problems (like what happens when you change the font size while the
|
||||
// window is maximized?)
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -776,12 +799,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - none
|
||||
void ControlCore::ResetFontSize()
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
if (_setFontSizeUnderLock(_settings->FontSize()))
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
_setFontSize(_settings->FontSize());
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -790,12 +808,29 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - fontSizeDelta: The amount to increase or decrease the font size by.
|
||||
void ControlCore::AdjustFontSize(int fontSizeDelta)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
const auto newSize = _desiredFont.GetEngineSize().Y + fontSizeDelta;
|
||||
_setFontSize(newSize);
|
||||
}
|
||||
|
||||
if (_setFontSizeUnderLock(_desiredFont.GetEngineSize().Y + fontSizeDelta))
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
// Method Description:
|
||||
// - Perform a resize for the current size of the swapchainpanel. If the
|
||||
// font size changed, we'll need to resize the buffer to fit the existing
|
||||
// swapchain size. This helper will call _doResizeUnderLock with the
|
||||
// current size of the swapchain, accounting for scaling due to DPI.
|
||||
// - Note that a DPI change will also trigger a font size change, and will
|
||||
// call into here.
|
||||
// - The write lock should be held when calling this method, we might be
|
||||
// changing the buffer size in _doResizeUnderLock.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ControlCore::_refreshSizeUnderLock()
|
||||
{
|
||||
const auto widthInPixels = _panelWidth * _compositionScale;
|
||||
const auto heightInPixels = _panelHeight * _compositionScale;
|
||||
|
||||
_doResizeUnderLock(widthInPixels, heightInPixels);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -803,33 +838,39 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// be due to the user resizing the window (causing the swapchain to
|
||||
// resize) or due to the DPI changing (causing us to need to resize the
|
||||
// buffer to match)
|
||||
// - Note that a DPI change will also trigger a font size change, and will
|
||||
// call into here.
|
||||
// - The write lock should be held when calling this method, we might be
|
||||
// changing the buffer size in _refreshSizeUnderLock.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ControlCore::_refreshSizeUnderLock()
|
||||
// - newWidth: the new width of the swapchain, in pixels.
|
||||
// - newHeight: the new height of the swapchain, in pixels.
|
||||
void ControlCore::_doResizeUnderLock(const double newWidth,
|
||||
const double newHeight)
|
||||
{
|
||||
auto cx = gsl::narrow_cast<short>(_panelWidth * _compositionScale);
|
||||
auto cy = gsl::narrow_cast<short>(_panelHeight * _compositionScale);
|
||||
SIZE size;
|
||||
size.cx = static_cast<long>(newWidth);
|
||||
size.cy = static_cast<long>(newHeight);
|
||||
|
||||
// Don't actually resize so small that a single character wouldn't fit
|
||||
// in either dimension. The buffer really doesn't like being size 0.
|
||||
cx = std::max(cx, _actualFont.GetSize().X);
|
||||
cy = std::max(cy, _actualFont.GetSize().Y);
|
||||
if (size.cx < _actualFont.GetSize().X || size.cy < _actualFont.GetSize().Y)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert our new dimensions to characters
|
||||
const auto viewInPixels = Viewport::FromDimensions({ 0, 0 }, { cx, cy });
|
||||
const auto viewInPixels = Viewport::FromDimensions({ 0, 0 },
|
||||
{ static_cast<short>(size.cx), static_cast<short>(size.cy) });
|
||||
const auto vp = _renderEngine->GetViewportInCharacters(viewInPixels);
|
||||
const auto currentVP = _terminal->GetViewport();
|
||||
|
||||
// Don't actually resize if viewport dimensions didn't change
|
||||
if (vp.Height() == currentVP.Height() && vp.Width() == currentVP.Width())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_terminal->ClearSelection();
|
||||
|
||||
// Tell the dx engine that our window is now the new size.
|
||||
THROW_IF_FAILED(_renderEngine->SetWindowSize({ cx, cy }));
|
||||
THROW_IF_FAILED(_renderEngine->SetWindowSize(size));
|
||||
|
||||
// Invalidate everything
|
||||
_renderer->TriggerRedrawAll();
|
||||
@@ -846,18 +887,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void ControlCore::SizeChanged(const double width,
|
||||
const double height)
|
||||
{
|
||||
// _refreshSizeUnderLock redraws the entire terminal.
|
||||
// Don't call it if we don't have to.
|
||||
if (_panelWidth == width && _panelHeight == height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_panelWidth = width;
|
||||
_panelHeight = height;
|
||||
|
||||
auto lock = _terminal->LockForWriting();
|
||||
_refreshSizeUnderLock();
|
||||
const auto currentEngineScale = _renderEngine->GetScaling();
|
||||
|
||||
auto scaledWidth = width * currentEngineScale;
|
||||
auto scaledHeight = height * currentEngineScale;
|
||||
_doResizeUnderLock(scaledWidth, scaledHeight);
|
||||
}
|
||||
|
||||
void ControlCore::ScaleChanged(const double scale)
|
||||
@@ -867,19 +905,33 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
// _refreshSizeUnderLock redraws the entire terminal.
|
||||
// Don't call it if we don't have to.
|
||||
if (_compositionScale == scale)
|
||||
const auto currentEngineScale = _renderEngine->GetScaling();
|
||||
// If we're getting a notification to change to the DPI we already
|
||||
// have, then we're probably just beginning the DPI change. Since
|
||||
// we'll get _another_ event with the real DPI, do nothing here for
|
||||
// now. We'll also skip the next resize in _swapChainSizeChanged.
|
||||
const bool dpiWasUnchanged = currentEngineScale == scale;
|
||||
if (dpiWasUnchanged)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_compositionScale = scale;
|
||||
const auto dpi = (float)(scale * USER_DEFAULT_SCREEN_DPI);
|
||||
|
||||
const auto actualFontOldSize = _actualFont.GetSize();
|
||||
|
||||
auto lock = _terminal->LockForWriting();
|
||||
// _updateFont relies on the new _compositionScale set above
|
||||
_updateFont();
|
||||
_refreshSizeUnderLock();
|
||||
_compositionScale = scale;
|
||||
|
||||
_renderer->TriggerFontChange(::base::saturated_cast<int>(dpi),
|
||||
_desiredFont,
|
||||
_actualFont);
|
||||
|
||||
const auto actualFontNewSize = _actualFont.GetSize();
|
||||
if (actualFontNewSize != actualFontOldSize)
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
}
|
||||
|
||||
void ControlCore::SetSelectionAnchor(til::point const& position)
|
||||
@@ -1263,18 +1315,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
::Search search(*GetUiaData(), text.c_str(), direction, sensitivity);
|
||||
auto lock = _terminal->LockForWriting();
|
||||
const bool foundMatch{ search.FindNext() };
|
||||
if (foundMatch)
|
||||
if (search.FindNext())
|
||||
{
|
||||
_terminal->SetBlockSelection(false);
|
||||
search.Select();
|
||||
_renderer->TriggerSelection();
|
||||
}
|
||||
|
||||
// Raise a FoundMatch event, which the control will use to notify
|
||||
// narrator if there was any results in the buffer
|
||||
auto foundResults = winrt::make_self<implementation::FoundResultsArgs>(foundMatch);
|
||||
_FoundMatchHandlers(*this, *foundResults);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1672,8 +1718,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return _settings->HasUnfocusedAppearance();
|
||||
}
|
||||
|
||||
void ControlCore::AdjustOpacity(const double opacityAdjust, const bool relative)
|
||||
void ControlCore::AdjustOpacity(const int32_t& opacity, const bool& relative)
|
||||
{
|
||||
const double opacityAdjust = static_cast<double>(opacity) / 100.0;
|
||||
if (relative)
|
||||
{
|
||||
AdjustOpacity(opacityAdjust);
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
static bool IsVintageOpacityAvailable() noexcept;
|
||||
|
||||
void AdjustOpacity(const double opacity, const bool relative);
|
||||
void AdjustOpacity(const int32_t& opacity, const bool& relative);
|
||||
|
||||
RUNTIME_SETTING(double, Opacity, _settings->Opacity());
|
||||
RUNTIME_SETTING(bool, UseAcrylic, _settings->UseAcrylic());
|
||||
@@ -191,7 +191,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
TYPED_EVENT(RaiseNotice, IInspectable, Control::NoticeEventArgs);
|
||||
TYPED_EVENT(TransparencyChanged, IInspectable, Control::TransparencyChangedEventArgs);
|
||||
TYPED_EVENT(ReceivedOutput, IInspectable, IInspectable);
|
||||
TYPED_EVENT(FoundMatch, IInspectable, Control::FoundResultsArgs);
|
||||
// clang-format on
|
||||
|
||||
private:
|
||||
@@ -242,9 +241,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
winrt::fire_and_forget _asyncCloseConnection();
|
||||
|
||||
bool _setFontSizeUnderLock(int fontSize);
|
||||
void _setFontSize(int fontSize);
|
||||
void _updateFont(const bool initialUpdate = false);
|
||||
void _refreshSizeUnderLock();
|
||||
void _doResizeUnderLock(const double newWidth,
|
||||
const double newHeight);
|
||||
|
||||
void _sendInputToConnection(std::wstring_view wstr);
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace Microsoft.Terminal.Control
|
||||
String FontFaceName { get; };
|
||||
UInt16 FontWeight { get; };
|
||||
Double Opacity { get; };
|
||||
Boolean UseAcrylic { get; };
|
||||
|
||||
Boolean TrySendKeyEvent(Int16 vkey,
|
||||
Int16 scanCode,
|
||||
@@ -99,7 +98,7 @@ namespace Microsoft.Terminal.Control
|
||||
|
||||
String ReadEntireBuffer();
|
||||
|
||||
void AdjustOpacity(Double Opacity, Boolean relative);
|
||||
void AdjustOpacity(Int32 Opacity, Boolean relative);
|
||||
|
||||
event FontSizeChangedEventArgs FontSizeChanged;
|
||||
|
||||
@@ -119,7 +118,6 @@ namespace Microsoft.Terminal.Control
|
||||
event Windows.Foundation.TypedEventHandler<Object, NoticeEventArgs> RaiseNotice;
|
||||
event Windows.Foundation.TypedEventHandler<Object, TransparencyChangedEventArgs> TransparencyChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> ReceivedOutput;
|
||||
event Windows.Foundation.TypedEventHandler<Object, FoundResultsArgs> FoundMatch;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// clipboardDataHandler. This is called when the clipboard data is
|
||||
// loaded.
|
||||
auto clipboardDataHandler = std::bind(&ControlInteractivity::_sendPastedTextToConnection, this, std::placeholders::_1);
|
||||
auto pasteArgs = winrt::make_self<PasteFromClipboardEventArgs>(clipboardDataHandler, _core->BracketedPasteEnabled());
|
||||
auto pasteArgs = winrt::make_self<PasteFromClipboardEventArgs>(clipboardDataHandler);
|
||||
|
||||
// send paste event up to TermApp
|
||||
_PasteFromClipboardHandlers(*this, *pasteArgs);
|
||||
|
||||
@@ -11,4 +11,3 @@
|
||||
#include "ScrollPositionChangedArgs.g.cpp"
|
||||
#include "RendererWarningArgs.g.cpp"
|
||||
#include "TransparencyChangedEventArgs.g.cpp"
|
||||
#include "FoundResultsArgs.g.cpp"
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "ScrollPositionChangedArgs.g.h"
|
||||
#include "RendererWarningArgs.g.h"
|
||||
#include "TransparencyChangedEventArgs.g.h"
|
||||
#include "FoundResultsArgs.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
@@ -54,17 +53,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
struct PasteFromClipboardEventArgs : public PasteFromClipboardEventArgsT<PasteFromClipboardEventArgs>
|
||||
{
|
||||
public:
|
||||
PasteFromClipboardEventArgs(std::function<void(std::wstring_view)> clipboardDataHandler, bool bracketedPasteEnabled) :
|
||||
m_clipboardDataHandler(clipboardDataHandler),
|
||||
_BracketedPasteEnabled{ bracketedPasteEnabled } {}
|
||||
PasteFromClipboardEventArgs(std::function<void(std::wstring_view)> clipboardDataHandler) :
|
||||
m_clipboardDataHandler(clipboardDataHandler) {}
|
||||
|
||||
void HandleClipboardData(hstring value)
|
||||
{
|
||||
m_clipboardDataHandler(value);
|
||||
};
|
||||
|
||||
WINRT_PROPERTY(bool, BracketedPasteEnabled, false);
|
||||
|
||||
private:
|
||||
std::function<void(std::wstring_view)> m_clipboardDataHandler;
|
||||
};
|
||||
@@ -134,15 +130,4 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
WINRT_PROPERTY(double, Opacity);
|
||||
};
|
||||
|
||||
struct FoundResultsArgs : public FoundResultsArgsT<FoundResultsArgs>
|
||||
{
|
||||
public:
|
||||
FoundResultsArgs(const bool foundMatch) :
|
||||
_FoundMatch(foundMatch)
|
||||
{
|
||||
}
|
||||
|
||||
WINRT_PROPERTY(bool, FoundMatch);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Microsoft.Terminal.Control
|
||||
runtimeclass PasteFromClipboardEventArgs
|
||||
{
|
||||
void HandleClipboardData(String data);
|
||||
Boolean BracketedPasteEnabled { get; };
|
||||
}
|
||||
|
||||
runtimeclass OpenHyperlinkEventArgs
|
||||
@@ -68,10 +67,4 @@ namespace Microsoft.Terminal.Control
|
||||
{
|
||||
Double Opacity { get; };
|
||||
}
|
||||
|
||||
|
||||
runtimeclass FoundResultsArgs
|
||||
{
|
||||
Boolean FoundMatch { get; };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,11 +93,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_CursorChangedHandlers(*this, nullptr);
|
||||
}
|
||||
|
||||
void InteractivityAutomationPeer::NotifyNewOutput(std::wstring_view newOutput)
|
||||
{
|
||||
_NewOutputHandlers(*this, hstring{ newOutput });
|
||||
}
|
||||
|
||||
#pragma region ITextProvider
|
||||
com_array<XamlAutomation::ITextRangeProvider> InteractivityAutomationPeer::GetSelection()
|
||||
{
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void SignalSelectionChanged() override;
|
||||
void SignalTextChanged() override;
|
||||
void SignalCursorChanged() override;
|
||||
void NotifyNewOutput(std::wstring_view newOutput) override;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ITextProvider Pattern
|
||||
@@ -74,7 +73,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
TYPED_EVENT(SelectionChanged, IInspectable, IInspectable);
|
||||
TYPED_EVENT(TextChanged, IInspectable, IInspectable);
|
||||
TYPED_EVENT(CursorChanged, IInspectable, IInspectable);
|
||||
TYPED_EVENT(NewOutput, IInspectable, hstring);
|
||||
|
||||
private:
|
||||
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider _CreateXamlUiaTextRange(::ITextRangeProvider* returnVal) const;
|
||||
|
||||
@@ -14,6 +14,5 @@ namespace Microsoft.Terminal.Control
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> SelectionChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> TextChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> CursorChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, String> NewOutput;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user