Use the repeat escape code for progress bar rendering

This commit is contained in:
Kovid Goyal
2021-09-16 17:55:22 +05:30
parent aa9a991a85
commit eaeece8177
3 changed files with 17 additions and 8 deletions

View File

@@ -114,6 +114,11 @@ def without_line_wrap(write: Callable[[str], None]) -> Generator[None, None, Non
write(set_line_wrapping(True))
@cmd
def repeat(char: str, count: int) -> str:
return f'{char}\x1b[{abs(count)}b'
@cmd
def set_cursor_visible(yes_or_no: bool) -> str:
return set_mode(Mode.DECTCEM) if yes_or_no else reset_mode(Mode.DECTCEM)