Skip to content

fix(color-support): treat TERM=dumb as no color before applying COLORTERM, #49 - #51

Merged
webdiscus merged 1 commit into
masterfrom
next
Sep 13, 2026
Merged

webdiscus merged 1 commit into
masterfrom
next

Conversation

@webdiscus

Copy link
Copy Markdown
Owner
  • fix(color-support): treat TERM=dumb as no color before applying COLORTERM, TERM=dumb is ignored when COLORTERM is set #49.

    COLORTERM is a color level hint.
    When TERM=dumb, Ansis now disables ANSI color output even if color environment variables such as COLORTERM=truecolor were inherited from a parent process (e.g. in Emacs M-x compile).

    FORCE_COLOR keeps the highest priority and can still explicitly enable colors.

    Auto-detection behavior changes after the fix

    Use case v4.3.1 v4.4.0 Notes
    TERM=dumb ✅ may allow colors * ❌ no color TERM=dumb now has higher priority in autoDetectLevel.
    TERM=dumb + COLORTERM=truecolor ✅ allow colors ❌ no color COLORTERM no longer overrides TERM=dumb.
    TERM=dumb + CI ✅ allow colors ❌ no color CI detection runs after TERM=dumb.
    TERM=dumb + PM2 ✅ may allow colors * ❌ no color PM2 detection runs after TERM=dumb.
    TERM=dumb + Next.js runtime ✅ may allow colors * ❌ no color Next.js detection runs after TERM=dumb.
    COLORTERM without TERM=dumb ✅ allow colors ✅ allow colors Unchanged.
    CI without TERM=dumb ✅ allow colors ✅ allow colors Unchanged.
    PM2 without TERM=dumb ✅ allow colors ✅ allow colors Unchanged.
    Next.js without TERM=dumb ✅ allow colors ✅ allow colors Unchanged.

    * - Depends on additional conditions.

  • test(color-support): add regression coverage for TERM=dumb with inherited COLORTERM=truecolor

    The tests also cover PM2 and Next.js edge behavior where stdout.isTTY is not exposed.

  • test: add a manual color support checker

    Run npm run color-checker to print the environment values used by color detection and visually inspect ANSI 16, ANSI 256, and Truecolor rendering.

  • test(deno): run CI against Deno 2.3+ and the current LTS

    Deno 2.0-2.2 are no longer tested in the CI matrix because they cannot use the same deno.lock v5 format as Deno 2.3+.
    Runtime compatibility with Deno 2.0-2.2 remains supported.

@webdiscus webdiscus added bug Something isn't working enhancement New feature or request labels Sep 13, 2026
@codecov-commenter

codecov-commenter commented Sep 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (678da3a) to head (a724646).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          595       601    +6     
  Branches        87        89    +2     
=========================================
+ Hits           595       601    +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@webdiscus webdiscus left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

@webdiscus
webdiscus merged commit d5b557c into master Sep 13, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants