Repository navigation
fix(cli-framework): take the terminal as an input to table() - #9993
Merged
Merged
Conversation
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.
Contributor
|
Caution Review failedThe pull request is closed.
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. |
saddlepaddle
force-pushed
the
fix/cli-hyperlink-capability
branch
from
November 19, 2026 01:29
ef0b5c5 to
f29569d
Compare
Contributor
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Main's Test job fails on two
cli-frameworktests:table > links the URL it printsandtable > keeps padding outside the link so it stops at the URL(output.test.tslines 81 and 92).Cause.
table()decided on OSC 8 links by readingprocess.stdout.isTTYandprocess.env.TERMitself. The tests forcedisTTYbut inheritedTERMfrom the runner. Some CI runners setTERM=dumb, and on thosetable()correctly printed plain URLs. So the result depended on which runner the job got. A one-line debug run on this branch's CI printedTERM=dumb isTTY=undefinedinside 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 realprocess.stdout.isTTYandTERM, 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 overridesprocess.stdout.isTTYand does not setTERM.i18n:build"exit 1" in the same run is not a real failure. Turbo's summary lists only@superset/cli-framework#testas failed.lingui compilestopped 0.17 s after that failure, because turbo stops running tasks when one fails. On main,bun run check:i18nandlingui compile --strictboth 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.tspasses 15/0 withTERM=dumband withTERM=xterm-256color. On main it fails 2 tests withTERM=dumb. The full package suite passes (95/0).tsc --noEmitand biome are clean.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