MCPcopy
hub / github.com/Textualize/rich / restore_cursor

Method restore_cursor

rich/live_render.py:72–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

test_restore_cursorFunction · 0.80
stopMethod · 0.80

Calls 1

ControlClass · 0.85

Tested by 1

test_restore_cursorFunction · 0.64