Problem
When Crow is launched as a .app bundle from Finder/Dock, issues don't load. Running with PATH=$PATH ./Crow.app/Contents/MacOS/CrowApp works, confirming the issue is PATH resolution.
macOS gives .app bundles a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin). Tools installed via Homebrew (e.g. gh at /opt/homebrew/bin) are not found by /usr/bin/env. This does not affect make debug / swift run since those inherit the terminal's full environment.
Root Cause
All subprocess execution in the app uses /usr/bin/env to find tools, but never resolves the user's login shell PATH. ProcessInfo.processInfo.environment only has the minimal Finder PATH.
Affected files
Sources/Crow/App/IssueTracker.swift — shell() and shellWithStatus()
Packages/CrowProvider/Sources/CrowProvider/ProviderManager.swift — shell() (also has conditional env bug)
Packages/CrowGit/Sources/CrowGit/GitManager.swift — run() (never sets environment at all)
Sources/Crow/App/AppDelegate.swift — dependency check uses /usr/bin/which with same minimal PATH
Proposed Fix
Add a ShellEnvironment singleton in CrowCore that:
- On first access, runs the user's login shell (
zsh -lc 'echo $PATH') to get the real PATH
- Falls back to appending
/opt/homebrew/bin, /usr/local/bin if shell resolution fails
- Provides
ShellEnvironment.shared.env for all Process calls
- Provides
ShellEnvironment.shared.hasCommand(_:) for tool detection
Then update all 4 files to use the enriched environment.
Reproduction
make release
- Launch
Crow.app from Finder (not terminal)
- Issues panel is empty
- Workaround:
PATH=$PATH ./Crow.app/Contents/MacOS/CrowApp — issues load
Problem
When Crow is launched as a
.appbundle from Finder/Dock, issues don't load. Running withPATH=$PATH ./Crow.app/Contents/MacOS/CrowAppworks, confirming the issue is PATH resolution.macOS gives
.appbundles a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin). Tools installed via Homebrew (e.g.ghat/opt/homebrew/bin) are not found by/usr/bin/env. This does not affectmake debug/swift runsince those inherit the terminal's full environment.Root Cause
All subprocess execution in the app uses
/usr/bin/envto find tools, but never resolves the user's login shell PATH.ProcessInfo.processInfo.environmentonly has the minimal Finder PATH.Affected files
Sources/Crow/App/IssueTracker.swift—shell()andshellWithStatus()Packages/CrowProvider/Sources/CrowProvider/ProviderManager.swift—shell()(also has conditional env bug)Packages/CrowGit/Sources/CrowGit/GitManager.swift—run()(never sets environment at all)Sources/Crow/App/AppDelegate.swift— dependency check uses/usr/bin/whichwith same minimal PATHProposed Fix
Add a
ShellEnvironmentsingleton inCrowCorethat:zsh -lc 'echo $PATH') to get the real PATH/opt/homebrew/bin,/usr/local/binif shell resolution failsShellEnvironment.shared.envfor allProcesscallsShellEnvironment.shared.hasCommand(_:)for tool detectionThen update all 4 files to use the enriched environment.
Reproduction
make releaseCrow.appfrom Finder (not terminal)PATH=$PATH ./Crow.app/Contents/MacOS/CrowApp— issues load