diff --git a/Cargo.lock b/Cargo.lock index 3e07b5090d..806f29cb52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,15 +31,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "1.0.0" @@ -651,7 +642,6 @@ dependencies = [ name = "just" version = "1.51.0" dependencies = [ - "ansi_term", "blake3", "camino", "chrono", @@ -666,6 +656,7 @@ dependencies = [ "lexiclean", "libc", "nix", + "nu-ansi-term", "num_cpus", "percent-encoding", "pretty_assertions", @@ -754,6 +745,15 @@ dependencies = [ "libc", ] +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1442,28 +1442,6 @@ dependencies = [ "libc", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.62.2" diff --git a/Cargo.toml b/Cargo.toml index 69f23a9bc2..bc556b8732 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ rust-version = "1.85.0" members = [".", "crates/*"] [dependencies] -ansi_term = "0.12.0" blake3 = { version = "1.5.0", features = ["rayon", "mmap"] } camino = "1.0.4" chrono = "0.4.38" @@ -31,6 +30,7 @@ heck = "0.5.0" is_executable = "1.0.4" lexiclean = "0.0.1" libc = "0.2.0" +nu-ansi-term = "0.50.3" num_cpus = "1.15.0" percent-encoding = "2.3.1" rand = "0.10.0" diff --git a/src/color.rs b/src/color.rs index 2038ad1722..12e186d06c 100644 --- a/src/color.rs +++ b/src/color.rs @@ -1,6 +1,10 @@ use { super::*, - ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix}, + nu_ansi_term::{ + AnsiGenericString, + Color::{Blue, Cyan, Green, Purple, Red, Yellow}, + Prefix, Style, Suffix, + }, std::io::{self, IsTerminal}, }; @@ -44,7 +48,7 @@ impl Color { self.restyle(Style::new().fg(Cyan).bold()) } - pub(crate) fn command(self, foreground: Option) -> Self { + pub(crate) fn command(self, foreground: Option) -> Self { self.restyle(Style { foreground, is_bold: true, @@ -103,7 +107,7 @@ impl Color { } } - pub(crate) fn paint<'a>(&self, text: &'a str) -> ANSIGenericString<'a, str> { + pub(crate) fn paint<'a>(&self, text: &'a str) -> AnsiGenericString<'a, str> { self.effective_style().paint(text) } diff --git a/src/command_color.rs b/src/command_color.rs index 5f3e7bd51c..0b02aa227e 100644 --- a/src/command_color.rs +++ b/src/command_color.rs @@ -11,7 +11,7 @@ pub(crate) enum CommandColor { Yellow, } -impl From for ansi_term::Color { +impl From for nu_ansi_term::Color { fn from(command_color: CommandColor) -> Self { match command_color { CommandColor::Black => Self::Black, diff --git a/src/config.rs b/src/config.rs index 2e24fbbeae..28d72c5e2c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,7 @@ pub(crate) struct Config { pub(crate) ceiling: Option, pub(crate) check: bool, pub(crate) color: Color, - pub(crate) command_color: Option, + pub(crate) command_color: Option, pub(crate) complete_aliases: bool, pub(crate) cygpath: PathBuf, pub(crate) dotenv_filename: Option, diff --git a/src/run.rs b/src/run.rs index 90d2483991..884952defb 100644 --- a/src/run.rs +++ b/src/run.rs @@ -4,7 +4,7 @@ use super::*; #[allow(clippy::missing_errors_doc)] pub fn run(args: impl Iterator + Clone>) -> Result<(), i32> { #[cfg(windows)] - ansi_term::enable_ansi_support().ok(); + nu_ansi_term::enable_ansi_support().ok(); let arguments = Arguments::try_parse_from(args).map_err(|err| { err.print().ok();