mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
gh-119548: Add a 'clear' command to the REPL (#119549)
This commit is contained in:
parent
a531fd7fdb
commit
e3bac04c37
3 changed files with 12 additions and 1 deletions
|
@ -57,12 +57,17 @@ def _strip_final_indent(text: str) -> str:
|
|||
return text
|
||||
|
||||
|
||||
def _clear_screen():
|
||||
reader = _get_reader()
|
||||
reader.scheduled_commands.append("clear_screen")
|
||||
|
||||
|
||||
REPL_COMMANDS = {
|
||||
"exit": _sitebuiltins.Quitter('exit', ''),
|
||||
"quit": _sitebuiltins.Quitter('quit' ,''),
|
||||
"copyright": _sitebuiltins._Printer('copyright', sys.copyright),
|
||||
"help": "help",
|
||||
"clear": "clear_screen",
|
||||
"clear": _clear_screen,
|
||||
}
|
||||
|
||||
class InteractiveColoredConsole(code.InteractiveConsole):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue