axodotdev / axodotdev/cargo-dist

~/.local/env PATH setup is not ideal in VS Code, on macOS

Open
#2,390 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

Apparently, VS Code adds `~/.local/bin` to the `PATH` before it starts the integrated terminal.

Then when the terminal starts macOS **prepends** `/etc/paths` (and probably the stuff in `/etc/paths.d`) to the `PATH`, and `/etc/paths` has `/usr/local/bin` (and others) by default.

So when `~/.local/bin/env` runs, `~/.local/bin` is already on the `PATH`, so it does **not** prepend it. But it is in the wrong position, because it is after `/usr/local/bin`, so it does not override system-installed binaries, like it was meant to be.

I verified all this on a vanilla macOS installation with a vanilla VS Code install.

I am not sure what the good fix would be for this, for now my installer will just unconditionally prepend `~/.local/bin/` to the `PATH`.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the macOS installer behavior around ~/.local/bin/env and how VS Code initializes the integrated terminal PATH. Reproduce the ordering on a vanilla macOS and VS Code installation, then determine the intended PATH precedence and verify that ~/.local/bin precedes /usr/local/bin without breaking other PATH entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust, vscode
Domain
operating-systems, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.