From 3c2a336ef9956a657a4b75371c32c94e9f751b8d Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Wed, 5 Jan 2022 23:08:03 +1100 Subject: [PATCH] Each much clone its env (#675) --- crates/nu-command/src/filters/each.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/nu-command/src/filters/each.rs b/crates/nu-command/src/filters/each.rs index 84ca535961..c712bd6f7c 100644 --- a/crates/nu-command/src/filters/each.rs +++ b/crates/nu-command/src/filters/each.rs @@ -82,7 +82,8 @@ impl Command for Each { .into_iter() .enumerate() .map(move |(idx, x)| { - stack.with_env(&orig_env_vars, &orig_env_hidden); + stack.env_vars = orig_env_vars.clone(); + stack.env_hidden = orig_env_hidden.clone(); if let Some(var) = block.signature.get_positional(0) { if let Some(var_id) = &var.var_id {