summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/reference/tmpl/vte.sgml1
-rw-r--r--src/vte.c41
-rw-r--r--src/vte.h3
3 files changed, 36 insertions, 9 deletions
diff --git a/doc/reference/tmpl/vte.sgml b/doc/reference/tmpl/vte.sgml
index ec3ba28..76f5ff2 100644
--- a/doc/reference/tmpl/vte.sgml
+++ b/doc/reference/tmpl/vte.sgml
@@ -397,6 +397,7 @@ keys.
@VTE_ERASE_ASCII_BACKSPACE: Send an ASCII backspace character (0x08).
@VTE_ERASE_ASCII_DELETE: Send an ASCII delete character (0x7F).
@VTE_ERASE_DELETE_SEQUENCE: Send the "@@7" control sequence.
+@VTE_ERASE_TTY: Send terminal's "erase" setting.
<!-- ##### ENUM VteTerminalCursorShape ##### -->
<para>
diff --git a/src/vte.c b/src/vte.c
index 5bc7e58..656eacd 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -4957,16 +4957,32 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
special = "kD";
suppress_meta_esc = TRUE;
break;
- /* Use the tty's erase character. */
+ case VTE_ERASE_TTY:
+ if (terminal->pvt->pty_master != -1 &&
+ tcgetattr(terminal->pvt->pty_master, &tio) != -1)
+ {
+ normal = g_strdup_printf("%c", tio.c_cc[VERASE]);
+ normal_length = 1;
+ }
+ suppress_meta_esc = FALSE;
+ break;
case VTE_ERASE_AUTO:
default:
- if (terminal->pvt->pty_master != -1) {
- if (tcgetattr(terminal->pvt->pty_master,
- &tio) != -1) {
- normal = g_strdup_printf("%c",
- tio.c_cc[VERASE]);
- normal_length = 1;
- }
+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE '\0'
+#endif
+ if (terminal->pvt->pty_master != -1 &&
+ tcgetattr(terminal->pvt->pty_master, &tio) != -1 &&
+ tio.c_cc[VERASE] != _POSIX_VDISABLE)
+ {
+ normal = g_strdup_printf("%c", tio.c_cc[VERASE]);
+ normal_length = 1;
+ }
+ else
+ {
+ normal = g_strdup("");
+ normal_length = 1;
+ suppress_meta_esc = FALSE;
}
suppress_meta_esc = FALSE;
break;
@@ -4984,6 +5000,15 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
normal = g_strdup("\177");
normal_length = 1;
break;
+ case VTE_ERASE_TTY:
+ if (terminal->pvt->pty_master != -1 &&
+ tcgetattr(terminal->pvt->pty_master, &tio) != -1)
+ {
+ normal = g_strdup_printf("%c", tio.c_cc[VERASE]);
+ normal_length = 1;
+ }
+ suppress_meta_esc = FALSE;
+ break;
case VTE_ERASE_DELETE_SEQUENCE:
case VTE_ERASE_AUTO:
default:
diff --git a/src/vte.h b/src/vte.h
index d49164e..8ecb406 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -158,7 +158,8 @@ typedef enum {
VTE_ERASE_AUTO,
VTE_ERASE_ASCII_BACKSPACE,
VTE_ERASE_ASCII_DELETE,
- VTE_ERASE_DELETE_SEQUENCE
+ VTE_ERASE_DELETE_SEQUENCE,
+ VTE_ERASE_TTY
} VteTerminalEraseBinding;
/* Values for the cursor blink setting */