MCPcopy Index your code
hub / github.com/RustPython/RustPython / restore

Method restore

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

Restore the console to the default state

(self)

Source from the content-addressed store, hash-verified

365 self.__enable_bracketed_paste()
366
367 def restore(self):
368 """
369 Restore the console to the default state
370 """
371 self.__disable_bracketed_paste()
372 self.__maybe_write_code(self._rmkx)
373 self.flushoutput()
374 tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
375
376 if platform.system() == "Darwin" and os.getenv("TERM_PROGRAM") == "Apple_Terminal":
377 os.write(self.output_fd, b"\033[?7h")
378
379 if hasattr(self, "old_sigwinch"):
380 signal.signal(signal.SIGWINCH, self.old_sigwinch)
381 del self.old_sigwinch
382
383 def push_char(self, char: int | bytes) -> None:
384 """

Callers

nothing calls this directly

Calls 6

__maybe_write_codeMethod · 0.95
flushoutputMethod · 0.95
hasattrFunction · 0.85
tcsetattrFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected