Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH entries are relative to starting directory instead of home #9434

Open
J-Kappes opened this issue Jun 14, 2023 · 2 comments
Open

PATH entries are relative to starting directory instead of home #9434

J-Kappes opened this issue Jun 14, 2023 · 2 comments
Labels
🐛 bug Something isn't working needs-triage An issue that hasn't had any proper look

Comments

@J-Kappes
Copy link
Contributor

Describe the bug

I believe I'm using the suggested way of adding entries to my PATH as described at the bottom of env.nu but those entries are added relative to whatever directory I opened the nushell in, rather than relative to my home directory.

Nesting nushells results in appended PATH entries i.e. if your outer nushell was started in your home directory, you cd somewhere else and start another nushell, that one will have the incorrect PATH entries in addition to the correct ones from the first shell.

How to reproduce

  1. Add a line like let-env PATH = ($env.PATH | split row (char esep) | prepend '.local/bin') to your env.nu

A:

  1. Open a terminal with a non-nu-shell
  2. cd anywhere besides ~/
  3. start nushell

B:

  1. run nushell in zellij
  2. cd anywhere besides ~/
  3. open a new pane or tab

Expected behavior

My PATH is identical to if I had started a terminal with nushell in my home directory.

Screenshots

No response

Configuration

key value
version 0.81.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.69.0 (84c898d65 2023-04-16)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.69.0 (6e9a83356 2023-04-12)
build_time 2023-06-07 13:38:04 +02:00
build_rust_channel release
features default, sqlite, trash, which, zip
installed_plugins

Additional context

No response

@J-Kappes J-Kappes added the needs-triage An issue that hasn't had any proper look label Jun 14, 2023
@fdncred
Copy link
Collaborator

fdncred commented Jun 14, 2023

I've tried to reproduce this on my mac and couldn't. However, I did find that launching nu from within nu creates duplicate entries, even though I have a line in my config.nu to remove duplicate path entries.

@amtoine
Copy link
Member

amtoine commented Jun 14, 2023

i could reproduce this on linux 👍

@amtoine amtoine added the 🐛 bug Something isn't working label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

No branches or pull requests

3 participants