From ccd0160c328941e895be3f01c8d06768065312b3 Mon Sep 17 00:00:00 2001 From: Devyn Cairns <devyn.cairns@gmail.com> Date: Thu, 11 Jul 2024 10:49:46 -0700 Subject: [PATCH] Make the `store-env` IR instruction also update config (#13351) # Description Follow up fix to #13332, so that changes to config when running under IR actually happen as well. Since I merged them around the same time, I forgot about this. --- crates/nu-engine/src/eval_ir.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-engine/src/eval_ir.rs b/crates/nu-engine/src/eval_ir.rs index e2ec7ccdac..56bbccee25 100644 --- a/crates/nu-engine/src/eval_ir.rs +++ b/crates/nu-engine/src/eval_ir.rs @@ -367,7 +367,11 @@ fn eval_instruction<D: DebugContext>( let key = get_env_var_name_case_insensitive(ctx, key); if !is_automatic_env_var(&key) { + let is_config = key == "config"; ctx.stack.add_env_var(key.into_owned(), value); + if is_config { + ctx.stack.update_config(ctx.engine_state)?; + } Ok(Continue) } else { Err(ShellError::AutomaticEnvVarSetManually {