quarto emits ANSI cursor-control sequences when stderr is not a terminal
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- cli
調査の方向性
src/core/console.ts から始め、次に src/core/platform.ts の isInteractiveTerminal() と、src/core/log.ts の関連する処理を読みます。quarto check versions 2>\u00261 | cat -v で問題を再現し、カーソル制御と進捗出力をインタラクティブな stderr ターミナルの場合に限定します。リダイレクトまたはパイプされた出力に生の ANSI カーソル制御シーケンスが含まれず、ターミナルでの動作が引き続きインタラクティブであれば完了です。
索引モデルが issue の本文から書いたものです。
説明
When quarto's stderr is piped, redirected to a file, or consumed by an editor build tool (e.g. Emacs M-x compile, VS Code tasks), progress and spinner helpers still emit ANSI cursor-control sequences. These appear as raw escape bytes in the output buffer:
^[[0G^[[2K^[[J^[[0G^[[2K^[[J^[[0G
Reported in https://github.com/orgs/quarto-dev/discussions/14403
Root cause
src/core/console.ts emits cursor-control bytes without checking whether the output stream is a terminal. Specifically, clearLine() calls ansi.eraseLine.cursorLeft() unconditionally, and spinner() and progressBar() gate their output on runningInCI() but not on whether stderr is actually a TTY. withSpinner()'s cancel path always calls clearLine(), regardless of where output goes.
NO_COLOR does not cover this — it governs colors only. --log-format plain governs the log file format, not console output.
The codebase already has the right helper: isInteractiveTerminal() in src/core/platform.ts, which returns Deno.stderr.isTerminal(). It is already used in command/create/cmd.ts and command/publish/cmd.ts to gate interactive prompts, but not in src/core/console.ts.
src/core/log.ts's LogFileHandler.format() already handles this for file output — messages starting with \r are dropped because they are progress lines. The same "progress is terminal-only" notion is not applied to the stderr console handler or to clearLine().
Reproduction
Any quarto command that uses withSpinner or progressBar shows this when stderr is piped. The cleanest CLI-only form:
quarto check versions 2>&1 | cat -v
quarto install tinytex 2>&1 | cat -v
leading to something like
$ quarto check versions 2>&1 | cat -v
Quarto 1.10.3
^M[>] Checking versions of quarto binary dependencies...
Pandoc version 3.8.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.4.5: OK
Typst version 0.14.2: OK
^M[>] Checking versions of quarto dependencies......OK
Or via Emacs M-x compile running quarto render example.qmd --to html, where the compilation buffer is not a TTY.
Suggested direction
Gate clearLine(), spinner(), and progressBar() on isInteractiveTerminal() (extending the !runningInCI() check that is already there to also require a TTY). This matches the idiom already used for interactive prompts in create/publish, and aligns console behavior with the file-handler behavior in log.ts.
- 主要言語
- JavaScript
- スター
- 6k
- フォーク
- 461
- 平均マージ
- 13時間 37分
- マージ済み PR(30日)
- 53
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
accessibility bug revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto-cli#14961 ·
メンテナーはふだん 1 日以内に返信
-
accessibility documentation
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
quarto-dev/quarto-cli#14944 ·
メンテナーはふだん 1 日以内に返信
-
maintenance ojs-engine
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
quarto-dev/quarto-cli#14934 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug html themes
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/quarto-cli#14932 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
quarto-dev/quarto-cli#14915 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
feature task
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RealDevSquad/website-www#1178 ·
-
add latest sol modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
netlify-labs/nax#56 · コメント 2 件 · リアクション 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
PnX-SI/GeoNature#4435 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
openlayers/openlayers#17648 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100