mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
Respect use_ansi_coloring
setting in banner
(#14049)
# Description Partial fix for #14043 - If `$env.config.use_ansi_coloring` is `false`, strip the ansi coloring before displaying. # User-Facing Changes Bug fix # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A
This commit is contained in:
parent
1d15bbc95b
commit
3bedbd0669
1 changed files with 7 additions and 1 deletions
|
@ -3,7 +3,8 @@ use std/dt [datetime-diff, pretty-print-duration]
|
||||||
# Print a banner for nushell with information about the project
|
# Print a banner for nushell with information about the project
|
||||||
export def banner [] {
|
export def banner [] {
|
||||||
let dt = (datetime-diff (date now) 2019-05-10T09:59:12-07:00)
|
let dt = (datetime-diff (date now) 2019-05-10T09:59:12-07:00)
|
||||||
$"(ansi green) __ ,(ansi reset)
|
|
||||||
|
let banner_msg = $"(ansi green) __ ,(ansi reset)
|
||||||
(ansi green) .--\(\)°'.' (ansi reset)Welcome to (ansi green)Nushell(ansi reset),
|
(ansi green) .--\(\)°'.' (ansi reset)Welcome to (ansi green)Nushell(ansi reset),
|
||||||
(ansi green)'|, . ,' (ansi reset)based on the (ansi green)nu(ansi reset) language,
|
(ansi green)'|, . ,' (ansi reset)based on the (ansi green)nu(ansi reset) language,
|
||||||
(ansi green) !_-\(_\\ (ansi reset)where all data is structured!
|
(ansi green) !_-\(_\\ (ansi reset)where all data is structured!
|
||||||
|
@ -19,6 +20,11 @@ It's been this long since (ansi green)Nushell(ansi reset)'s first commit:
|
||||||
|
|
||||||
Startup Time: ($nu.startup-time)
|
Startup Time: ($nu.startup-time)
|
||||||
"
|
"
|
||||||
|
|
||||||
|
match $env.config?.use_ansi_coloring? {
|
||||||
|
false => { $banner_msg | ansi strip }
|
||||||
|
_ => $banner_msg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Return the current working directory
|
# Return the current working directory
|
||||||
|
|
Loading…
Reference in a new issue