Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Request] Plain line output for spinner and progress in CI

未关闭
#629 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
领域
cli

调研方向

Start by reading the implementations of spinner(), progress(), block() and the other live components in the repository, then trace how they detect CI and TTY output. The issue describes the desired plain-line behavior and final status lines; check existing component tests and add coverage for CI and non-TTY output. Done means logs contain no cursor codes, spinner frames or progress bars.

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.

When CI is "true", spinner() and progress() stop the animation. But the CI log still gets
terminal output that only makes sense on a TTY. This is the output of changeset publish
(changesets uses progress()) on GitHub Actions, with CI=true:

^[[?25l◒  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Publishing packages...
^[[1G^[[J◇  Successfully published:
...
^[[?25h^[[?25l◒  Creating git tags...
^[[1G^[[J◇  Created git tags.
^[[?25h

Progress updates also print lines like this one, with a new frame each time and no message:

◐  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The problems:

  1. Cursor codes: ESC[?25l and ESC[?25h from block(), and ESC[1G with ESC[J from the
    clear step. A CI log viewer shows them as noise.
  2. The spinner frame (◒, ◐) on each line. A frame of an animation means nothing in a log.
  3. The progress bar. Each update prints one more bar line, often with no message.
  4. Each change of the spinner message prints a new line. That is fine for real steps, but a
    message that only updates a counter or a string fills the log.

Describe the solution you'd like

In CI mode (or when the output is not a TTY), spinner(), progress() and the other live
components write plain lines only:

  • No cursor or erase codes, and no call to block() that hides the cursor.
  • No spinner frame and no progress bar. Print the message, then the final status line
    (◇ Done, ■ Cancelled, ▲ Failed).
  • Optional: an option to skip message updates in CI, so only the start and the end lines print.

Describe alternatives you've considered

  • Strip ANSI codes in each consumer, for example with a pipe through sed. Every CLI that uses
    clack must then do it, and a pipe can hide the exit code.
  • #286 (use isTTY for isCI). That changes when CI mode turns on. This request is about what
    CI mode prints. Both changes work well together.

Additional context

  • @clack/prompts 1.8.1, @clack/core 1.5.1, through @changesets/cli 3.0.3.
  • Node 26, GitHub Actions runner.
主要语言
TypeScript
星标
8.1k
派生
225
平均合并
12 小时 54 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bombshell-dev/clack 的其他 Issue

查看 bombshell-dev/clack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。