
I installed Windows Terminal and expected the wt command to work system-wide. It did not. This is the step-by-step account of what I received, how I reasoned about the problem, and how I solved it.
These are the key outputs and messages I saw as I debugged the problem.
PS C:\Users\Admin> Get-AppxPackage *WindowsTerminal* | Select InstallLocation
InstallLocation
---------------
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.12681.0_x64__8wekyb3d8bbwe
wt not recognized when called directly:PS C:\Users\Admin> wt -d $PWD
wt : The term 'wt' is not recognized as the name of a cmdlet, function, script file, or operable program.
...
& "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.12681.0_x64__8wekyb3d8bbwe\wt.exe"
# Windows Terminal opened
setx produced truncation warning and did not solve the problem:WARNING: The data being saved is truncated to 1024 characters.
SUCCESS: Specified value was saved.
PS C:\Users\Admin> wt -d $PWD
# Windows Terminal opened in the current directory
wt normally. The error indicates PATH resolution, not a broken binary.C:\Users\<User>\AppData\Local\Microsoft\WindowsApps. If missing, add it.setx because it truncates long PATH values to 1024 characters. Use the .NET API to update the user PATH without truncation and avoid duplicates.Get-AppxPackage *WindowsTerminal* | Select InstallLocation
& "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.12681.0_x64__8wekyb3d8bbwe\wt.exe"
$env:PATH -split ';'
setx PATH "$($env:PATH);$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps"
# WARNING: truncated to 1024 characters
$oldPath = [Environment]::GetEnvironmentVariable("PATH", "User")
$newPath = $oldPath.Split(';') | ForEach-Object { $_ } | Where-Object { $_ -ne "$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps" }
$newPath = ($newPath + "$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps") -join ";"
[Environment]::SetEnvironmentVariable("PATH", $newPath, "User")
Then close all shells and open a new PowerShell session.
wt -d $PWD
After updating the PATH using the .NET API, wt resolved correctly and opened Windows Terminal in the current working directory. The installation was never the problem; the execution alias folder was simply not present in the PATH until I appended it correctly.
setx for long PATH edits; it truncates to 1024 characters.wt still fails after PATH is correct, check Settings → Apps → App execution aliases to ensure wt.exe is enabled.C:\Program Files\WindowsApps\….--Mohammad