Package: gaim Version: 1:2.0.0beta5-3 Severity: low Some keybinding of gaim-text are not working properly on xterm based terminal such as gnome-terminal. This bug is found on ubuntu, but I believe it might be the same on debian. see: http://sourceforge.net/tracker/index.php?func=detail&aid=1596631&group_id=235&atid=100235 attach to this email, you will find a patch to that issue |
--- trunk/console/libgnt/gntkeys.c 2006/11/01 05:53:09 17646 +++ trunk/console/libgnt/gntkeys.c 2006/11/15 07:18:16 17750 @@ -3,17 +3,27 @@ #include <stdlib.h> #include <string.h> -const char *term; +static const char *term; void gnt_keys_refine(char *text) { + if (term == NULL) { + term = getenv("TERM"); + if (!term) + term = ""; /* Just in case */ + } + if (*text == 27 && *(text + 1) == '[' && *(text + 3) == '\0' && (*(text + 2) >= 'A' || *(text + 2) <= 'D')) { - if (term == NULL) - term = getenv("TERM"); - /* Apparently this is necessary for urxvt and screen */ - if (strcmp(term, "screen") == 0 || strcmp(term, "rxvt-unicode") == 0) + /* Apparently this is necessary for urxvt and screen and xterm */ + if (strcmp(term, "screen") == 0 || strcmp(term, "rxvt-unicode") == 0 || + strcmp(term, "xterm") == 0) *(text + 1) = 'O'; + } else if (*(unsigned char*)text == 195) { + if (*(text + 2) == 0 && strcmp(term, "xterm") == 0) { + *(text) = 27; + *(text + 1) -= 64; /* Say wha? */ + } } }