Skip to content

Blinking while clearing #45

Description

@naktinis

I've noticed that the progress bar sometimes blinks when clearing. I think it's caused by this line in WritelnMixin:

print('\r\x1b[K', end='', file=self.file)

This control sequence introducer \x1b[K is supposed to clear the characters to the right of the cursor, while \r returns the cursor to the left.

At least in my case it is enough to use \r without clearing anything. The characters will get overridden. Changing the line to print('\r', end='', file=self.file) and I haven't noticed any side effects yet. But maybe I'm missing something obvious here?

Outcome of using \r\x1b[K:
blinking

Outcome of using \r:
not_blinking

So my suggestion would be to either simply use \r for "clearing" the line, or to at least let the user customize this via some parameter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions