Windows 11: installed Edit is shadowed by the inbox System32 edit.exe
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14.6k
- Forks
- 734
- Avg merge
- 8h 40m
- Merged PRs (30d)
- 4
Description
I am seeing the same problem on Windows 11 after installing the current Microsoft Edit release according to the repository instructions.
Reproduction
- Install the newer Microsoft Edit release (for example, 2.0.0) through the documented installation method.
- Open a new PowerShell terminal and run
edit. editstill resolves toC:\Windows\System32\edit.exe(the older inbox version, 1.2.1), because the System32 entry has higher PATH precedence than the newly installed version-specific directory.Get-Command edit.exe -Allshows both executables, but the old system copy is selected first.
This means a normal edit invocation does not use the installed update, even though the installation completed successfully. The PATH workaround is also fragile because the package directory changes on every version update.
For now I have to add a function to my PowerShell $PROFILE that selects the newest installed executable by version:
function edit {
$edit = Get-Command edit.exe -All |
Where-Object {
$_.Version -ge [version]'2.0.0.0'
} |
Sort-Object Version -Descending |
Select-Object -First 1
if ($edit) {
& $edit.Source @args
}
else {
& "$env:WINDIR\System32\edit.exe" @args
}
}
Could the Windows distribution provide a stable shim/link directory or otherwise ensure that the current installed edit.exe takes precedence over the inbox System32 copy? The fix should continue working across upgrades without requiring users to edit PATH or their PowerShell profile each time.
Related issues
- #829 - Winget package path includes a version number, causing PATH conflicts and update breakage
- #860 - How to perfectly install a new version of
editon Windows 11?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the documented Windows installation method, then reproduce the resolution with PowerShell's Get-Command edit.exe -All and the installed version-specific paths. Compare the behavior described in issues #829 and #860; done means a normal edit invocation selects the current installed release across upgrades without PATH or profile changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100