Skip to content

pixi shell updates PATH in the middle, thus old PATH takes precedence #284

Closed

Description

@certik

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

pixi shell
echo $PATH

It shows:

/Users/ondrej/.wasmer/bin:/Users/ondrej/bin:/private/tmp/pixi-hello-world/.pixi/env/bin:/Users/ondrej/.wasmer/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/mambaforge/condabin:/Users/ondrej/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/ondrej/.wasmer/globals/wapm_packages/.bin:/Users/ondrej/.wasmer/globals/wapm_packages/.bin

Issue description

Above the pixi env path is inserted in the middle.

This means that the following fails:

$ which lpython
/Users/ondrej/bin/lpython

Even though there is an lpython installed using pixi:

$ .pixi/env/bin/lpython --version
LPython version: 0.19.0
Platform: macOS ARM
Default target: arm64-apple-darwin21.3.0

Expected behavior

I would expect:

/private/tmp/pixi-hello-world/.pixi/env/bin:/Users/ondrej/.wasmer/bin:/Users/ondrej/bin:/Users/ondrej/.wasmer/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/mambaforge/condabin:/Users/ondrej/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/ondrej/.wasmer/globals/wapm_packages/.bin:/Users/ondrej/.wasmer/globals/wapm_packages/.bin

Activity

  1. added
    bug
    on Aug 22, 2023
  2. certik commented on Aug 22, 2023

    @certik
    ContributorAuthor

    This might be the same issue as #246. I also use zsh and macOS.

  3. ruben-arts commented on Aug 22, 2023

    @ruben-arts
    Contributor

    Hey @certik,

    You are completely right, this issue is the same as #246. Because we restart your shell after the activation your profile will overwrite the path set by the activation. We're discussing how to fix this.

    I'll close this issue to avoid doubles, you can subscribe to #246 to get updated.

    Hope that explains it enough for now, sorry for the inconvenience!

  4. certik commented on Aug 22, 2023

    @certik
    ContributorAuthor

    Thanks @ruben-arts. One way to do it is via a shell function that just prepends the pixi paths at the beginning of the PATH, and that's it.

  5. ruben-arts commented on Aug 22, 2023

    @ruben-arts
    Contributor

    Yeah that is what we're trying to build, as of right now there is no way to interact with the spawned shell but we'll see if we can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions