Skip to content

How is PATH populated in devbox shell? #2409

Open
@andbleo

Description

@andbleo

What happened?

I am trying to understand how the PATH env var is set when invoking devbox shell. Specifically, if I update PATH in my .zshrc (like when doing source "$HOME/.cargo/env", which updates the PATH), it isn't reflected in the PATH in my devbox shell. If I instead set PATH in my .profile, it is included in the PATH in my devbox shell. I was initially confused by this because my .zshrc is sourced by devbox shell (I see other env vars exported and a simple echo Testing 1 2 3 in my .zshrc is printed) so I incorrectly assumed it was updating my PATH based on the value sourced from .zshrc.

I'm fine with moving my updates to PATH from .zshrc to .profile to make this work, but it would be great to see the following:

  1. Document somewhere how PATH is set (if it isn't already)
  2. Document if there are any other env vars that get special treatment like PATH (if any)

Steps to reproduce

  1. update the PATH env var in .zshrc
  2. devbox shell
  3. echo $PATH and see that my updates to PATH from .zshrc aren't there

Command

shell

devbox.json

No response

Devbox version

0.13.6

Nix version

2.24.6

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions