Get control codes to clear the render and restore the cursor to its previous position. Returns: Control: A Control instance that may be printed.
(self)
| 70 | return Control() |
| 71 | |
| 72 | def restore_cursor(self) -> Control: |
| 73 | """Get control codes to clear the render and restore the cursor to its previous position. |
| 74 | |
| 75 | Returns: |
| 76 | Control: A Control instance that may be printed. |
| 77 | """ |
| 78 | if self._shape is not None: |
| 79 | _, height = self._shape |
| 80 | return Control( |
| 81 | ControlType.CARRIAGE_RETURN, |
| 82 | *((ControlType.CURSOR_UP, 1), (ControlType.ERASE_IN_LINE, 2)) * height |
| 83 | ) |
| 84 | return Control() |
| 85 | |
| 86 | def __rich_console__( |
| 87 | self, console: Console, options: ConsoleOptions |