Skip to content

fix: use login shell for AI tool detection to respect user PATH#43

Merged
Codename-11 merged 1 commit into
mainfrom
claude/issue-35-20260323-1657
Mar 24, 2026
Merged

fix: use login shell for AI tool detection to respect user PATH#43
Codename-11 merged 1 commit into
mainfrom
claude/issue-35-20260323-1657

Conversation

@Codename-11

Copy link
Copy Markdown
Owner

Fixes #35

On macOS/Linux, Electron GUI apps inherit a minimal system PATH and never source the user's shell profile. This caused the "Claude Code (not installed)" false positive when the binary lived in a profile-defined path like ~/.local/bin.

Two concrete fixes:

  • Absolute paths: check with fs.access(X_OK) instead of which
  • Command names: spawn the user's configured login shell with -l flag

Generated with Claude Code

On macOS (and Linux), Electron GUI apps inherit a minimal system PATH and
never source the user's shell profile (~/.zshrc, ~/.bashrc). This caused
`which claude` to fail even when Claude Code was installed in ~/.local/bin
and working fine in SubFrame's own terminal.

Two concrete fixes:
- Absolute paths (e.g. /Users/foo/.local/bin/claude): check file existence
  and executability via fs.access() instead of running `which`, so a
  user-provided full path always resolves correctly.
- Simple command names (e.g. `claude`): spawn the user's configured login
  shell with the -l flag, mirroring the same PATH that terminal sessions see.

Closes #35

Co-authored-by: Bailey Dixon <Codename-11@users.noreply.github.com>
@Codename-11 Codename-11 merged commit c277be2 into main Mar 24, 2026
4 of 5 checks passed
@Codename-11 Codename-11 deleted the claude/issue-35-20260323-1657 branch March 24, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude Code not detected as installed despite being functional in SubFrame's terminal

1 participant