*** empty log message ***
authorpcg <pcg>
Sun, 22 Feb 2004 20:08:18 +0000 (20:08 +0000)
committerpcg <pcg>
Sun, 22 Feb 2004 20:08:18 +0000 (20:08 +0000)
Changes
src/command.C

diff --git a/Changes b/Changes
index 8f15c5e955695b5ad44745bb97da842dcc2c5355..bd301a877497743dc32e79da397cf784dabbf8c2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -6,7 +6,7 @@
           startup time for new terms in rxvtd. At least xfree86 4.3 is
           rather broken with respect to input methods, though, so expect
           crashes when you kill your input method (xterm et al. also crash).
-        - fix bugs in x flushing, causing an empty screen after startup
+        - fix bugs in X flushing, causing an empty screen after startup.
         - fix various memleaks in rxvtd.
         - fix a bug that kept escape codes to be generated for some
           keysyms that also have string translations, when not --enable-xim.
index ab6e0881101eacf84652f0295412e80b6b5cefc6..897cc5aa2030a577249b3eef8d2b173d0a3ab167 100644 (file)
@@ -112,10 +112,19 @@ rxvt_term::lookup_key (XKeyEvent &ev)
           if (status_return == XLookupChars
               || status_return == XLookupBoth)
             {
-              wkbuf[len] = 0;
-              len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
-              if (len < 0)
-                len = 0;
+              /* make sure the user can type ctrl-@, i.e. NUL */
+              if (len == 1 && *wkbuf == 0)
+                {
+                  kbuf[0] = 0;
+                  len = 1;
+                }
+              else
+                {
+                  wkbuf[len] = 0;
+                  len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
+                  if (len < 0)
+                    len = 0;
+                }
             }
           else
             len = 0;
@@ -655,25 +664,23 @@ rxvt_term::lookup_key (XKeyEvent &ev)
   /* escape prefix */
   if (meta
 #ifdef META8_OPTION
-      && (meta_char == C0_ESC)
+      && meta_char == C0_ESC
 #endif
      )
     {
       const unsigned char ch = C0_ESC;
-
       tt_write (&ch, 1);
     }
-#ifdef DEBUG_CMD
-  if (debug_key)
-    {          /* Display keyboard buffer contents */
-      char           *p;
-      int             i;
-
-      fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len);
-      for (i = 0, p = kbuf; i < len; i++, p++)
-        fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
-      fprintf (stderr, "'\n");
-    }
+
+#if defined(DEBUG_CMD)
+  /* Display keyboard buffer contents */
+  unsigned char *p;
+  int i;
+
+  fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len);
+  for (i = 0, p = kbuf; i < len; i++, p++)
+    fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
+  fprintf (stderr, "'\n");
 #endif                         /* DEBUG_CMD */
   tt_write (kbuf, (unsigned int)len);
 }