From: pcg Date: Sun, 22 Feb 2004 20:08:18 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=2bfda393344dfafa4031a5403f9859502ccb1372;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 8f15c5e9..bd301a87 100644 --- 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. diff --git a/src/command.C b/src/command.C index ab6e0881..897cc5aa 100644 --- a/src/command.C +++ b/src/command.C @@ -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); }