Skip to content

fall back to simple text output when stdout is not a tty#1392

Open
knQzx wants to merge 2 commits intoapple:mainfrom
knQzx:fix-pipe-output
Open

fall back to simple text output when stdout is not a tty#1392
knQzx wants to merge 2 commits intoapple:mainfrom
knQzx:fix-pipe-output

Conversation

@knQzx
Copy link
Copy Markdown

@knQzx knQzx commented Apr 5, 2026

summary

  • detect when stdout is not a tty and fall back to simple line-by-line status output
  • fixes silent commands when piping to a file

fixes #113

test plan

before (main):

$ container image pull ghcr.io/linuxcontainers/alpine:3.20 2>stderr.txt
$ cat stderr.txt
(empty - progress lost when stderr is not a tty)

after:

$ container image pull ghcr.io/linuxcontainers/alpine:3.20 2>stderr.txt
$ cat stderr.txt
[1/2] Fetching image [0s]
[1/2] Fetching image (7 of 15 blobs) [2s]
[1/2] Fetching image 42% (23 of 50 blobs, 10.0/23.7 MB, 6.9 MB/s) [5s]
[2/2] Unpacking image for platform linux/arm64 [11s]
...

also added TestCLIProgressAuto integration test covering auto/plain/none modes

@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Apr 5, 2026

@knQzx Thank you for the PR! Could you please add the commands you tested with, and before/after output, to the PR description?

Would it be possible to add an integration test for this?

@knQzx
Copy link
Copy Markdown
Author

knQzx commented Apr 5, 2026

added before/after output to the description and an integration test for this

@knQzx knQzx force-pushed the fix-pipe-output branch from 06daaac to 1f83bf4 Compare April 5, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commands like image pull don't output any status if stdout (or stderr) is being piped to a file

2 participants