Skip to content

changing Path environment variable after shell starts have no effect on windows #6011

@rtfcv

Description

@rtfcv

Describe the bug

Changing path variable using let-env command after shell starts has no effect what-so-ever.
Another nu.exe started from that shell will take the new env into account.

EDIT:
It is only removal of already existing path (when the shell launches) that is problem.
Adding Path works fine

How to reproduce

  1. let-env Path = [] (doing let-env PATH = [] does nothing as well)
  2. run some command like explorer.exe and discover that it runs even though the path should be empty
  3. echo $env.Path to see that it actually is empty
  4. enter . and running some command changes nothing
  5. run nu cmd or any other shell, will give you a shell with empty Path (Path not PATH is used in these)

Expected behavior

Changing path, command in the new path will run.

Screenshots

No response

Configuration

key value
version 0.65.0
branch
commit_hash 390d06d
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.62.0 (a8314ef7d 2022-06-27)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.62.0 (a748cf5a3 2022-06-08)
pkg_version 0.65.0
build_time 2022-07-05 17:31:19 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

only on windows.
doing this on linux produce expected behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions