diff --git a/packages/windows-terminal.vm/tools/chocolateyinstall.ps1 b/packages/windows-terminal.vm/tools/chocolateyinstall.ps1 index 010f34ab6..bc8c19d28 100644 --- a/packages/windows-terminal.vm/tools/chocolateyinstall.ps1 +++ b/packages/windows-terminal.vm/tools/chocolateyinstall.ps1 @@ -40,6 +40,7 @@ try { $defaultSettings = @" { "`$schema": "https://aka.ms/terminal-settings-schema-v1.1", + "defaultProfile": "Command Prompt", "profiles": { "defaults": { "elevate": true @@ -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) + $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 $_ } diff --git a/packages/windows-terminal.vm/tools/chocolateyuninstall.ps1 b/packages/windows-terminal.vm/tools/chocolateyuninstall.ps1 index 4032541eb..b008d1318 100644 --- a/packages/windows-terminal.vm/tools/chocolateyuninstall.ps1 +++ b/packages/windows-terminal.vm/tools/chocolateyuninstall.ps1 @@ -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 diff --git a/packages/windows-terminal.vm/windows-terminal.vm.nuspec b/packages/windows-terminal.vm/windows-terminal.vm.nuspec index 6965ead68..a070c96b5 100644 --- a/packages/windows-terminal.vm/windows-terminal.vm.nuspec +++ b/packages/windows-terminal.vm/windows-terminal.vm.nuspec @@ -2,7 +2,7 @@ windows-terminal.vm - 1.19.10573.20240402 + 1.19.10573.20240614 Microsoft Windows Terminal is a new, modern, feature-rich, productive terminal application for command-line users.