From 3278af928c01544a48884b5dc5be59dbb03c1cb1 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 27 Apr 2024 18:22:23 +0100 Subject: [PATCH] Restore F1 for help --- Lib/_pyrepl/commands.py | 8 ++++++++ Lib/_pyrepl/reader.py | 1 + 2 files changed, 9 insertions(+) diff --git a/Lib/_pyrepl/commands.py b/Lib/_pyrepl/commands.py index 6b2e1a47c13f68d..9cdb700a24c6d70 100644 --- a/Lib/_pyrepl/commands.py +++ b/Lib/_pyrepl/commands.py @@ -396,6 +396,14 @@ def do(self): pass +class help(Command): + def do(self): + import _sitebuiltins + self.reader.console.restore() + self.reader.msg = _sitebuiltins._Helper()() + self.reader.dirty = 1 + + class invalid_key(Command): def do(self): pending = self.reader.console.getpending() diff --git a/Lib/_pyrepl/reader.py b/Lib/_pyrepl/reader.py index 74f19fed7f23daf..277287dca790598 100644 --- a/Lib/_pyrepl/reader.py +++ b/Lib/_pyrepl/reader.py @@ -160,6 +160,7 @@ def make_default_syntax_table(): (r"\M-\", "backward-kill-word"), (r"\", "end-of-line"), # was 'end' (r"\", "beginning-of-line"), # was 'home' + (r"\", "help"), (r"\EOF", "end"), # the entries in the terminfo database for xterms (r"\EOH", "home"), # seem to be wrong. this is a less than ideal # workaround