From 7776ef91496b504ce559d7800b6dff0fc3a62839 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 4 Nov 2003 18:32:35 +0000 Subject: [PATCH] work around problem with Backspace's generating ASCII 127 on Linux sometimes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1583 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/winio.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5dbe0eb2..95da3e7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,10 @@ CVS code - do_replace_loop() - Fix potential infinite loop when doing a forward regex replace of "$". (DLR; found by Mike Frysinger) +- winio.c: + get_accepted_kbinput() + - Translate Ctrl-8 into NANO_DELETE_KEY, since it apparently is + generated at the statusbar prompt sometimes on Linux. (DLR) GNU nano 1.3.0 - 2003.10.22 - General: diff --git a/src/winio.c b/src/winio.c index b221a7ea..844ce7c9 100644 --- a/src/winio.c +++ b/src/winio.c @@ -166,6 +166,11 @@ int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta, *meta = 1; } break; + case NANO_CONTROL_8: + /* Terminal breakage, part 2: We shouldn't get Ctrl-8 + * (Ctrl-?) for Backspace, but we do sometimes on Linux. */ + kbinput = NANO_BACKSPACE_KEY; + break; case KEY_DOWN: kbinput = NANO_DOWN_KEY; break; @@ -185,7 +190,7 @@ int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta, kbinput = NANO_BACKSPACE_KEY; break; case KEY_DC: - /* Terminal breakage, part 2: We should only get KEY_DC when + /* Terminal breakage, part 3: We should only get KEY_DC when * hitting Delete, but we get it when hitting Backspace * sometimes on FreeBSD. Thank you, Lee Nelson. */ kbinput = (rebind_delete) ? NANO_BACKSPACE_KEY : NANO_DELETE_KEY; -- 2.39.5