mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Revert "Primitives now use color closures..." (#7710)
This temporarily reverts commit c5639cd9fa
(PR https://github.com/nushell/nushell/pull/7650). See
[here](https://github.com/nushell/nushell/pull/7650#issuecomment-1375036213)
for details; the PR is accidentally adding ANSI escape codes to strings
piped to externals.
I think we should revert the PR because we're only 1-2 days away from a
release; reverting it will give us more time to land+test a proper fix
in the next release cycle.
This commit is contained in:
@ -348,22 +348,7 @@ fn handle_table_command(
|
||||
ctrlc,
|
||||
metadata,
|
||||
),
|
||||
PipelineData::Value(v, ..) => {
|
||||
// into_string() is used for serialising primitives in PipelineData::write_all_and_flush(),
|
||||
// so the same is used here.
|
||||
let str_representation = v.into_string("", config);
|
||||
|
||||
Ok(Value::String {
|
||||
val: StyleComputer::from_config(engine_state, stack)
|
||||
.style_primitive(&v)
|
||||
.color_style
|
||||
.map(|e| e.paint(&str_representation).to_string())
|
||||
.unwrap_or(str_representation),
|
||||
span: call.head,
|
||||
}
|
||||
.into_pipeline_data())
|
||||
}
|
||||
PipelineData::Empty {} => Ok(input),
|
||||
x => Ok(x),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user