Move config to be an env var (#5230)

* Move config to be an env var

* fix fmt and tests
This commit is contained in:
JT
2022-04-19 10:28:01 +12:00
committed by GitHub
parent 409f1480f5
commit 76079d5183
52 changed files with 455 additions and 608 deletions

View File

@ -138,7 +138,7 @@ fn string_helper(
let head = call.head;
let decimals_value: Option<i64> = call.get_flag(engine_state, stack, "decimals")?;
let column_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config().clone();
if let Some(decimal_val) = decimals_value {
if decimals && decimal_val.is_negative() {

View File

@ -25,12 +25,12 @@ impl Command for Debug {
fn run(
&self,
engine_state: &EngineState,
stack: &mut Stack,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config().clone();
let raw = call.has_flag("raw");
input.map(

View File

@ -2,7 +2,7 @@ use nu_engine::eval_block;
use nu_parser::parse;
use nu_protocol::{
engine::{Command, EngineState, Stack, StateWorkingSet},
PipelineData, Span, Value, CONFIG_VARIABLE_ID,
PipelineData, Span,
};
use super::eager::ToDataFrame;
@ -63,16 +63,6 @@ pub fn test_dataframe(cmds: Vec<Box<dyn Command + 'static>>) {
let mut stack = Stack::new();
// Set up our initial config to start from
stack.vars.insert(
CONFIG_VARIABLE_ID,
Value::Record {
cols: vec![],
vals: vec![],
span: Span::test_data(),
},
);
match eval_block(
&engine_state,
&mut stack,

View File

@ -5,7 +5,7 @@ use nu_parser::parse;
#[cfg(test)]
use nu_protocol::{
engine::{Command, EngineState, Stack, StateWorkingSet},
PipelineData, Span, Value, CONFIG_VARIABLE_ID,
PipelineData, Span, Value,
};
#[cfg(test)]
@ -112,16 +112,6 @@ pub fn test_examples(cmd: impl Command + 'static) {
},
);
// Set up our initial config to start from
stack.vars.insert(
CONFIG_VARIABLE_ID,
Value::Record {
cols: vec![],
vals: vec![],
span: Span::test_data(),
},
);
match eval_block(
&engine_state,
&mut stack,

View File

@ -378,31 +378,22 @@ mod test {
vals: vec![
Value::Record {
cols: vec!["id".to_string(), "name".to_string()],
vals: vec![
Value::Int {
val: 123,
span: span,
},
Value::Nothing { span: span },
],
span: span,
vals: vec![Value::Int { val: 123, span }, Value::Nothing { span }],
span,
},
Value::Record {
cols: vec!["id".to_string(), "name".to_string()],
vals: vec![
Value::Int {
val: 456,
span: span,
},
Value::Int { val: 456, span },
Value::String {
val: "foo bar".to_string(),
span: span,
span,
},
],
span: span,
span,
},
],
span: span,
span,
}],
span,
};

View File

@ -133,7 +133,7 @@ fn rm(
let targets: Vec<Spanned<String>> = call.rest(engine_state, stack, 0)?;
let span = call.head;
let config = stack.get_config()?;
let config = engine_state.get_config();
let rm_always_trash = config.rm_always_trash;

View File

@ -157,13 +157,13 @@ impl Command for Find {
fn find_with_regex(
regex: String,
engine_state: &EngineState,
stack: &mut Stack,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let span = call.head;
let ctrlc = engine_state.ctrlc.clone();
let config = stack.get_config()?;
let config = engine_state.get_config().clone();
let insensitive = call.has_flag("insensitive");
let multiline = call.has_flag("multiline");
@ -271,7 +271,7 @@ fn find_with_rest(
let ctrlc = engine_state.ctrlc.clone();
let metadata = input.metadata();
let engine_state = engine_state.clone();
let config = stack.get_config()?;
let config = engine_state.get_config().clone();
let invert = call.has_flag("invert");
let terms = call.rest::<Value>(&engine_state, stack, 0)?;

View File

@ -71,15 +71,15 @@ impl Command for Headers {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let config = stack.get_config()?;
let config = engine_state.get_config();
let metadata = input.metadata();
let value = input.into_value(call.head);
let headers = extract_headers(&value, &config)?;
let headers = extract_headers(&value, config)?;
let new_headers = replace_headers(value, &headers)?;
Ok(new_headers.into_pipeline_data().set_metadata(metadata))

View File

@ -79,7 +79,7 @@ fn from_csv(
let noheaders = call.has_flag("noheaders");
let separator: Option<Value> = call.get_flag(engine_state, stack, "separator")?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let sep = match separator {
Some(Value::String { val: s, span }) => {
@ -99,7 +99,7 @@ fn from_csv(
_ => ',',
};
from_delimited_data(noheaders, sep, input, name, &config)
from_delimited_data(noheaders, sep, input, name, config)
}
#[cfg(test)]

View File

@ -45,8 +45,8 @@ impl Command for FromEml {
let head = call.head;
let preview_body: Option<Spanned<i64>> =
call.get_flag(engine_state, stack, "preview-body")?;
let config = stack.get_config().unwrap_or_default();
from_eml(input, preview_body, head, &config)
let config = engine_state.get_config();
from_eml(input, preview_body, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -28,14 +28,14 @@ impl Command for FromIcs {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_ics(input, head, &config)
let config = engine_state.get_config();
from_ics(input, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -50,14 +50,14 @@ b=2' | from ini",
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_ini(input, head, &config)
let config = engine_state.get_config();
from_ini(input, head, config)
}
}

View File

@ -70,13 +70,13 @@ impl Command for FromJson {
fn run(
&self,
engine_state: &EngineState,
stack: &mut Stack,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let span = call.head;
let config = stack.get_config().unwrap_or_default();
let string_input = input.collect_string("", &config)?;
let config = engine_state.get_config();
let string_input = input.collect_string("", config)?;
if string_input.is_empty() {
return Ok(PipelineData::new(span));

View File

@ -66,14 +66,14 @@ impl Command for FromNuon {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
let string_input = input.collect_string("", &config)?;
let config = engine_state.get_config();
let string_input = input.collect_string("", config)?;
let engine_state = EngineState::new();

View File

@ -267,7 +267,7 @@ fn from_ssv(
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let name = call.head;
let noheaders = call.has_flag("noheaders");
@ -275,7 +275,7 @@ fn from_ssv(
let minimum_spaces: Option<Spanned<usize>> =
call.get_flag(engine_state, stack, "minimum-spaces")?;
let concat_string = input.collect_string("", &config)?;
let concat_string = input.collect_string("", config)?;
let split_at = match minimum_spaces {
Some(number) => number.item,
None => DEFAULT_MINIMUM_SPACES,

View File

@ -67,14 +67,14 @@ b = [1, 2]' | from toml",
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let span = call.head;
let config = stack.get_config().unwrap_or_default();
let mut string_input = input.collect_string("", &config)?;
let config = engine_state.get_config();
let mut string_input = input.collect_string("", config)?;
string_input.push('\n');
Ok(convert_string_to_value(string_input, span)?.into_pipeline_data())
}

View File

@ -28,13 +28,13 @@ impl Command for FromTsv {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let config = stack.get_config().unwrap_or_default();
from_tsv(call, input, &config)
let config = engine_state.get_config();
from_tsv(call, input, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -20,14 +20,14 @@ impl Command for FromUrl {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_url(input, head, &config)
let config = engine_state.get_config();
from_url(input, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -26,14 +26,14 @@ impl Command for FromVcf {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_vcf(input, head, &config)
let config = engine_state.get_config();
from_vcf(input, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -24,14 +24,14 @@ impl Command for FromXml {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_xml(input, head, &config)
let config = engine_state.get_config();
from_xml(input, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -30,14 +30,14 @@ impl Command for FromYaml {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_yaml(input, head, &config)
let config = engine_state.get_config();
from_yaml(input, head, config)
}
}
@ -59,14 +59,14 @@ impl Command for FromYml {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
from_yaml(input, head, &config)
let config = engine_state.get_config();
from_yaml(input, head, config)
}
fn examples(&self) -> Vec<Example> {

View File

@ -60,7 +60,7 @@ impl Command for ToCsv {
let head = call.head;
let noheaders = call.has_flag("noheaders");
let separator: Option<Spanned<String>> = call.get_flag(engine_state, stack, "separator")?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
to_csv(input, noheaders, separator, head, config)
}
}
@ -70,7 +70,7 @@ fn to_csv(
noheaders: bool,
separator: Option<Spanned<String>>,
head: Span,
config: Config,
config: &Config,
) -> Result<PipelineData, ShellError> {
let sep = match separator {
Some(Spanned { item: s, span, .. }) => {

View File

@ -125,10 +125,10 @@ pub fn to_delimited_data(
format_name: &'static str,
input: PipelineData,
span: Span,
config: Config,
config: &Config,
) -> Result<PipelineData, ShellError> {
let value = input.into_value(span);
let output = match from_value_to_delimited_string(&value, sep, &config, span) {
let output = match from_value_to_delimited_string(&value, sep, config, span) {
Ok(mut x) => {
if noheaders {
if let Some(second_line) = x.find('\n') {

View File

@ -295,7 +295,7 @@ fn to_html(
let partial = call.has_flag("partial");
let list = call.has_flag("list");
let theme: Option<Spanned<String>> = call.get_flag(engine_state, stack, "theme")?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let vec_of_values = input.into_iter().collect::<Vec<Value>>();
let headers = merge_descriptors(&vec_of_values);
@ -365,15 +365,15 @@ fn to_html(
let inner_value = match vec_of_values.len() {
0 => String::default(),
1 => match headers {
Some(headers) => html_table(vec_of_values, headers, &config),
Some(headers) => html_table(vec_of_values, headers, config),
None => {
let value = &vec_of_values[0];
html_value(value.clone(), &config)
html_value(value.clone(), config)
}
},
_ => match headers {
Some(headers) => html_table(vec_of_values, headers, &config),
None => html_list(vec_of_values, &config),
Some(headers) => html_table(vec_of_values, headers, config),
None => html_list(vec_of_values, config),
},
};

View File

@ -59,15 +59,15 @@ impl Command for ToMd {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let pretty = call.has_flag("pretty");
let per_element = call.has_flag("per-element");
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
to_md(input, pretty, per_element, config, head)
}
}
@ -76,17 +76,17 @@ fn to_md(
input: PipelineData,
pretty: bool,
per_element: bool,
config: Config,
config: &Config,
head: Span,
) -> Result<PipelineData, ShellError> {
let (grouped_input, single_list) = group_by(input, head, &config);
let (grouped_input, single_list) = group_by(input, head, config);
if per_element || single_list {
return Ok(Value::string(
grouped_input
.into_iter()
.map(move |val| match val {
Value::List { .. } => table(val.into_pipeline_data(), pretty, &config),
other => fragment(other, pretty, &config),
Value::List { .. } => table(val.into_pipeline_data(), pretty, config),
other => fragment(other, pretty, config),
})
.collect::<Vec<String>>()
.join(""),
@ -94,7 +94,7 @@ fn to_md(
)
.into_pipeline_data());
}
Ok(Value::string(table(grouped_input, pretty, &config), head).into_pipeline_data())
Ok(Value::string(table(grouped_input, pretty, config), head).into_pipeline_data())
}
fn fragment(input: Value, pretty: bool, config: &Config) -> String {

View File

@ -35,14 +35,14 @@ impl Command for ToTsv {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let noheaders = call.has_flag("noheaders");
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
to_tsv(input, noheaders, head, config)
}
}
@ -51,7 +51,7 @@ fn to_tsv(
input: PipelineData,
noheaders: bool,
head: Span,
config: Config,
config: &Config,
) -> Result<PipelineData, ShellError> {
to_delimited_data(noheaders, '\t', "TSV", input, head, config)
}

View File

@ -61,9 +61,9 @@ impl Command for ToXml {
input: PipelineData,
) -> Result<nu_protocol::PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let pretty: Option<Spanned<i64>> = call.get_flag(engine_state, stack, "pretty")?;
to_xml(input, head, pretty, &config)
to_xml(input, head, pretty, config)
}
}

View File

@ -317,7 +317,7 @@ Format: #
let list: bool = call.has_flag("list");
let escape: bool = call.has_flag("escape");
let osc: bool = call.has_flag("osc");
let use_ansi_coloring = stack.get_config()?.use_ansi_coloring;
let use_ansi_coloring = engine_state.get_config().use_ansi_coloring;
if list {
return generate_ansi_code_list(engine_state, call.head, use_ansi_coloring);

View File

@ -25,14 +25,14 @@ impl Command for KeybindingsListen {
fn run(
&self,
_engine_state: &EngineState,
stack: &mut Stack,
engine_state: &EngineState,
_stack: &mut Stack,
_call: &Call,
_input: PipelineData,
) -> Result<PipelineData, ShellError> {
println!("Type any key combination to see key details. Press ESC to abort.");
match print_events(stack) {
match print_events(engine_state) {
Ok(v) => Ok(v.into_pipeline_data()),
Err(e) => {
terminal::disable_raw_mode()?;
@ -56,8 +56,8 @@ impl Command for KeybindingsListen {
}
}
pub fn print_events(stack: &mut Stack) -> Result<Value, ShellError> {
let config = stack.get_config()?;
pub fn print_events(engine_state: &EngineState) -> Result<Value, ShellError> {
let config = engine_state.get_config();
stdout().flush()?;
terminal::enable_raw_mode()?;
@ -78,7 +78,7 @@ pub fn print_events(stack: &mut Stack) -> Result<Value, ShellError> {
Value::Record { cols, vals, .. } => cols
.iter()
.zip(vals.iter())
.map(|(x, y)| format!("{}: {}", x, y.into_string("", &config)))
.map(|(x, y)| format!("{}: {}", x, y.into_string("", config)))
.collect::<Vec<String>>()
.join(", "),

View File

@ -52,11 +52,11 @@ impl Command for BuildString {
call: &Call,
_input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let output = call
.positional_iter()
.map(|expr| {
eval_expression(engine_state, stack, expr).map(|val| val.into_string(", ", &config))
eval_expression(engine_state, stack, expr).map(|val| val.into_string(", ", config))
})
.collect::<Result<Vec<String>, ShellError>>()?;

View File

@ -87,8 +87,8 @@ fn detect_columns(
let num_rows_to_skip: Option<usize> = call.get_flag(engine_state, stack, "skip")?;
let noheader = call.has_flag("no-headers");
let ctrlc = engine_state.ctrlc.clone();
let config = stack.get_config()?;
let input = input.collect_string("", &config)?;
let config = engine_state.get_config();
let input = input.collect_string("", config)?;
#[allow(clippy::needless_collect)]
let input: Vec<_> = input

View File

@ -35,14 +35,14 @@ impl Command for Format {
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let config = stack.get_config()?;
let config = engine_state.get_config();
let specified_pattern: Result<Value, ShellError> = call.req(engine_state, stack, 0);
match specified_pattern {
Err(e) => Err(e),
Ok(pattern) => {
let string_pattern = pattern.as_string()?;
let ops = extract_formatting_operations(string_pattern);
format(input, &ops, call.head, &config)
format(input, &ops, call.head, config)
}
}
}

View File

@ -41,7 +41,7 @@ impl Command for StrCollect {
) -> Result<PipelineData, ShellError> {
let separator: Option<String> = call.opt(engine_state, stack, 0)?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
// let output = input.collect_string(&separator.unwrap_or_default(), &config)?;
// Hmm, not sure what we actually want. If you don't use debug_string, Date comes out as human readable
@ -54,7 +54,7 @@ impl Command for StrCollect {
return Err(error);
}
value => {
strings.push(value.debug_string("\n", &config));
strings.push(value.debug_string("\n", config));
}
}
}

View File

@ -147,15 +147,12 @@ impl ExternalCommand {
)),
Ok(mut child) => {
if !input.is_nothing() {
let engine_state = engine_state.clone();
let mut engine_state = engine_state.clone();
let mut stack = stack.clone();
stack.update_config(
"use_ansi_coloring",
Value::Bool {
val: false,
span: Span::new(0, 0),
},
);
// Turn off color as we pass data through
engine_state.config.use_ansi_coloring = false;
// if there is a string or a stream, that is sent to the pipe std
if let Some(mut stdin_write) = child.stdin.take() {
std::thread::spawn(move || {

View File

@ -64,7 +64,7 @@ prints out the list properly."#
let width_param: Option<i64> = call.get_flag(engine_state, stack, "width")?;
let color_param: bool = call.has_flag("color");
let separator_param: Option<String> = call.get_flag(engine_state, stack, "separator")?;
let config = stack.get_config().unwrap_or_default();
let config = engine_state.get_config();
let env_str = match stack.get_env_var(engine_state, "LS_COLORS") {
Some(v) => Some(env_to_string("LS_COLORS", &v, engine_state, stack)?),
None => None,
@ -74,7 +74,7 @@ prints out the list properly."#
match input {
PipelineData::Value(Value::List { vals, .. }, ..) => {
// dbg!("value::list");
let data = convert_to_list(vals, &config, call.head);
let data = convert_to_list(vals, config, call.head);
if let Some(items) = data {
Ok(create_grid_output(
items,
@ -91,7 +91,7 @@ prints out the list properly."#
}
PipelineData::ListStream(stream, ..) => {
// dbg!("value::stream");
let data = convert_to_list(stream, &config, call.head);
let data = convert_to_list(stream, config, call.head);
if let Some(items) = data {
Ok(create_grid_output(
items,
@ -112,7 +112,7 @@ prints out the list properly."#
let mut items = vec![];
for (i, (c, v)) in cols.into_iter().zip(vals.into_iter()).enumerate() {
items.push((i, c, v.into_string(", ", &config)))
items.push((i, c, v.into_string(", ", config)))
}
Ok(create_grid_output(

View File

@ -56,8 +56,8 @@ impl Command for Table {
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let head = call.head;
let ctrlc = engine_state.ctrlc.clone();
let config = stack.get_config().unwrap_or_default();
let color_hm = get_color_config(&config);
let config = engine_state.get_config();
let color_hm = get_color_config(config);
let start_num: Option<i64> = call.get_flag(engine_state, stack, "start-number")?;
let row_offset = start_num.unwrap_or_default() as usize;
@ -99,7 +99,6 @@ impl Command for Table {
ListStream::from_stream(vals.into_iter(), ctrlc.clone()),
call,
row_offset,
config,
ctrlc,
metadata,
),
@ -109,7 +108,6 @@ impl Command for Table {
stream,
call,
row_offset,
config,
ctrlc,
metadata,
),
@ -123,7 +121,7 @@ impl Command for Table {
style: TextStyle::default_field(),
},
StyledString {
contents: v.into_abbreviated_string(&config),
contents: v.into_abbreviated_string(config),
style: TextStyle::default(),
},
])
@ -132,10 +130,10 @@ impl Command for Table {
let table = nu_table::Table {
headers: vec![],
data: output,
theme: load_theme_from_config(&config),
theme: load_theme_from_config(config),
};
let result = nu_table::draw_table(&table, term_width, &color_hm, &config);
let result = nu_table::draw_table(&table, term_width, &color_hm, config);
Ok(Value::String {
val: result,
@ -149,7 +147,7 @@ impl Command for Table {
self.run(engine_state, stack, call, base_pipeline)
}
PipelineData::Value(x @ Value::Range { .. }, ..) => Ok(Value::String {
val: x.into_string("", &config),
val: x.into_string("", config),
span: call.head,
}
.into_pipeline_data()),
@ -195,7 +193,6 @@ fn handle_row_stream(
stream: ListStream,
call: &Call,
row_offset: usize,
config: Config,
ctrlc: Option<Arc<AtomicBool>>,
metadata: Option<PipelineMetadata>,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
@ -203,7 +200,7 @@ fn handle_row_stream(
Some(PipelineMetadata {
data_source: DataSource::Ls,
}) => {
let config = config.clone();
let config = engine_state.config.clone();
let ctrlc = ctrlc.clone();
let ls_colors = match stack.get_env_var(engine_state, "LS_COLORS") {
@ -281,7 +278,7 @@ fn handle_row_stream(
stdout: Some(RawStream::new(
Box::new(PagingTableCreator {
row_offset,
config,
config: engine_state.get_config().clone(),
ctrlc: ctrlc.clone(),
head,
stream,