nushell/crates/nu-command/src/platform
Douglas 74bd0e32cc
ansi -l includes previews of attributes (e.g., bold, dimmed, blink, etc.) (#14196)
# Description

A few simple changes:

* Extends the range of previews to include the attributes - Bold,
italic, underline, etc.
* Also resets the colors before *every* preview. Previously we weren't
doing this, so the "string" theme color was bleeding into a few previews
(mostly, if not all, `bg` ones). Now the "default foreground" color is
used for any preview without an explicit foreground color.
* Moves the preview code into the `if use_ansi_coloring` block as a
stupid-nitpick optimization. There's no reason to populate the previews
when they are explicitly not shown with `use_ansi_coloring: false`.
* Moves `reset` to the bottom of the attribute list so that it isn't
previewed. This is a bit of a nitpick as well since internally we send
the same code for both a `reset` and `attr_normal` (which is correct),
but semantically a `reset` doesn't seem like a "previewable" thing,
whereas "normal" text can be demonstrated with a preview.

# User-Facing Changes

`ansi -l` now shows additional previews

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
2024-10-29 09:14:54 -05:00
..
ansi ansi -l includes previews of attributes (e.g., bold, dimmed, blink, etc.) (#14196) 2024-10-29 09:14:54 -05:00
input Respect $env.config.use_kitty_protocol in input listen (#13892) 2024-09-25 08:57:00 -05:00
clear.rs Send both 2J and 3J on clear (#14181) 2024-10-28 06:42:18 -05:00
dir_info.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
is_terminal.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
kill.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
mod.rs refactor: move du from platform to filesystem (#11852) 2024-02-15 06:55:21 +08:00
sleep.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
term_size.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
ulimit.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
whoami.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00