Send the slave pty's erase character when the user hits backspace.
authorNalin Dahyabhai <nalin@src.gnome.org>
Mon, 4 Mar 2002 06:13:49 +0000 (06:13 +0000)
committerNalin Dahyabhai <nalin@src.gnome.org>
Mon, 4 Mar 2002 06:13:49 +0000 (06:13 +0000)
README
src/vte.c

diff --git a/README b/README
index 0113f4e..573ecb1 100644 (file)
--- a/README
+++ b/README
@@ -22,7 +22,8 @@
   out how to do those yet.
 - Most commands specific to Xterm or dtterm are recognized, but very few of
   their behaviors are implemented.
   out how to do those yet.
 - Most commands specific to Xterm or dtterm are recognized, but very few of
   their behaviors are implemented.
-- Alternate charset support (usually needed for line-drawing) isn't done yet.
+- Portions of the alternate charset support (usually used for line-drawing)
+  aren't done yet, but most of it is.
 - Certain termcap-specific commands aren't implemented yet.  There are enough
   to run ls, vim, less, and probably emacs and mutt, but more need to be
   implemented.
 - Certain termcap-specific commands aren't implemented yet.  There are enough
   to run ls, vim, less, and probably emacs and mutt, but more need to be
   implemented.
index 1b7c534..8485ef6 100644 (file)
--- a/src/vte.c
+++ b/src/vte.c
@@ -2622,6 +2622,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
        unsigned char *normal = NULL;
        size_t normal_length = 0;
        unsigned char *special = NULL;
        unsigned char *normal = NULL;
        size_t normal_length = 0;
        unsigned char *special = NULL;
+       struct termios tio;
 
        g_return_val_if_fail(widget != NULL, FALSE);
        g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
 
        g_return_val_if_fail(widget != NULL, FALSE);
        g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
@@ -2635,11 +2636,15 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                }
                /* Map the key to a sequence name if we can. */
                switch (event->keyval) {
                }
                /* Map the key to a sequence name if we can. */
                switch (event->keyval) {
-#if 0
                        case GDK_BackSpace:
                        case GDK_BackSpace:
-                               special = "kb";
+                               /* Use the tty's erase character. */
+                               if (tcgetattr(terminal->pvt->pty_master,
+                                             &tio) != -1) {
+                                       normal = g_strdup_printf("%c",
+                                                                tio.c_cc[VERASE]);
+                                       normal_length = 1;
+                               }
                                break;
                                break;
-#endif
                        case GDK_Delete:
                                special = "kD";
                                break;
                        case GDK_Delete:
                                special = "kD";
                                break;