MCPcopy Index your code
hub / github.com/python/cpython / restore

Method restore

Lib/_pyrepl/unix_console.py:381–400  ·  view source on GitHub ↗

Restore the console to the default state

(self)

Source from the content-addressed store, hash-verified

379 self.__enable_bracketed_paste()
380
381 def restore(self):
382 """
383 Restore the console to the default state
384 """
385 self.__disable_bracketed_paste()
386 self.__maybe_write_code(self._rmkx)
387 self.flushoutput()
388 self.__input_fd_set(self.__svtermstate)
389
390 if self.is_apple_terminal:
391 os.write(self.output_fd, b"\033[?7h")
392
393 if hasattr(self, "old_sigwinch"):
394 try:
395 signal.signal(signal.SIGWINCH, self.old_sigwinch)
396 except ValueError as e:
397 import threading
398 if threading.current_thread() is threading.main_thread():
399 raise e
400 del self.old_sigwinch
401
402 def push_char(self, char: int | bytes) -> None:
403 """

Calls 5

__maybe_write_codeMethod · 0.95
flushoutputMethod · 0.95
__input_fd_setMethod · 0.95
writeMethod · 0.45