1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: No mouse support for urxvt.
12 Solution: Implement urxvt mouse support, also for > 252 columns. (Yiding
14 Files: src/feature.h, src/keymap.h, src/option.h, src/os_unix.c,
15 src/term.c, src/version.c
18 *** ../vim-7.3.342/src/feature.h 2011-05-19 13:40:47.000000000 +0200
19 --- src/feature.h 2011-10-20 21:02:15.000000000 +0200
24 # define FEAT_MOUSE_DEC
27 + # define FEAT_MOUSE_URXVT
29 # if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264))
34 #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
35 # define FEAT_SYSMOUSE
37 /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
38 #if !defined(FEAT_MOUSE_TTY) \
39 && (defined(FEAT_MOUSE_XTERM) \
40 ! || defined(FEAT_MOUSE_NET) || defined(FEAT_MOUSE_DEC) \
41 ! || defined(DOS_MOUSE) || defined(FEAT_MOUSE_GPM) \
42 ! || defined(FEAT_MOUSE_JSB) || defined(FEAT_MOUSE_PTERM) \
43 ! || defined(FEAT_SYSMOUSE))
44 # define FEAT_MOUSE_TTY /* include non-GUI mouse support */
46 #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
48 #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
49 # define FEAT_SYSMOUSE
52 + /* urxvt is a small variation of mouse_xterm, and shares its code */
53 + #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM)
54 + # define FEAT_MOUSE_XTERM
57 /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
58 #if !defined(FEAT_MOUSE_TTY) \
59 && (defined(FEAT_MOUSE_XTERM) \
60 ! || defined(FEAT_MOUSE_NET) \
61 ! || defined(FEAT_MOUSE_DEC) \
62 ! || defined(DOS_MOUSE) \
63 ! || defined(FEAT_MOUSE_GPM) \
64 ! || defined(FEAT_MOUSE_JSB) \
65 ! || defined(FEAT_MOUSE_PTERM) \
66 ! || defined(FEAT_SYSMOUSE) \
67 ! || defined(FEAT_MOUSE_URXVT))
68 # define FEAT_MOUSE_TTY /* include non-GUI mouse support */
70 #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
71 *** ../vim-7.3.342/src/keymap.h 2010-08-15 21:57:32.000000000 +0200
72 --- src/keymap.h 2011-10-20 21:00:37.000000000 +0200
76 #define KS_TEAROFF 244
78 ! /* used for JSB term mouse */
79 #define KS_JSBTERM_MOUSE 243
81 ! /* used a termcap entry that produces a normal character */
84 ! /* Used for the qnx pterm mouse */
85 #define KS_PTERM_MOUSE 241
87 /* Used for click in a tab pages label. */
90 #define KS_TEAROFF 244
92 ! /* Used for JSB term mouse. */
93 #define KS_JSBTERM_MOUSE 243
95 ! /* Used a termcap entry that produces a normal character. */
98 ! /* Used for the qnx pterm mouse. */
99 #define KS_PTERM_MOUSE 241
101 /* Used for click in a tab pages label. */
105 /* Used for menu in a tab pages line. */
106 #define KS_TABMENU 239
108 + /* Used for the urxvt mouse. */
109 + #define KS_URXVT_MOUSE 238
112 * Filler used after KS_SPECIAL and others
114 *** ../vim-7.3.342/src/option.h 2011-09-30 14:44:49.000000000 +0200
115 --- src/option.h 2011-10-20 19:38:59.000000000 +0200
118 EXTERN char_u *p_ttym; /* 'ttymouse' */
119 EXTERN unsigned ttym_flags;
121 ! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", NULL};
123 # define TTYM_XTERM 0x01
124 # define TTYM_XTERM2 0x02
126 EXTERN char_u *p_ttym; /* 'ttymouse' */
127 EXTERN unsigned ttym_flags;
129 ! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", NULL};
131 # define TTYM_XTERM 0x01
132 # define TTYM_XTERM2 0x02
136 # define TTYM_NETTERM 0x08
137 # define TTYM_JSBTERM 0x10
138 # define TTYM_PTERM 0x20
139 + # define TTYM_URXVT 0x40
141 EXTERN char_u *p_udir; /* 'undodir' */
142 EXTERN long p_ul; /* 'undolevels' */
143 *** ../vim-7.3.342/src/os_unix.c 2011-10-12 21:04:15.000000000 +0200
144 --- src/os_unix.c 2011-10-20 21:02:00.000000000 +0200
148 * Return non-zero when using an xterm mouse, according to 'ttymouse'.
149 * Return 1 for "xterm".
150 * Return 2 for "xterm2".
151 + * Return 3 for "urxvt".
156 + if (ttym_flags == TTYM_URXVT)
158 if (ttym_flags == TTYM_XTERM2)
160 if (ttym_flags == TTYM_XTERM)
166 xterm_mouse_vers = use_xterm_mouse();
168 + # ifdef FEAT_MOUSE_URXVT
169 + if (ttym_flags == TTYM_URXVT) {
170 + out_str_nf((char_u *)
172 + ? IF_EB("\033[?1015h", ESC_STR "[?1015h")
173 + : IF_EB("\033[?1015l", ESC_STR "[?1015l")));
178 if (xterm_mouse_vers > 0)
180 if (on) /* enable mouse events, use mouse tracking if available */
185 # ifdef FEAT_MOUSE_XTERM
186 if (use_xterm_mouse()
187 + # ifdef FEAT_MOUSE_URXVT
188 + && use_xterm_mouse() != 3
197 del_mouse_termcode(KS_PTERM_MOUSE);
199 + # ifdef FEAT_MOUSE_URXVT
200 + /* same as the dec mouse */
201 + if (use_xterm_mouse() == 3
207 + set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME)
208 + ? IF_EB("\233", CSI_STR)
209 + : IF_EB("\033[", ESC_STR "[")));
211 + if (*p_mouse != NUL)
213 + mch_setmouse(FALSE);
218 + del_mouse_termcode(KS_URXVT_MOUSE);
223 *** ../vim-7.3.342/src/version.c 2011-10-20 18:24:16.000000000 +0200
224 --- src/version.c 2011-10-20 19:40:48.000000000 +0200
230 + # ifdef FEAT_MOUSE_URXVT
240 { /* Add new patch number below this line */
246 Warning label on a superhero Halloween costume:
247 "Caution: Cape does not enable user to fly."
249 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
250 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
251 \\\ an exciting new programming language -- http://www.Zimbu.org ///
252 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///