Skip to content

Commit

Permalink
Set the Windows Terminal as the default terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
d35ha committed Jun 14, 2024
1 parent a0c9e86 commit a1787a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/windows-terminal.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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 $_
}
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

0 comments on commit a1787a9

Please sign in to comment.