Conversation
On macOS with Homebrew (Apple Silicon), overlay subprocesses started via `sh -c` get a minimal PATH without /opt/homebrew/bin. This causes tools like git-lfs to not be found, breaking `git diff` inside revdiff TUI. Fix: capture the caller's PATH and pass it explicitly using each terminal's native env mechanism: - tmux: display-popup -e "PATH=..." - kitty: launch --env "PATH=..." - wezterm: env "PATH=..." sh -c (no native --env flag)
umputun
reviewed
Apr 6, 2026
umputun
left a comment
Owner
There was a problem hiding this comment.
I can't reproduce this on the same setup (macOS + Homebrew + Apple Silicon), and nobody else has reported it. the script already resolves revdiff to an absolute path (line 10), so the binary itself is always found. the issue you describe would only affect tools called internally by git (like git-lfs).
that said, the fix is harmless (no-op when PATH is already inherited) and the approach is correct for each terminal. couple things:
- the script now also has Ghostty, iTerm2, and Emacs vterm sections that use
#!/bin/shlauncher scripts with the same potential issue. if you're fixing PATH inheritance, pls cover those too (addexport PATH="$CALLER_PATH"at the top of each launcher script heredoc) - only tested on kitty per the test plan. I'd like to see at least tmux verified since that's the most common case and
-eflag behavior varies by tmux version
Author
|
definitely this only affects tools called internally by git. |
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.
Problem
On macOS with Homebrew on Apple Silicon,
launch-revdiff.shoverlay subprocesses fail to find tools likegit-lfs. The overlay is started viash -c "$CMD", which gets a minimal PATH without/opt/homebrew/bin. This causesgit diffto fail inside the revdiff TUI:The script itself runs in the user's shell with the full PATH, but the overlay subprocess (kitty
launch, tmuxdisplay-popup, weztermsplit-pane) spawns a freshshthat doesn't inherit it.Fix
Capture the caller's PATH once and pass it explicitly into each overlay using the terminal's native env mechanism:
display-popup -e "PATH=$CALLER_PATH"launch --env "PATH=$CALLER_PATH"env "PATH=$CALLER_PATH" sh -c ...(no native--envflag)This is shell-agnostic (no dependency on zsh/bash/fish), has zero overhead, and fixes the actual problem without login-shell rehydration or hardcoded paths.
Test plan
-eflag)envwrapper)