mirror of
https://github.com/nushell/nushell.git
synced 2025-02-16 18:41:44 +01:00
Nu ansi term update (#4988)
* WIP: Testing 0.45.1 nu-ansi-term with the new Default colors * point reedline to git in cargo.toml
This commit is contained in:
parent
82e3bb0f38
commit
ee5064abed
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -2170,9 +2170,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-ansi-term"
|
name = "nu-ansi-term"
|
||||||
version = "0.45.0"
|
version = "0.45.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "280affd8593c03f90633b7305cee7a3b55ddab9fbad95041a39bda689f7b64f7"
|
checksum = "c7bca0d33a384280d1563b97f49cb95303df9fa22588739a04b7d8015c1ccd50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"overload",
|
"overload",
|
||||||
"winapi",
|
"winapi",
|
||||||
@ -3424,9 +3424,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reedline"
|
name = "reedline"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/nushell/reedline#bc528de132e74594fdd5a9202cf32aee51e921e8"
|
||||||
checksum = "33ba0eb9271feb2de4b1516d651c96d80c892df24388e2711ef2495acc6ed9ce"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
|
@ -55,7 +55,7 @@ nu-term-grid = { path = "./crates/nu-term-grid", version = "0.60.1" }
|
|||||||
nu-utils = { path = "./crates/nu-utils", version = "0.60.1" }
|
nu-utils = { path = "./crates/nu-utils", version = "0.60.1" }
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
reedline = "0.3.0"
|
reedline = { git = "https://github.com/nushell/reedline" }
|
||||||
is_executable = "1.0.1"
|
is_executable = "1.0.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -13,15 +13,12 @@ nu-parser = { path = "../nu-parser", version = "0.60.1" }
|
|||||||
nu-protocol = { path = "../nu-protocol", version = "0.60.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.60.1" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.60.1" }
|
nu-utils = { path = "../nu-utils", version = "0.60.1" }
|
||||||
nu-ansi-term = "0.45.0"
|
nu-ansi-term = "0.45.0"
|
||||||
|
|
||||||
nu-color-config = { path = "../nu-color-config", version = "0.60.1" }
|
nu-color-config = { path = "../nu-color-config", version = "0.60.1" }
|
||||||
|
|
||||||
crossterm = "0.23.0"
|
crossterm = "0.23.0"
|
||||||
crossterm_winapi = "0.9.0"
|
crossterm_winapi = "0.9.0"
|
||||||
miette = { version = "4.1.0", features = ["fancy"] }
|
miette = { version = "4.1.0", features = ["fancy"] }
|
||||||
thiserror = "1.0.29"
|
thiserror = "1.0.29"
|
||||||
reedline = "0.3.0"
|
reedline = { git = "https://github.com/nushell/reedline" }
|
||||||
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
is_executable = "1.0.1"
|
is_executable = "1.0.1"
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@ version = "0.60.1"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.60.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.60.1" }
|
||||||
nu-ansi-term = "0.45.0"
|
nu-ansi-term = "0.45.0"
|
||||||
|
|
||||||
nu-json = { path = "../nu-json", version = "0.60.1" }
|
nu-json = { path = "../nu-json", version = "0.60.1" }
|
||||||
nu-table = { path = "../nu-table", version = "0.60.1" }
|
nu-table = { path = "../nu-table", version = "0.60.1" }
|
||||||
|
|
||||||
serde = { version="1.0.123", features=["derive"] }
|
serde = { version="1.0.123", features=["derive"] }
|
||||||
|
@ -77,7 +77,7 @@ unicode-segmentation = "1.8.0"
|
|||||||
url = "2.2.1"
|
url = "2.2.1"
|
||||||
uuid = { version = "0.8.2", features = ["v4"] }
|
uuid = { version = "0.8.2", features = ["v4"] }
|
||||||
which = { version = "4.2.2", optional = true }
|
which = { version = "4.2.2", optional = true }
|
||||||
reedline = "0.3.0"
|
reedline = { git = "https://github.com/nushell/reedline" }
|
||||||
zip = { version="0.5.9", optional = true }
|
zip = { version="0.5.9", optional = true }
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
@ -130,6 +130,13 @@ lazy_static! {
|
|||||||
AnsiCode{ short_name: Some("dgrd"), long_name: "dark_gray_dimmed", code: Color::DarkGray.dimmed().prefix().to_string()},
|
AnsiCode{ short_name: Some("dgrd"), long_name: "dark_gray_dimmed", code: Color::DarkGray.dimmed().prefix().to_string()},
|
||||||
AnsiCode{ short_name: Some("dgrr"), long_name: "dark_gray_reverse", code: Color::DarkGray.reverse().prefix().to_string()},
|
AnsiCode{ short_name: Some("dgrr"), long_name: "dark_gray_reverse", code: Color::DarkGray.reverse().prefix().to_string()},
|
||||||
|
|
||||||
|
AnsiCode{ short_name: Some("der"), long_name: "default", code: Color::Default.prefix().to_string()},
|
||||||
|
AnsiCode{ short_name: Some("deb"), long_name: "default_bold", code: Color::Default.bold().prefix().to_string()},
|
||||||
|
AnsiCode{ short_name: Some("deu"), long_name: "default_underline", code: Color::Default.underline().prefix().to_string()},
|
||||||
|
AnsiCode{ short_name: Some("dei"), long_name: "default_italic", code: Color::Default.italic().prefix().to_string()},
|
||||||
|
AnsiCode{ short_name: Some("ded"), long_name: "default_dimmed", code: Color::Default.dimmed().prefix().to_string()},
|
||||||
|
AnsiCode{ short_name: Some("der"), long_name: "default_reverse", code: Color::Default.reverse().prefix().to_string()},
|
||||||
|
|
||||||
AnsiCode{ short_name: None, long_name: "reset", code: "\x1b[0m".to_owned()},
|
AnsiCode{ short_name: None, long_name: "reset", code: "\x1b[0m".to_owned()},
|
||||||
// Reference for ansi codes https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
|
// Reference for ansi codes https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
|
||||||
// Another good reference http://ascii-table.com/ansi-escape-sequences.php
|
// Another good reference http://ascii-table.com/ansi-escape-sequences.php
|
||||||
@ -247,6 +254,7 @@ following values:
|
|||||||
35/95 magenta 45/105 magenta
|
35/95 magenta 45/105 magenta
|
||||||
36/96 cyan 46/106 cyan
|
36/96 cyan 46/106 cyan
|
||||||
37/97 white 47/107 white
|
37/97 white 47/107 white
|
||||||
|
39 default 49 default
|
||||||
https://en.wikipedia.org/wiki/ANSI_escape_code
|
https://en.wikipedia.org/wiki/ANSI_escape_code
|
||||||
|
|
||||||
OSC: '\x1b]' is not required for --osc parameter
|
OSC: '\x1b]' is not required for --osc parameter
|
||||||
@ -435,8 +443,8 @@ fn generate_ansi_code_list(
|
|||||||
};
|
};
|
||||||
let name: Value = Value::string(String::from(ansi_code.long_name), call_span);
|
let name: Value = Value::string(String::from(ansi_code.long_name), call_span);
|
||||||
let short_name = Value::string(ansi_code.short_name.unwrap_or(""), call_span);
|
let short_name = Value::string(ansi_code.short_name.unwrap_or(""), call_span);
|
||||||
// The first 96 items in the ansi array are colors
|
// The first 102 items in the ansi array are colors
|
||||||
let preview = if i < 96 {
|
let preview = if i < 102 {
|
||||||
Value::string(format!("{}NUSHELL\u{1b}[0m", &ansi_code.code), call_span)
|
Value::string(format!("{}NUSHELL\u{1b}[0m", &ansi_code.code), call_span)
|
||||||
} else {
|
} else {
|
||||||
Value::string("\u{1b}[0m", call_span)
|
Value::string("\u{1b}[0m", call_span)
|
||||||
|
@ -16,8 +16,7 @@ name = "nu_pretty_hex"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-ansi-term = "0.45.0"
|
nu-ansi-term = "0.45.1"
|
||||||
|
|
||||||
rand = "0.8.3"
|
rand = "0.8.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
Loading…
Reference in New Issue
Block a user