Skip to content

fix(cli-framework): take the terminal as an input to table() - #9993

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/cli-hyperlink-capability
Nov 19, 2026
Merged

saddlepaddle merged 1 commit into
mainfrom
fix/cli-hyperlink-capability

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What and why

Main's Test job fails on two cli-framework tests: table > links the URL it prints and table > keeps padding outside the link so it stops at the URL (output.test.ts lines 81 and 92).

Cause. table() decided on OSC 8 links by reading process.stdout.isTTY and process.env.TERM itself. The tests forced isTTY but inherited TERM from the runner. Some CI runners set TERM=dumb, and on those table() correctly printed plain URLs. So the result depended on which runner the job got. A one-line debug run on this branch's CI printed TERM=dumb isTTY=undefined inside the test process. That line is removed. Credit to #9664, whose author found this cause.

Fix. table() takes the terminal ({ isTTY, term }) as an optional last parameter. It defaults to the real process.stdout.isTTY and TERM, read at each call, so the existing callers do not change and production output is the same. The tests now state the terminal they test, and one test covers the dumb terminal. The test no longer overrides process.stdout.isTTY and does not set TERM.

i18n:build "exit 1" in the same run is not a real failure. Turbo's summary lists only @superset/cli-framework#test as failed. lingui compile stopped 0.17 s after that failure, because turbo stops running tasks when one fails. On main, bun run check:i18n and lingui compile --strict both exit 0, with 0 missing messages in every locale. This PR has no i18n change.

What breaks

Nothing. table()'s new parameter is optional and has a default.

How I verified

  • packages/cli-framework: bun test src/output.test.ts passes 15/0 with TERM=dumb and with TERM=xterm-256color. On main it fails 2 tests with TERM=dumb. The full package suite passes (95/0). tsc --noEmit and biome are clean.
  • PR CI on a runner with TERM=dumb: Test passed.

Evidence: https://app.superset.sh/page/mainfix-2-take-the-terminal-as-an-input-to-table-60m3z7
Design: https://app.superset.sh/page/admin-cloud-workspace-cost-and-health-design-8z3d4d

table() decided on OSC 8 links by reading process.stdout.isTTY and
TERM itself, so its tests depended on the runner. A runner with
TERM=dumb printed plain URLs and failed the link tests.

table() now takes the terminal as an optional last parameter. It
defaults to the real stdout and TERM, so callers do not change. The
tests state the terminal they test, and keep one dumb-terminal case.

The cause was found in #9664.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

This branch was previously deployed

1 inactive deployment
preview — f29569dc Deployed Nov 19, 2026 by saddlepaddle via Cleanup Preview Resources #5804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant