Skip to content

Don't run tput every time we print a progress bar #86

Open
@karkhaz

Description

@karkhaz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions