Rewinds the terminal cursor to the beginning and writes the given line. :param erase: If True, will also add spaces until the full terminal width to ensure previous lines are properly erased. The rest of the keyword arguments are markup instructions.
(self, line: str, **markup: bool)
| 423 | self._tw.line(line, **markup) |
| 424 | |
| 425 | def rewrite(self, line: str, **markup: bool) -> None: |
| 426 | """Rewinds the terminal cursor to the beginning and writes the given line. |
| 427 | |
| 428 | :param erase: |
| 429 | If True, will also add spaces until the full terminal width to ensure |
| 430 | previous lines are properly erased. |
| 431 | |
| 432 | The rest of the keyword arguments are markup instructions. |
| 433 | """ |
| 434 | erase = markup.pop("erase", False) |
| 435 | if erase: |
| 436 | fill_count = self._tw.fullwidth - len(line) - 1 |
| 437 | fill = " " * fill_count |
| 438 | else: |
| 439 | fill = "" |
| 440 | line = str(line) |
| 441 | self._tw.write("\r" + line + fill, **markup) |
| 442 | |
| 443 | def write_sep( |
| 444 | self, |