I had this issue with the mouse release events but I fixed it by patching
vim instead.


On 31 May 2014 22:47, Balazs Kezes <rlblas...@gmail.com> wrote:

> On 2014-05-31 20:35 +0530, Jay Rajput wrote:
> > Problem Statement: Mouse up scrolling not working in vim through tmux
> > in st. Mouse down scrolling works fine.
>
> Thou shall not report release events for mouse wheel events. I think
> neither tmux, neither vim handles these gracefully. For some reason the
> release events are interpreted as scroll down in vim-in-tmux. So
> scolling down actually scrolls down twice and scrolling up is
> interpreted as a scroll up followed by a scroll down.
>
> > EarlyInvestigation using google: Google shows a similar problem though
> > with putty
> >
> http://superuser.com/questions/706881/mouse-scrolling-in-vim-through-tmux-how-to-configure
> .
>
> Yes, and I see that there was a patch posted[1] for putty already. Tmux
> is even considering fixing[2] support for the broken terminals.
>
> I've also attached a sample way to fix this in st.
>
> Sidenote: while looking at tmux under st I experienced a lot of other
> rendering problems. I suspect this is because st's VT100 emulation is a
> bit weak. In case this is something the suckless community would like to
> fix, I recommend using xterm's vttest[3] to test the features.
>
> [1] https://github.com/atsepkov/putty-X/commit/bbced
> [2] http://sourceforge.net/p/tmux/tickets/128/
> [3] http://invisible-island.net/vttest/vttest.html
>
> --
> Balazs
>



-- 
Tai Chi Minh Ralph Eastwood
tcmreastw...@gmail.com
diff -r 7adbbf32444e src/term.c
--- a/src/term.c	Thu Nov 21 18:13:38 2013 +0100
+++ b/src/term.c	Sun Jun 01 06:02:51 2014 +0100
@@ -5055,7 +5055,7 @@
 
 	    /* Work out our pseudo mouse event */
 	    key_name[0] = (int)KS_EXTRA;
-	    if (wheel_code != 0)
+	    if (wheel_code != 0 && (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE)
 	    {
 		if (wheel_code & MOUSE_CTRL)
 		    modifiers |= MOD_MASK_CTRL;

Reply via email to