VTE doesn't distinguish between backspace and control-backspace
Submitted by Nex..@..il.com
Link to original bug (#420039)
Description
When the user types a backspace into VTE, it sends it off as either C-h, C-?, or the delete character regardless of whether the control key is pressed. This is frustrating, as it means that the behavior of control-backspace can't be customized for Emacs or other programs that use Readline.
This patch adds an additional element to the VteTerminalEraseBinding enum, VTE_ERASE_VARYING, that causes backspace and control+backspace to send different characters. I have backspace sending C-? while control-backspace sends C-h, although this is an essentially arbitrary decision; it could just as easily be the other way around.
Thanks for your consideration.
Index: src/vte.c
--- src/vte.c (revision 1851) +++ src/vte.c (working copy) @@ -4240,6 +4240,14 @@ special = "kD"; suppress_meta_esc = TRUE; break;
-
case VTE_ERASE_VARYING:
-
if (terminal->pvt->modifiers == GDK_CONTROL_MASK)
-
normal = g_strdup(");
-
else
-
normal = g_strdup("");
-
normal_length = 1;
-
suppress_meta_esc = FALSE;
-
break; /* Use the tty's erase character. */ case VTE_ERASE_AUTO: default:
@@ -4269,6 +4277,7 @@ break; case VTE_ERASE_DELETE_SEQUENCE: case VTE_ERASE_AUTO:
-
case VTE_ERASE_VARYING: default: special = "kD"; break;
Index: src/vte.h
--- src/vte.h (revision 1851) +++ src/vte.h (working copy) @@ -147,7 +147,8 @@ VTE_ERASE_AUTO, VTE_ERASE_ASCII_BACKSPACE, VTE_ERASE_ASCII_DELETE,
-
VTE_ERASE_DELETE_SEQUENCE
-
VTE_ERASE_DELETE_SEQUENCE,
-
VTE_ERASE_VARYING
} VteTerminalEraseBinding;
/* Values for the anti alias setting */
Resolution: RESOLVED DUPLICATE