tgetstr("Km", &pt) cannot be used to detect is_xterm
This commit is contained in:
@@ -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>
|
2001-11-16 Tsutomu Okada <okada@furuno.co.jp>
|
||||||
|
|
||||||
* main.c (chkURL): add mailto: like pattern to mark as anchor
|
* main.c (chkURL): add mailto: like pattern to mark as anchor
|
||||||
|
23
terms.c
23
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
|
* An original curses library for EUC-kanji by Akinori ITO, December 1989
|
||||||
* revised by Akinori ITO, January 1995
|
* revised by Akinori ITO, January 1995
|
||||||
@@ -244,7 +244,8 @@ set_tty(void)
|
|||||||
TerminalGet(tty, &d_ioval);
|
TerminalGet(tty, &d_ioval);
|
||||||
#ifdef MOUSE
|
#ifdef MOUSE
|
||||||
term = getenv("TERM");
|
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;
|
is_xterm = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -411,11 +412,6 @@ getTCstr(void)
|
|||||||
fprintf(stderr, "Can't find termcap entry %s\n", ent);
|
fprintf(stderr, "Can't find termcap entry %s\n", ent);
|
||||||
reset_exit(SIGNAL_ARGLIST);
|
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_ce, "ce"); /* clear to the end of line */
|
||||||
GETSTR(T_cd, "cd"); /* clear to the end of display */
|
GETSTR(T_cd, "cd"); /* clear to the end of display */
|
||||||
@@ -1714,21 +1710,22 @@ mouse_init()
|
|||||||
|
|
||||||
if (mouseActive)
|
if (mouseActive)
|
||||||
return;
|
return;
|
||||||
if (is_xterm) {
|
|
||||||
XTERM_ON;
|
|
||||||
}
|
|
||||||
conn.eventMask = ~0;
|
conn.eventMask = ~0;
|
||||||
conn.defaultMask = 0;
|
conn.defaultMask = 0;
|
||||||
conn.maxMod = 0;
|
conn.maxMod = 0;
|
||||||
conn.minMod = 0;
|
conn.minMod = 0;
|
||||||
if (Gpm_Open(&conn, 0) >= 0) {
|
if (Gpm_Open(&conn, 0) == -2) {
|
||||||
/*
|
/*
|
||||||
* If Gpm_Open() success, returns >= 0
|
* If Gpm_Open() success, returns >= 0
|
||||||
* Gpm_Open() returns -2 in case of xterm.
|
* 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;
|
mouseActive = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user