Skip to content

Progress output pollutes logs when stdout is not a TTY (playground/cluster downloads) #2657

@alastori

Description

@alastori
  • TiUP version: v1.16.4 (darwin-arm64)
  • Component versions: playground nightly (v9.0.0-beta.2.pre-nightly)
  • Environment: macOS; running tiup from a shell, redirecting stdout/stderr to files (non-TTY)

Steps to reproduce:

  1. Run: tiup playground nightly --without-monitor --mode tidb --db 1 --kv 1 --tiflash 0 --pd 1 --tag logtest2 >playground.log 2>&1
  2. Open playground.log.

Actual result:

  • Log contains cursor-control escape sequences and progress-overwrite junk, e.g. \x1b[1A\r\x1b[2K- TiDB: 127.0.0.1:4000 ... Done\x1b[1B\r\x1b[2K.
  • Download progress lines are glued together on one line (no newlines).
  • CI=true, NO_COLOR, or piping through tr '\r' '\n' do not prevent the cursor-move escape sequences. Playground has no --format/plain mode.

Expected result:

  • When stdout is not a TTY, progress/spinners and cursor movements should be disabled or reduced to plain one-line updates so redirected logs are clean.

Known workarounds:

  • For cluster commands only: --format plain/--format json avoids starting the spinner loop.
  • For playground/download output: only post-processing helps today (col -b or sed 's/\x1b\[[0-9;]*[A-Za-z]//g'); there is no built-in plain/CI mode.

Notes:

  • A minimal TTY check and auto-switch to plain when stdout is not a terminal (or a --no-progress/--ci flag) would address this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions