From f0c7c1b5008fabb70555844660ca39ba5814dd4a Mon Sep 17 00:00:00 2001 From: ahkrr <44893716+ahkrr@users.noreply.github.com> Date: Tue, 23 Mar 2021 10:38:07 +0100 Subject: [PATCH] fix: prompt does not find external commands #3134 (#3189) the initial setup-commands of nushell were executed without loading environment variables this resulted in the PATH not being available at this point until an external command was run once which resulted in env_vars being added let run_result = run_block(&prompt_block, &context, InputStream::empty()).await; Co-authored-by: alexhk --- crates/nu-cli/src/cli.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index c139bb9580..38ac5a6768 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -214,6 +214,9 @@ pub async fn cli(mut context: EvaluationContext, options: Options) -> Result<(), // Give ourselves a scope to work in context.scope.enter_scope(); + let env = context.get_env(); + context.scope.add_env_to_base(env); + let history_path = nu_engine::history_path(&configuration); let _ = rl.load_history(&history_path);