-
-
Couldn't load subscription status.
- Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior
Description
When I run setenv or addenv, I was expecting its dir does not change in this process since the only thing I want to change is ENV. But it turns out dir is cleared after a setenv or an addenv:
julia> Cmd(`ls`; dir = "/usr/local").dir
"/usr/local"
julia> setenv(Cmd(`ls`; dir = "/usr/local")).dir
""
julia> addenv(Cmd(`ls`; dir = "/usr/local")).dir
""However, I found the flag ignorestatus is inherited:
julia> Cmd(`ls`, dir = "/usr/local/bin", ignorestatus=true).ignorestatus
true
julia> setenv(Cmd(`ls`, dir = "/usr/local/bin", ignorestatus=true), ENV).ignorestatus
trueShould we let dir in setenv & addenv defaults to cmd.dir?
setenv(command::Cmd, env; dir=command.dir)julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior