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 <alexhk@protonmail.com>
This commit is contained in:
ahkrr 2021-03-23 10:38:07 +01:00 committed by GitHub
parent 840bd98e01
commit f0c7c1b500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);