1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -63,4 +63,4 @@
-[dependencies.ansi_term]
-version = "0.12.0"
+[dependencies.nu-ansi-term]
+version = ">= 0.50, < 1"
--- a/src/color.rs
+++ b/src/color.rs
@@ -1,9 +1,11 @@
use {
super::*,
- ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix},
+ nu_ansi_term::{AnsiGenericString, Color::*, Prefix, Style, Suffix},
std::io::{self, IsTerminal},
};
+use std::default::Default;
+
#[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) struct Color {
is_terminal: bool,
@@ -43,7 +43,7 @@
self.restyle(Style::new().fg(Cyan).bold())
}
- pub(crate) fn command(self, foreground: Option<ansi_term::Color>) -> Self {
+ pub(crate) fn command(self, foreground: Option<nu_ansi_term::Color>) -> Self {
self.restyle(Style {
foreground,
is_bold: true,
@@ -98,7 +98,7 @@
}
}
- 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)
}
--- a/src/command_color.rs
+++ b/src/command_color.rs
@@ -11,7 +11,7 @@
Yellow,
}
-impl From<CommandColor> for ansi_term::Color {
+impl From<CommandColor> for nu_ansi_term::Color {
fn from(command_color: CommandColor) -> Self {
match command_color {
CommandColor::Black => Self::Black,
--- a/src/config.rs
+++ b/src/config.rs
@@ -17,7 +17,7 @@
pub(crate) ceiling: Option<PathBuf>,
pub(crate) check: bool,
pub(crate) color: Color,
- pub(crate) command_color: Option<ansi_term::Color>,
+ pub(crate) command_color: Option<nu_ansi_term::Color>,
pub(crate) cygpath: PathBuf,
pub(crate) dotenv_filename: Option<String>,
pub(crate) dotenv_path: Option<PathBuf>,
--- a/src/run.rs
+++ b/src/run.rs
@@ -4,7 +4,7 @@
#[allow(clippy::missing_errors_doc)]
pub fn run(args: impl Iterator<Item = impl Into<OsString> + Clone>) -> Result<(), i32> {
#[cfg(windows)]
- ansi_term::enable_ansi_support().ok();
+ nu_ansi_term::enable_ansi_support().ok();
let app = Config::app();
|