Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the Windows Terminal as the default terminal #1093

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/windows-terminal.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ try {
$defaultSettings = @"
{
"`$schema": "https://aka.ms/terminal-settings-schema-v1.1",
"defaultProfile": "Command Prompt",
"profiles": {
"defaults": {
"elevate": true
Expand All @@ -54,6 +55,12 @@ try {
$label = "Open Terminal here"
$icon = "$executablePath"
VM-Add-To-Right-Click-Menu -menuKey $toolName -menuLabel $label -command $command -menuIcon $icon -type "directory" -background

# Set windows terminal as the default terminal (effective only when OS Build >= 19045.3031)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using 10.0.19045.0 (downloaded from the recommended link in FLARE-VM), so this approach does not work

$registryPath = 'HKCU:\Console\%%Startup'
New-Item $registryPath -Force | Out-Null
Set-ItemProperty $registryPath -Name "DelegationConsole" -Value "{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}" -Force | Out-Null
Set-ItemProperty $registryPath -Name "DelegationTerminal" -Value "{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}" -Force | Out-Null
} catch {
VM-Write-Log-Exception $_
}
6 changes: 6 additions & 0 deletions packages/windows-terminal.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ Import-Module vm.common -Force -DisableNameChecking
$toolName = 'Windows Terminal'
$category = 'Productivity Tools'

# Let Windows decide what is the default terminal
$registryPath = 'HKCU:\Console\%%Startup'
New-Item $registryPath -Force | Out-Null
Set-ItemProperty $registryPath -Name "DelegationConsole" -Value "{00000000-0000-0000-0000-000000000000}" -Force | Out-Null
Set-ItemProperty $registryPath -Name "DelegationTerminal" -Value "{00000000-0000-0000-0000-000000000000}" -Force | Out-Null

VM-Uninstall $toolName $category
VM-Remove-From-Right-Click-Menu -menuKey $toolName -type "directory" -background
2 changes: 1 addition & 1 deletion packages/windows-terminal.vm/windows-terminal.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>windows-terminal.vm</id>
<version>1.19.10573.20240402</version>
<version>1.19.10573.20240614</version>
<authors>Microsoft</authors>
<description>Windows Terminal is a new, modern, feature-rich, productive terminal application for command-line users.</description>
<dependencies>
Expand Down
Loading