I'm trying to log a script in its entire form using tee. Part of the script involves downloading files which which feature a progress bar to track the percentage downloaded and I've noticed this progress bar no longer appears on the terminal after using tee to log the whole script.
Is there a workaround for this to get the progress bar to once again display on the terminal?
In general, well-written programs with content such as progress bars suppress such interactive content when writing to a FIFO (or, more generally, to a FD without an associated TTY) to make their logs easier to read or parse, which is why piping to tee
is having the effect that it is. (Programs which use stderr rather than stdout for their progress bars might be more resistant, disabling the bar only when stderr is a non-TTY display).
If you want to fake having a TTY, tools such as EmPTY can do this. However, this will mean that all the progress-bar-related cruft will end up in your log file, which can make it both large and difficult to read or parse.
Unfortunately, you can only have it both ways (progress bar to the TTY, non-bar content including stderr to a file) if the software you're running was explicitly written to allow that, which is rarely done if ever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With