summaryrefslogtreecommitdiff
path: root/debian/patches/rl-del-backspace-policy.dpatch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/rl-del-backspace-policy.dpatch')
-rw-r--r--debian/patches/rl-del-backspace-policy.dpatch48
1 files changed, 48 insertions, 0 deletions
diff --git a/debian/patches/rl-del-backspace-policy.dpatch b/debian/patches/rl-del-backspace-policy.dpatch
new file mode 100644
index 0000000..ec56b43
--- /dev/null
+++ b/debian/patches/rl-del-backspace-policy.dpatch
@@ -0,0 +1,48 @@
+#! /bin/sh -e
+
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# DP: Handle Debian Backspace/Delete keyboard policy
+
+diff -urb bash.orig/lib/readline/terminal.c bash/lib/readline/terminal.c
+--- bash.orig/lib/readline/terminal.c 2003-09-18 17:03:42.000000000 +0200
++++ bash/lib/readline/terminal.c 2003-09-27 23:25:59.000000000 +0200
+@@ -148,6 +148,9 @@
+ /* Insert key */
+ static char *_rl_term_kI;
+
++/* The key sequence sent by the Delete key, if any. */
++static char *_rl_term_kD;
++
+ /* Cursor control */
+ static char *_rl_term_vs; /* very visible */
+ static char *_rl_term_ve; /* normal */
+@@ -314,6 +317,7 @@
+ { "ic", &_rl_term_ic },
+ { "im", &_rl_term_im },
+ { "kH", &_rl_term_kH }, /* home down ?? */
++ { "kD", &_rl_term_kD }, /* delete */
+ { "kI", &_rl_term_kI }, /* insert */
+ { "kd", &_rl_term_kd },
+ { "ke", &_rl_term_ke }, /* end keypad mode */
+@@ -492,6 +496,7 @@
+
+ rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
+ rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
++ rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); /* Delete */
+
+ _rl_keymap = xkeymap;
+ }