diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index 60e2b44e52..0b01710c22 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -11,7 +11,7 @@ use miette::{ErrReport, IntoDiagnostic, Result}; use nu_cmd_base::util::get_guaranteed_cwd; use nu_cmd_base::{hook::eval_hook, util::get_editor}; use nu_color_config::StyleComputer; -use nu_engine::convert_env_values; +use nu_engine::{convert_env_values, env_to_strings}; use nu_parser::{lex, parse, trim_quotes_str}; use nu_protocol::{ config::NuCursorShape, @@ -300,12 +300,9 @@ pub fn evaluate_repl( line_editor = if let Ok((cmd, args)) = buffer_editor { let mut command = std::process::Command::new(&cmd); - command.args(args).envs( - engine_state - .render_env_vars() - .into_iter() - .filter_map(|(k, v)| v.as_string().ok().map(|v| (k, v))), - ); + command + .args(args) + .envs(env_to_strings(engine_state, stack)?); line_editor.with_buffer_editor(command, temp_file.clone()) } else { line_editor