Bug#901758: diffoscope: leaves progress bar on terminal after completion

Paul Wise pabs at debian.org
Sat Jul 7 05:56:18 BST 2018


On Fri, 06 Jul 2018 18:50:44 +0100 Chris Lamb wrote:

> https://salsa.debian.org/reproducible-builds/diffoscope/commit/68c8263a430aca779b0c44fd31e729ae9bd59e0b.patch

> +                # Clear the progress bar after completion (#901758)

I don't think mentioning the bug in the comment is useful here,
since the comment is self explanatory without the bug link.

> +                self.fd.write("\033[K")

This isn't going to work if the terminal being used doesn't support
that escape sequence or if the user requested a progress bar but
directed output to a file. I'd suggest the approach I mentioned in the
initial bug report instead. Detect the erase-to-eol escape sequence
for the current terminal, use spaces if the current terminal doesn't
support it and don't print anything if the output is not a terminal.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20180707/9d6cb302/attachment-0001.sig>


More information about the Reproducible-builds mailing list