mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
update to latest reedline, change config point name, enable output without ansi (#458)
This commit is contained in:
@ -15,7 +15,7 @@ pub struct Config {
|
||||
pub animate_prompt: bool,
|
||||
pub float_precision: i64,
|
||||
pub filesize_format: String,
|
||||
pub without_color: bool,
|
||||
pub use_ansi_coloring: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -30,7 +30,7 @@ impl Default for Config {
|
||||
animate_prompt: ANIMATE_PROMPT_DEFAULT,
|
||||
float_precision: 4,
|
||||
filesize_format: "auto".into(),
|
||||
without_color: false,
|
||||
use_ansi_coloring: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -93,8 +93,8 @@ impl Value {
|
||||
"float_precision" => {
|
||||
config.float_precision = value.as_integer()?;
|
||||
}
|
||||
"without_color" => {
|
||||
config.without_color = value.as_bool()?;
|
||||
"use_ansi_coloring" => {
|
||||
config.use_ansi_coloring = value.as_bool()?;
|
||||
}
|
||||
"filesize_format" => {
|
||||
config.filesize_format = value.as_string()?.to_lowercase();
|
||||
|
@ -954,7 +954,7 @@ impl WrappedTable {
|
||||
}
|
||||
|
||||
// the atty is for when people do ls from vim, there should be no coloring there
|
||||
if config.without_color || !atty::is(atty::Stream::Stdout) {
|
||||
if !config.use_ansi_coloring || !atty::is(atty::Stream::Stdout) {
|
||||
// Draw the table without ansi colors
|
||||
if let Ok(bytes) = strip_ansi_escapes::strip(&output) {
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
|
Reference in New Issue
Block a user