Open
Description
Currently, we attempt to run tput
as a subprocess just before printing a progress bar, this is obviously a huge waste since the terminal width doesn't change that often.
We should measure the terminal width once, and update that value only when the terminal width changes. We can be informed of such changes by registering a signal handler for SIGWINCH
.
Due to the complexities of handling signals from a multithreaded python program, this item might be impossible or very difficult, and I have no idea how to test it.
Acceptance
The _OutputAccumulator
class shells out to tput
once at program startup, and then only again when the controlling terminal size changes.