Repository navigation
fix(plugins): skip Windows Terminal's wt in the pi, omp, and OpenCode plugins - #4698
Merged
Merged
Conversation
… plugins The three TypeScript plugins ran a bare `wt`, which on Windows is usually Windows Terminal's app-execution alias: it exits 0 and opens an error window for every marker update, and OpenCode's worktree switch/remove never reach worktrunk. Each plugin now picks the binary the way hooks/wt.sh does: WORKTRUNK_BIN, then git-wt.exe, then a wt.exe that isn't under WindowsApps. Closes #4697
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pi, oh-my-pi, and OpenCode plugins ran a bare
wt. On Windows that name usually resolves to Windows Terminal's app-execution alias in%LOCALAPPDATA%\Microsoft\WindowsApps. The alias exits 0 and reports the unknown program in a popup, so every activity-marker update opened an error window. OpenCode's worktreeswitch/removestrategy also never reached worktrunk. The Claude Code and Codex hooks didn't have this problem because they run throughplugins/worktrunk/hooks/wt.sh, which already handles this case.Each plugin now has a small
worktrunkBin()that followswt.sh's policy: useWORKTRUNK_BINif set, otherwise usewtoff Windows. On Windows, it walksPATHin order and prefersgit-wt.exe, then accepts awt.exeonly if the first one found isn't underWindowsApps. When nothing usable is found, marker updates are skipped, and OpenCode's strategy throws an error naminggit-wt.exeandWORKTRUNK_BIN. The helper is copied into all three files because each one is installed as a standalone file.Verification: dev/*.ts has no test harness, so I checked locally with Node 22's type stripping. The check fakes
process.platform = "win32", builds aPATHwith aWindowsApps/wt.exeahead of a realwt.exe, and stubspi.exec. Before this change, both the pi and omp plugins execwt(the Terminal alias). After it, they skip; they pickgit-wt.exewhen it's present andwtwhen the real binary comes first onPATH. OpenCode's strategy surfaces the new error. The existing plugin install/config integration tests pass.Not verified on Windows: I couldn't run a real Windows host.
lstatis used instead ofexistsso the alias's reparse point still counts as present, which keeps the search order the same as Windows' own lookup. It's worth a check on a Windows machine with the Terminal alias enabled.The issue's other suggestion is still open: warning when a
wton PATH turns out not to be worktrunk. That needs a choice about where a plugin should report it, so it's not in this PR.Closes #4697 — automated triage