Skip to content

Commit

Permalink
Restore F1 for help
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Apr 27, 2024
1 parent cf532fb commit 3278af9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/_pyrepl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions Lib/_pyrepl/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def make_default_syntax_table():
(r"\M-\<backspace>", "backward-kill-word"),
(r"\<end>", "end-of-line"), # was 'end'
(r"\<home>", "beginning-of-line"), # was 'home'
(r"\<f1>", "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
Expand Down

0 comments on commit 3278af9

Please sign in to comment.