Skip to content

Commit

Permalink
Use nu-ansi-term instead of ansi-term
Browse files Browse the repository at this point in the history
Because ansi-term is no longer maintained.

Relates-To: #1188
  • Loading branch information
tmccombs committed Dec 1, 2022
1 parent 2aa966c commit 2c9c753
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
33 changes: 20 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ path = "src/main.rs"
version_check = "0.9"

[dependencies]
ansi_term = "0.12"
nu-ansi-term = "0.46"
argmax = "0.3.1"
atty = "0.2"
ignore = "0.4.3"
Expand All @@ -42,7 +42,6 @@ regex = "1.6.0"
regex-syntax = "0.6"
ctrlc = "3.2"
humantime = "2.1"
lscolors = "0.12"
globset = "0.4"
anyhow = "1.0"
dirs-next = "2.0"
Expand All @@ -57,6 +56,11 @@ faccess = "0.2.4"
version = "4.0.22"
features = ["suggestions", "color", "wrap_help", "cargo", "unstable-grouped", "derive"]

[dependencies.lscolors]
version = "0.13"
default-features = false
features = ["nu-ansi-term"]

[target.'cfg(unix)'.dependencies]
users = "0.11.0"
nix = { version = "0.24.2", default-features = false, features = ["signal"] }
Expand Down
6 changes: 3 additions & 3 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn print_trailing_slash<W: Write>(
stdout,
"{}",
style
.map(Style::to_ansi_term_style)
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default()
.paint(&config.actual_path_separator)
)?;
Expand Down Expand Up @@ -85,14 +85,14 @@ fn print_entry_colorized<W: Write>(

let style = ls_colors
.style_for_indicator(Indicator::Directory)
.map(Style::to_ansi_term_style)
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default();
write!(stdout, "{}", style.paint(parent_str))?;
}

let style = entry
.style(ls_colors)
.map(Style::to_ansi_term_style)
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default();
write!(stdout, "{}", style.paint(&path_str[offset..]))?;

Expand Down

0 comments on commit 2c9c753

Please sign in to comment.