radicle-heartwood-lfs/crates
Richard Levitte ee17109501 Fix NO_COLOR to only suppress colors, not all ANSI styles
The NO_COLOR convention (https://no-color.org) only calls for
suppressing ANSI *color* codes. It does not demand the removal of
other attributes such as bold, italic, underline or reverse.

Previously, Paint::is_enabled() bundled anstyle_query::no_color()
into the single boolean that decides whether to emit any formatting.
Because Paint relies on that boolean alone, NO_COLOR ended up
stripping bold, italic, reverse, etc. alongside the color codes.
That conflates two concerns: terminal styling support and color
suppression. It is also contrary to the intent of the standard.

Instead, treat the general style decision separately from the
color decision.  Remove the no_color() check from is_enabled()
and add Paint::is_styling_enabled() for the coarse terminal gate.
Style::fmt_prefix and fmt_suffix now query NO_COLOR directly and
conditionally drop foreground and background codes while preserving
non-colour properties.  This way bold, italic, underline and the
like continue to work when NO_COLOR is set, while colors alone are
suppressed.

Closes: rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/cob/xyz.radicle.issue/f922d90
Assisted-by: Pi:deepinfra/moonshotai/Kimi-K2.6
Signed-off-by: Richard Levitte <richard@levitte.org>
2026-06-23 17:23:36 +01:00
..
radicle radicle/cob: Include command name on spawn fail 2026-06-17 23:22:10 +02:00
radicle-cli radicle-cli: fix tests for git ddiff on Windows. 2026-06-23 17:17:39 +01:00
radicle-cli-test cli-test: Disable normalizing paths 2026-06-03 11:49:41 +02:00
radicle-cob cob/change_graph: Log Errors 2026-05-28 16:58:55 +01:00
radicle-core core: Release 0.3.0 2026-05-06 21:00:14 +01:00
radicle-crypto crypto: Handle default `SSH_AUTH_SOCK` on Windows 2026-05-26 09:18:07 +02:00
radicle-dag rust/msrv: 1.85.0 → 1.88.0 2026-05-11 11:23:18 +01:00
radicle-fetch fetch: Update gix packages 2026-05-18 14:57:33 +02:00
radicle-git-metadata rust/msrv: 1.85.0 → 1.88.0 2026-05-11 11:23:18 +01:00
radicle-git-ref-format git-ref-format: New crate 2025-10-13 13:34:15 +02:00
radicle-localtime localtime: add description in Cargo.toml 2026-02-20 13:48:14 +00:00
radicle-log log: New crate for logger implementations 2026-05-11 16:44:37 +01:00
radicle-node node/wire: Test connected node removes active fetch 2026-06-22 18:02:57 +01:00
radicle-oid oid: Release 0.2.0 2026-05-06 21:00:14 +01:00
radicle-protocol fetcher: Test removing active fetch from another node 2026-06-22 18:02:57 +01:00
radicle-remote-helper remote-helper: Introduce magic push ref 'refs/for/' 2026-06-09 11:37:26 +02:00
radicle-schemars schemars: Release 0.8.0 2026-05-06 21:15:54 +01:00
radicle-signals rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-systemd systemd: Release 0.13.0 2026-05-06 21:00:14 +01:00
radicle-term Fix NO_COLOR to only suppress colors, not all ANSI styles 2026-06-23 17:23:36 +01:00
radicle-windows rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00