fix(cli): suppress legacy task spinner when stdout is not a TTY#5400
Open
zlotnika wants to merge 1 commit into
Open
fix(cli): suppress legacy task spinner when stdout is not a TTY#5400zlotnika wants to merge 1 commit into
zlotnika wants to merge 1 commit into
Conversation
v2.102.0 ported branches/secrets/orgs/etc. to TypeScript. The new textOutputLayer.task starts a @Clack spinner after 200ms regardless of whether stdout is a TTY, so commands like `supabase branches list --output json` in CI emit cursor-hide and animated-frame ANSI to stdout ahead of the JSON, breaking jq parsing. Skip the spinner entirely when stdout is not a TTY — the animated frames are meaningless without a terminal, and stdout there is being consumed by a pipe / redirect / CI runner. Fixes supabase#5397
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.
v2.102.0 ported
branches,secrets,orgs,sso,ssl-enforcement,network-restrictions,backups, etc. to TS. Each ported handler wraps its API call in:output.formatis the TS--output-formatflag, not the Go--outputflag (goFmt). Passing Go-style--output jsonleavesoutput.format === "text", so the@clackspinner starts after 200ms and writes cursor-hide (ESC [?25l) + a frame to stdout ahead of the JSON — breaking jq in CI. Go pre-2.102.0 emitted clean JSON.Fix at the source:
textOutputLayer.taskreturns a no-op task whentty.stdoutIsTtyis false. Covers all 28+ ported call sites without per-handler patches; thejsonOutputLayer/streamJsonOutputLayertask impls already route through stderr / events.Test asserts
spinner()is never called whenstdoutIsTty: false.Fixes #5397