On Tue, Nov 08, 2011 at 07:51:26PM -0600, Sung Pae wrote:
> On Wed, Oct 26, 2011 at 11:42:17PM +0800, lilydjwg wrote:
>
> > Sorry my patch is wrong.
> >
> > After applied patch 343, when I enter Vim, the mouse is not recognized
> > by vim. Setting 'ttymouse' to 'xterm' or 'xterm2' will enable it.
> > Before the patch, I do not need to set 'ttymouse' to use mouse
> > support. There is nothing special about tmux; I recompiled and it's
> > the same in and outsite tmux.
> >
> > But there IS something wrong. The relative code is:
> >
> > ...
> >
> > I am attaching my working patch, hoping that this time I solved the
> > problem in the right way.
>
> Is this patch available online somewhere? It was not attached to your
> message when you re-forwarded it.
>
> I have a similar problem: setting `ttymouse=xterm2` causes mouse events
> to be ignored by vim when running in tmux in urxvt.
>
> However, setting `ttymouse=urxvt` with the same setup causes mouse
> events to crazily flood vim; it's like the vim equivalent of printing a
> binary file to the terminal. [1]
>
> Your first patch restored the original (excellent) behavior of
> ttymouse=xterm2 under tmux on rxvt-unicode. I am happy with this, but if
> there is a more comprehensive fix, I would love to use it!
>
> Cheers,
> guns
>
>
> [1]: vim v7-3-353, tmux 1.6 (dev), urxvt 9.12
Oops... I attach it now, and my vim handles mouse events well in urxvt+tmux.
--
Best regards,
lilydjwg
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/term.c b/src/term.c
index 6f7c843..0d57fa5 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1996,6 +1996,7 @@ set_termname(term)
# define HMT_DEC 4
# define HMT_JSBTERM 8
# define HMT_PTERM 16
+# define HMT_URXVT 32
static int has_mouse_termcode = 0;
# endif
@@ -2031,6 +2032,11 @@ set_mouse_termcode(n, s)
has_mouse_termcode |= HMT_PTERM;
else
# endif
+# ifdef FEAT_MOUSE_URXVT
+ if (n == KS_URXVT_MOUSE)
+ has_mouse_termcode |= HMT_URXVT;
+ else
+# endif
has_mouse_termcode |= HMT_NORMAL;
# endif
}
@@ -2068,6 +2074,11 @@ del_mouse_termcode(n)
has_mouse_termcode &= ~HMT_PTERM;
else
# endif
+# ifdef FEAT_MOUSE_URXVT
+ if (n == KS_URXVT_MOUSE)
+ has_mouse_termcode &= ~HMT_URXVT;
+ else
+# endif
has_mouse_termcode &= ~HMT_NORMAL;
# endif
}