mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Remove std::env::set_current_dir()
call from EngineState::merge_env()
(#12922)
As discussed in https://github.com/nushell/nushell/pull/12749, we no longer need to call `std::env::set_current_dir()` to sync `$env.PWD` with the actual working directory. This PR removes the call from `EngineState::merge_env()`.
This commit is contained in:
@ -277,11 +277,7 @@ impl EngineState {
|
||||
}
|
||||
|
||||
/// Merge the environment from the runtime Stack into the engine state
|
||||
pub fn merge_env(
|
||||
&mut self,
|
||||
stack: &mut Stack,
|
||||
cwd: impl AsRef<Path>,
|
||||
) -> Result<(), ShellError> {
|
||||
pub fn merge_env(&mut self, stack: &mut Stack) -> Result<(), ShellError> {
|
||||
let mut config_updated = false;
|
||||
|
||||
for mut scope in stack.env_vars.drain(..) {
|
||||
@ -311,9 +307,6 @@ impl EngineState {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: better error
|
||||
std::env::set_current_dir(cwd)?;
|
||||
|
||||
if config_updated {
|
||||
// Make plugin GC config changes take effect immediately.
|
||||
#[cfg(feature = "plugin")]
|
||||
|
Reference in New Issue
Block a user