summaryrefslogtreecommitdiffstats
path: root/Lib/_pyrepl
diff options
context:
space:
mode:
authorMiro HronĨok <miro@hroncok.cz>2024-09-13 01:07:23 (GMT)
committerGitHub <noreply@github.com>2024-09-13 01:07:23 (GMT)
commitf4e5643df64d0c2a009ed224560044b3409a47c0 (patch)
tree7d93abdf715a9a5213ea0b9f6542f5707c5edd9c /Lib/_pyrepl
parent6e06e01881dcffbeef5baac0c112ffb14cfa0b27 (diff)
downloadcpython-f4e5643df64d0c2a009ed224560044b3409a47c0.zip
cpython-f4e5643df64d0c2a009ed224560044b3409a47c0.tar.gz
cpython-f4e5643df64d0c2a009ed224560044b3409a47c0.tar.bz2
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 https://github.com/python/cpython/issues/124027
Diffstat (limited to 'Lib/_pyrepl')
-rw-r--r--Lib/_pyrepl/historical_reader.py2
-rw-r--r--Lib/_pyrepl/reader.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_pyrepl/historical_reader.py b/Lib/_pyrepl/historical_reader.py
index f6e14bd..5d416f3 100644
--- a/Lib/_pyrepl/historical_reader.py
+++ b/Lib/_pyrepl/historical_reader.py
@@ -266,7 +266,9 @@ class HistoricalReader(Reader):
(r"\M-r", "restore-history"),
(r"\M-.", "yank-arg"),
(r"\<page down>", "history-search-forward"),
+ (r"\x1b[6~", "history-search-forward"),
(r"\<page up>", "history-search-backward"),
+ (r"\x1b[5~", "history-search-backward"),
)
def select_item(self, i: int) -> None:
diff --git a/Lib/_pyrepl/reader.py b/Lib/_pyrepl/reader.py
index 54bd1ea..4b0700d 100644
--- a/Lib/_pyrepl/reader.py
+++ b/Lib/_pyrepl/reader.py
@@ -150,6 +150,7 @@ default_keymap: tuple[tuple[KeySpec, CommandName], ...] = tuple(
(r"\<right>", "right"),
(r"\C-\<right>", "forward-word"),
(r"\<delete>", "delete"),
+ (r"\x1b[3~", "delete"),
(r"\<backspace>", "backspace"),
(r"\M-\<backspace>", "backward-kill-word"),
(r"\<end>", "end-of-line"), # was 'end'