Skip to content

fix(@effect/cli): use Ansi.blackBright for Weak spans so --help is readable on dark terminals#6208

Open
Zelys-DFKH wants to merge 1 commit intoEffect-TS:mainfrom
Zelys-DFKH:fix/cli-weak-span-readable-on-dark-terminals
Open

fix(@effect/cli): use Ansi.blackBright for Weak spans so --help is readable on dark terminals#6208
Zelys-DFKH wants to merge 1 commit intoEffect-TS:mainfrom
Zelys-DFKH:fix/cli-weak-span-readable-on-dark-terminals

Conversation

@Zelys-DFKH
Copy link
Copy Markdown

Fixes #6200

@effect/cli marks "Weak" spans in --help output with Ansi.black, which produces ANSI code 30 (black foreground). On dark terminal backgrounds (the default in most modern terminals), the text becomes black-on-black and disappears. NO_COLOR=1 does not help; the styling is applied in the annotation layer before the renderer sees it.

The fix is in toAnsiDoc in packages/cli/src/internal/helpDoc/span.ts:

// before
case "Weak": {
  return Doc.annotate(toAnsiDoc(self.value), Ansi.black)
}

// after
case "Weak": {
  return Doc.annotate(toAnsiDoc(self.value), Ansi.blackBright)
}

Ansi.blackBright is ANSI code 90 (dark gray), readable on dark and light backgrounds. Ansi.dim would be cleaner semantically for de-emphasized text, but it is not exported by @effect/printer-ansi, so blackBright is the right call within the current API.

I added a regression test that renders a Weak span through HelpDoc.toAnsiDoc and asserts ANSI code 30 is absent. All 162 existing CLI tests pass.

Love the library. Glad to contribute!

…adable on dark terminals

Weak spans were annotated with Ansi.black (ANSI code 30), which is
invisible on dark/black terminal backgrounds. Ansi.blackBright (code 90,
dark gray) is readable on both dark and light terminals.
@Zelys-DFKH Zelys-DFKH requested a review from IMax153 as a code owner May 2, 2026 21:39
@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog May 2, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 2, 2026

🦋 Changeset detected

Latest commit: 977a4eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

@effect/cli: --help output uses hardcoded black foreground, unreadable on dark terminals

1 participant