aboutsummaryrefslogtreecommitdiffstats
path: root/terms.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-19 08:17:13 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-19 08:17:13 +0000
commitd26961f7c1b993180a39467c93f7dcff4b68511f (patch)
tree9441f37a1b755fdc2d9409d2d60231f58923d502 /terms.c
parent[w3m-dev 02436] fix segmentation fault in main.c (diff)
downloadw3m-d26961f7c1b993180a39467c93f7dcff4b68511f.tar.gz
w3m-d26961f7c1b993180a39467c93f7dcff4b68511f.zip
add cygwin as xterm-style mouse terminal
Diffstat (limited to 'terms.c')
-rw-r--r--terms.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/terms.c b/terms.c
index 8e57f26..ac3e298 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.6 2001/11/16 22:02:00 ukai Exp $ */
+/* $Id: terms.c,v 1.7 2001/11/19 08:17:13 ukai Exp $ */
/*
* An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995
@@ -219,6 +219,13 @@ writestr(char *s)
#define MOVE(line,column) writestr(tgoto(T_cm,column,line));
+#ifdef MOUSE
+static char *xterm_mouse_term[] = {
+ "xterm", "kterm", "rxvt", "cygwin",
+ NULL
+};
+#endif
+
int
set_tty(void)
{
@@ -244,9 +251,14 @@ set_tty(void)
TerminalGet(tty, &d_ioval);
#ifdef MOUSE
term = getenv("TERM");
- if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5) ||
- !strncmp(term, "rxvt", 4)) {
- is_xterm = 1;
+ {
+ char **p;
+ for (p = xterm_mouse_term; *p != NULL; p++) {
+ if (!strncmp(term, *p, strlen(*p))) {
+ is_xterm = 1;
+ break;
+ }
+ }
}
#endif
return 0;