worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

wt.exe can not find Git Bash because it is installed at user scope

Open JefMasereel opened this issue 9 months ago • 2 comments

I installed worktrunk on my laptop (Windows 11) by downloading the latest Windows binaries and copying wt.exe into a bin folder on my PATH. After disabling the "Windows Terminal" alias I can use the wt CLI in a local CMD session. There it works fine.

But I usually work on my projects in a git bash session. There I get the error below when trying to call commands like wt --help or wt config show. The error originates from the find_git_bash function in shell_exec.rs.

thread 'main' panicked at src\shell_exec.rs:140:5:
Git for Windows is required but not found.
Install from https://git-scm.com/download/win
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The output from which git is /mingw64/bin/git (when in a git bash session), but that directory does not contain a symlink to git-bash.exe. There might be a workaround for this but I did not find it yet. I would like to avoid making changes to my git bash profile if possible.

I had a closer look at the source code and I see that the find_git_bash function also tries the path C:\Program Files\Git\bin\bash.exe if Git Bash is not found via which git. This does not work for me because my Git Bash is not installed at system scope. Because of limited admin rights I can only install it at user scope under C:\Users\my-username\AppData\Local\Programs\Git. As far as I can tell this is the default path when opting for a per-user installation of Git Bash on Windows.

Maybe this scenario could also be included as a second fallback option in the find_git_bash function? I think that would be the cleanest solution to my problem, and it seems like it could also benefit other Windows users.

JefMasereel avatar Mar 04 '26 15:03 JefMasereel

Thanks for reporting this! The root cause is clear: find_git_bash() only falls back to C:\Program Files\Git, missing the per-user install path at %LOCALAPPDATA%\Programs\Git.

I've opened #1261 with a fix that adds the per-user path as an additional fallback. A maintainer will review it shortly.

worktrunk-bot avatar Mar 04 '26 15:03 worktrunk-bot

thanks a lot @JefMasereel , fixed!

max-sixty avatar Mar 04 '26 17:03 max-sixty