Skip to content

fix(plugins): skip Windows Terminal's wt in the pi, omp, and OpenCode plugins - #4698

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-4697
Nov 4, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-4697

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

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 worktree switch/remove strategy also never reached worktrunk. The Claude Code and Codex hooks didn't have this problem because they run through plugins/worktrunk/hooks/wt.sh, which already handles this case.

Each plugin now has a small worktrunkBin() that follows wt.sh's policy: use WORKTRUNK_BIN if set, otherwise use wt off Windows. On Windows, it walks PATH in order and prefers git-wt.exe, then accepts a wt.exe only if the first one found isn't under WindowsApps. When nothing usable is found, marker updates are skipped, and OpenCode's strategy throws an error naming git-wt.exe and WORKTRUNK_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 a PATH with a WindowsApps/wt.exe ahead of a real wt.exe, and stubs pi.exec. Before this change, both the pi and omp plugins exec wt (the Terminal alias). After it, they skip; they pick git-wt.exe when it's present and wt when the real binary comes first on PATH. 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. lstat is used instead of exists so 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 wt on 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

… 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
@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Nov 4, 2026
@max-sixty
max-sixty merged commit 3bf9166 into main Nov 4, 2026
36 of 45 checks passed
@max-sixty
max-sixty deleted the fix/issue-4697 branch November 4, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: bundled pi / opencode / omp plugins exec bare wt, which is the Windows Terminal alias

2 participants