Content-Length: 308901 | pFad | https://github.com/python/cpython/commit/f4e5643df64d0c2a009ed224560044b3409a47c0

2A gh-124027: Support Del, PgUp, and PgDn on TERM=vt100 (#124028) · python/cpython@f4e5643 · GitHub
Skip to content

Commit f4e5643

Browse files
authored
gh-124027: Support Del, PgUp, and PgDn on TERM=vt100 (#124028)
pyrepl: Support Del, PgUp, and PgDn on TERM=vt100 From Fedora's /etc/inputrc: "\e[5~": history-search-backward "\e[6~": history-search-forward "\e[3~": delete-char Fixes #124027
1 parent 6e06e01 commit f4e5643

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Lib/_pyrepl/historical_reader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ def collect_keymap(self) -> tuple[tuple[KeySpec, CommandName], ...]:
266266
(r"\M-r", "restore-history"),
267267
(r"\M-.", "yank-arg"),
268268
(r"\<page down>", "history-search-forward"),
269+
(r"\x1b[6~", "history-search-forward"),
269270
(r"\<page up>", "history-search-backward"),
271+
(r"\x1b[5~", "history-search-backward"),
270272
)
271273

272274
def select_item(self, i: int) -> None:

Lib/_pyrepl/reader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def make_default_commands() -> dict[CommandName, type[Command]]:
150150
(r"\<right>", "right"),
151151
(r"\C-\<right>", "forward-word"),
152152
(r"\<delete>", "delete"),
153+
(r"\x1b[3~", "delete"),
153154
(r"\<backspace>", "backspace"),
154155
(r"\M-\<backspace>", "backward-kill-word"),
155156
(r"\<end>", "end-of-line"), # was 'end'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Support ``<page up>``, ``<page down>``, and ``<delete>`` keys in the Python
2+
REPL when ``$TERM`` is set to ``vt100``.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/commit/f4e5643df64d0c2a009ed224560044b3409a47c0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy