[GH-ISSUE #342] By default, disable progress indicator if stdout is redirected to a file #154

Closed
opened 2026-06-08 11:25:54 +03:00 by zhus · 2 comments
Owner

Originally created by @jjvliu on GitHub (Nov 9, 2023).
Original GitHub issue: https://github.com/bootandy/dust/issues/342

When running a command like dust > dust.log, the output file will begin with an extremely long line that contains every copy of the progress indicator and control characters for erasing the terminal, such as

^M ^MIndexing: /path/to/dir 6894 files, 5.3G ... -^M                                                              ^MIndexing: /path/to/dir 14345 files, 268G ... \

A simple fix for this would be to enable the -P or --no-progress flag by default if dust detects that stdout was redirected to a file, for example using !isatty from libc.

Originally created by @jjvliu on GitHub (Nov 9, 2023). Original GitHub issue: https://github.com/bootandy/dust/issues/342 When running a command like `dust > dust.log`, the output file will begin with an extremely long line that contains every copy of the progress indicator and control characters for erasing the terminal, such as ^M ^MIndexing: /path/to/dir 6894 files, 5.3G ... -^M ^MIndexing: /path/to/dir 14345 files, 268G ... \ A simple fix for this would be to enable the `-P` or `--no-progress` flag by default if `dust` detects that stdout was redirected to a file, for example using `!isatty` from libc.
zhus closed this issue 2026-06-08 11:25:54 +03:00
Author
Owner

@bootandy commented on GitHub (Nov 9, 2023):

good idea.

<!-- gh-comment-id:1804647440 --> @bootandy commented on GitHub (Nov 9, 2023): good idea.
Author
Owner

@bootandy commented on GitHub (Nov 22, 2023):

Fixed on head.

<!-- gh-comment-id:1821748244 --> @bootandy commented on GitHub (Nov 22, 2023): Fixed on head.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#154