Fix del key patch for Gnome-Terminal



Hi!  I'm new to this list and haven't contributed before, so I hope this is the
right place.  I have put together a little patch that causes that the delete
key in gnome-terminal to behave correctly when the 'Swap DEL/Backspace' 
toggle is selected.  This way the default behavior is unchanged.  This assumes 
that bash has the delete key properly configured, and I have succesfully tested 
it on Red Hat and Mandrake, but it may not do anything useful on some distros.

Feedback is welcome!
Thanks,
Troy Sorrells

----Cut here ----------------------

diff -ru gnome-libs-1.0.61/zvt/zvtterm.c gnome-libs-1.0.61-new/zvt/zvtterm.c
--- gnome-libs-1.0.61/zvt/zvtterm.c	Fri Jan 28 20:35:39 2000
+++ gnome-libs-1.0.61-new/zvt/zvtterm.c	Thu May 11 23:00:27 2000
@@ -2349,11 +2349,7 @@
   case GDK_BackSpace:
     if (event->state & GDK_MOD1_MASK)
       *p++ = '\033';
-
-    if (term->swap_del_key)
-      *p++ = '\177';
-    else
-      *p++ = 8;
+    *p++ = 8;
     break;
   case GDK_KP_Right:
   case GDK_Right:
@@ -2388,7 +2384,7 @@
     if (event->state & GDK_MOD1_MASK)
       *p++ = '\033';
     if (term->swap_del_key)
-      *p++ = 8;
+      p+=sprintf (p, "\033[3~");
     else
       *p++ = '\177';
     break;                                               




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]