summaryrefslogtreecommitdiffstats
path: root/Lib/curses
diff options
context:
space:
mode:
authorAidan Melen <aidan-melen@protonmail.com>2023-04-26 20:54:07 (GMT)
committerGitHub <noreply@github.com>2023-04-26 20:54:07 (GMT)
commita3a5b4bb232ba29875147baa3b56a5524eece353 (patch)
treef631eb34d279d3288e8dd2aaffc22eab94e25324 /Lib/curses
parent44010d0f1203134cd8f885ca574caaef373e80f6 (diff)
downloadcpython-a3a5b4bb232ba29875147baa3b56a5524eece353.zip
cpython-a3a5b4bb232ba29875147baa3b56a5524eece353.tar.gz
cpython-a3a5b4bb232ba29875147baa3b56a5524eece353.tar.bz2
gh-60436: fix curses textbox backspace/del (#103783)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Michael Blahay <mblahay@gmail.com>
Diffstat (limited to 'Lib/curses')
-rw-r--r--Lib/curses/textpad.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/curses/textpad.py b/Lib/curses/textpad.py
index 2079953..aa87061 100644
--- a/Lib/curses/textpad.py
+++ b/Lib/curses/textpad.py
@@ -102,7 +102,10 @@ class Textbox:
self._insert_printable_char(ch)
elif ch == curses.ascii.SOH: # ^a
self.win.move(y, 0)
- elif ch in (curses.ascii.STX,curses.KEY_LEFT, curses.ascii.BS,curses.KEY_BACKSPACE):
+ elif ch in (curses.ascii.STX,curses.KEY_LEFT,
+ curses.ascii.BS,
+ curses.KEY_BACKSPACE,
+ curses.ascii.DEL):
if x > 0:
self.win.move(y, x-1)
elif y == 0:
@@ -111,7 +114,7 @@ class Textbox:
self.win.move(y-1, self._end_of_line(y-1))
else:
self.win.move(y-1, self.maxx)
- if ch in (curses.ascii.BS, curses.KEY_BACKSPACE):
+ if ch in (curses.ascii.BS, curses.KEY_BACKSPACE, curses.ascii.DEL):
self.win.delch()
elif ch == curses.ascii.EOT: # ^d
self.win.delch()