Tags: patch

Hi,

I wrote a patch that fixes the issues. The new mappings are left as
follows: 

Space key:
      - Space:          SP*
      - M-Space:        ESC SP*
      - C-Space:        NUL*
      - M-C-Space:      ESC NUL

Return key:
      - Return:         CR*
      - M-Return:       ESC LF*
      - C-Return:       CR
      - M-C-Return:     ESC LF*

Backspace key:
      - Backspace:      <Depends on config settings>*
      - C-Backspace:    BS

* = Unchanged.

Be aware that the second patch contains a non-printable character (^H)
that may cause oddities when viewing the file or it may need to be
re-inserted before applying the patch.

Cheers,
Ernest
--- vte-0.16.14.orig/src/keymap.c.orig
+++ vte-0.16.14/src/keymap.c
@@ -174,6 +174,9 @@
 
 /* Normal keys unaffected by modes. */
 static const struct _vte_keymap_entry _vte_keymap_GDK_space[] = {
+	/* Meta+Control+space = ESC+NUL */
+	{cursor_all, keypad_all, fkey_all, 
+	 (VTE_META_MASK | GDK_CONTROL_MASK), _VTE_CAP_ESC "\0", 2, X_NULL},
 	/* Meta+space = ESC+" " */
 	{cursor_all, keypad_all, fkey_all,
 	 VTE_META_MASK, _VTE_CAP_ESC " ", 2, X_NULL},
@@ -203,7 +206,7 @@
 static const struct _vte_keymap_entry _vte_keymap_GDK_Return[] = {
 	{cursor_all, keypad_all, fkey_all,
 	 VTE_META_MASK, _VTE_CAP_ESC "\n", 2, X_NULL},
-	{cursor_all, keypad_all, fkey_all, GDK_CONTROL_MASK, "\n", 1, X_NULL},
+	{cursor_all, keypad_all, fkey_all, GDK_CONTROL_MASK, "\r", 1, X_NULL},
 	{cursor_all, keypad_all, fkey_all, 0, "\r", 1, X_NULL},
 	{cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };
--- vte-0.16.14.orig/src/vte.c
+++ vte-0.16.14/src/vte.c
@@ -5311,6 +5311,14 @@
 		/* Map the key to a sequence name if we can. */
 		switch (keyval) {
 		case GDK_KEY (BackSpace):
+			if (modifiers & GDK_CONTROL_MASK) {
+				/* Ctrl+Backspace always sends ^H regardless of backspace binding. */
+				normal = g_strdup("");
+				normal_length = 1;
+				suppress_meta_esc = FALSE;
+				handled = TRUE;
+				break;
+			}
 			switch (terminal->pvt->backspace_binding) {
 			case VTE_ERASE_ASCII_BACKSPACE:
 				normal = g_strdup("");

Reply via email to