Skip to content

Conversation

@prathamdby
Copy link

@prathamdby prathamdby commented Jan 23, 2026

Summary

Fixes 1Code on Windows not finding user-installed tools like Claude CLI when running as a packaged app.

Problem

On Windows, spawning a Git Bash login shell to capture PATH doesn't include Windows user paths like ~/.local/bin. This causes 1Code to fail when trying to execute Claude agents or git-lfs operations.

Solution

  • Add buildWindowsPath() to derive PATH from process.env.PATH + common install locations
  • Include ~/.local/bin (where Claude CLI is often installed), Git for Windows paths, and System32
  • Case-insensitive deduplication (Windows paths are case-insensitive)
  • Skip login shell spawn entirely on Windows

macOS/Linux behavior unchanged. Still spawns login shell to capture profile-defined PATH.

Changes

  • src/main/lib/git/shell-env.ts: Platform-specific PATH resolution

- Add buildWindowsPath() to derive PATH from process.env + common locations
- Include ~/.local/bin, Git for Windows paths, and System32
- Case-insensitive deduplication for Windows paths
- Skip login shell spawn on Windows (Git Bash PATH excludes user paths)

Fixes packaged apps on Windows not finding user-installed tools like Claude CLI.
@prathamdby prathamdby changed the title fix(shell-env): build Windows PATH without shell invocation Fix Windows PATH resolution for packaged apps Jan 23, 2026
@prathamdby
Copy link
Author

Before:
image

After:
image

@prathamdby prathamdby marked this pull request as ready for review January 23, 2026 19:41
@serafimcloud
Copy link
Contributor

Thank you for this contribution! We've manually integrated your changes in commit a4bfdbd7c (synced from upstream).

The PR has merge conflicts due to overlapping changes from #72 that were merged earlier. Since we've already incorporated your improvements (buildWindowsPath function, common Windows paths, case-insensitive deduplication), we'll close this PR.

Your changes are now live in the codebase. Thanks again! 🙏

@prathamdby prathamdby deleted the fix/windows-shell-env-path branch January 23, 2026 21:07
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.

2 participants