make auto-cd change $env.OLDPWD (#6019)

* make auto-cd change `$env.OLDPWD`

* fmt

* use Config

* make auto-cd change `.OLDPWD`
This commit is contained in:
pwygab 2022-07-12 19:05:19 +08:00 committed by GitHub
parent a54f9719e5
commit b9bbf0c10f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -349,6 +349,14 @@ pub fn evaluate_repl(
(path.to_string_lossy().to_string(), tokens.0[0].span)
};
stack.add_env_var(
"OLDPWD".into(),
Value::String {
val: cwd.clone(),
span: Span { start: 0, end: 0 },
},
);
//FIXME: this only changes the current scope, but instead this environment variable
//should probably be a block that loads the information from the state in the overlay
stack.add_env_var(