Comment 5 for bug 387717

Revision history for this message
David I (david-ingamells) wrote : Re: [Bug 387717] Re: don't want progress bars sent to stderr

Martin Pool wrote:
> See bug 388275 for the wish to configure this in a file.
>
> bzr does check isatty at the moment, but it checks it only on stdin,
> whereas it would be more appropriate to check whether stderr is a tty
> before showing the progress bar.
>
> David, in the case where bzr is showing a progress bar, leaving aside
> for the moment how we decide when that should be done, where do you
> think it should be sent, if not to stderr? stdout? /dev/tty?
>
> ** Summary changed:
>
> - progress report should be user configurable
> + don't want progress bars sent to stderr
>
I should have checked all the mail before I replied to the first one!

Despite Matthew's attempts I still stand by the principle that STDERR
should be clean, however I feel even more that stdout must be clean.
The original design in UNIX with stdin,stdout and stderr always being
opened for every program was at the time inspired. What wasn't known
then was the importance of interactive users and their desire to be
reassured with progress bars! In retrospect probably there should have
been another handle for "occasional non-crucial informative output".
While bash does provide a means to use other handles this is not easy to
use and may not be available in other OS's.

As I said in the response to the forum, /dev/tty is not available to
detached scripts or daemons - which also can't benefit from the progress
bar anyway. I do recognise that the least evil place is stderr.

You could avoid the question by providing a config option for the user
to select where to send the progress bar, but that may be gilding the lily.

If the environment-variable/config-file option is available the issue
becomes less important - especially if the default is OFF ;)
The issue can be further reduced by only showing progress when things
happen slowly enough that the user could need reassuring. A progress bar
that changes (and then disappears) so quickly that it cannot be read is
not worth much.

Thanks for taking my remarks seriously,

David.