commit c914c9abfc734660c9b8be497462197cfea646ce
parent d93175401454d2967b95907dca8e3b7be2c88f79
Author: ukai <ukai>
Date: Fri, 16 Nov 2001 17:38:35 +0000
tgetstr("Km", &pt) cannot be used to detect is_xterm
Diffstat:
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-17 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * terms.c (set_tty): "rxvt" is xterm
+ (getTCstr): tgetstr("Km", &pt) is not xterm, removed
+ (mouse_init): check Gpm_Open() == -2 to detect xterm when USE_GPM
+
2001-11-16 Tsutomu Okada <okada@furuno.co.jp>
* main.c (chkURL): add mailto: like pattern to mark as anchor
diff --git a/terms.c b/terms.c
@@ -244,7 +244,8 @@ set_tty(void)
TerminalGet(tty, &d_ioval);
#ifdef MOUSE
term = getenv("TERM");
- if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5)) {
+ if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5) ||
+ !strncmp(term, "rxvt", 4)) {
is_xterm = 1;
}
#endif
@@ -411,11 +412,6 @@ getTCstr(void)
fprintf(stderr, "Can't find termcap entry %s\n", ent);
reset_exit(SIGNAL_ARGLIST);
}
-#ifdef MOUSE
- if (tgetstr("Km", &pt)) {
- is_xterm = 1;
- }
-#endif
GETSTR(T_ce, "ce"); /* clear to the end of line */
GETSTR(T_cd, "cd"); /* clear to the end of display */
@@ -1714,21 +1710,22 @@ mouse_init()
if (mouseActive)
return;
- if (is_xterm) {
- XTERM_ON;
- }
conn.eventMask = ~0;
conn.defaultMask = 0;
conn.maxMod = 0;
conn.minMod = 0;
- if (Gpm_Open(&conn, 0) >= 0) {
+ if (Gpm_Open(&conn, 0) == -2) {
/*
* If Gpm_Open() success, returns >= 0
* Gpm_Open() returns -2 in case of xterm.
*/
- is_xterm = 0;
+ is_xterm = 1;
+ } else {
+ gpm_handler = gpm_process_mouse;
+ }
+ if (is_xterm) {
+ XTERM_ON;
}
- gpm_handler = gpm_process_mouse;
mouseActive = 1;
}