mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:55:07 +02:00
Merge stack before printing (#9304)
Could you @fdncred try it? close?: #9264 --------- Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@ -281,8 +281,10 @@ pub fn eval_hook(
|
||||
}
|
||||
}
|
||||
|
||||
engine_state.merge_env(stack)?;
|
||||
|
||||
let cwd = get_guaranteed_cwd(engine_state, stack);
|
||||
engine_state.merge_env(stack, cwd)?;
|
||||
engine_state.set_current_working_dir(cwd)?;
|
||||
|
||||
Ok(output)
|
||||
}
|
||||
|
@ -102,6 +102,12 @@ impl Command for Table {
|
||||
call: &Call,
|
||||
input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
// We merge stack to make sure we render the changes if any were made in the `block`
|
||||
//
|
||||
// CONSIDERED TO BE A CODE SMELL AND IT BETTER BE RESOLVED UPWARDS THE CALLING STACK
|
||||
let engine = engine_state.clone_with_env(stack)?;
|
||||
let engine_state = &engine;
|
||||
|
||||
let start_num: Option<i64> = call.get_flag(engine_state, stack, "start-number")?;
|
||||
let row_offset = start_num.unwrap_or_default() as usize;
|
||||
let list: bool = call.has_flag("list");
|
||||
|
Reference in New Issue
Block a user