aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog6
-rw-r--r--terms.c23
2 files changed, 16 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bad6a3..66ec86b 100644
--- 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
index fca63ab..221012d 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.4 2001/11/16 05:55:07 ukai Exp $ */
+/* $Id: terms.c,v 1.5 2001/11/16 17:38:35 ukai Exp $ */
/*
* An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995
@@ -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;
}