While starting nu, force PWD to be current working directory (#5751)

* fix current working directory during start

* fix tests

* always set PWD to current_dir
This commit is contained in:
WindSoilder
2022-06-11 02:01:08 +08:00
committed by GitHub
parent b6959197bf
commit c5cb369d8d
3 changed files with 45 additions and 30 deletions

View File

@ -67,7 +67,8 @@ macro_rules! nu {
let target_cwd = $crate::fs::in_directory(&$cwd);
let mut process = match Command::new($crate::fs::executable_path())
.env("PWD", &target_cwd) // setting PWD is enough to set cwd
.env("PWD", &target_cwd)
.current_dir(target_cwd)
.env(NATIVE_PATH_ENV_VAR, paths_joined)
// .arg("--skip-plugins")
// .arg("--no-history")