Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to make this work?

i'd love to scroll my files in vim with the mouse scroll wheel.

Also, i wouldn't mind scrolling the gnu screen buffer with the mouse wheel as well, without having to type ctrl+a,ESC

Edit:

as mentioned in Isaac Rabinovitch's answers, the screen and vim settings are already fine. I think the whole issue resides in PuTTY alone.

share|improve this question

3 Answers 3

This seems to be a common problem affecting both screen and tmux when accessed using PuTTY. Please see my answer to a similar question pertaining to tmux for some insight into the issue itself. There is a potential solution provided as well as some analysis.

Mouse scrolling in vim through tmux, how to configure?


An excerpt of the link above describing the potential solution:

Potential Solution -- PuTTY

There appears to be an issue where PuTTY sends an extraneous ScrollDown event with every ScrollDown/ScrollUp event. This means that each attempt to scroll up gets cancelled out and nothing happens. Conversely, when scrolling down, each scroll event is doubled. The behavior is easy to validate by looking at the vim scrolling behavior first outside of tmux (where scrolling works properly), and second inside of tmux (where scrolling up does not work, and a single attempt to scroll down scrolls twice as much).

According to the following gmane thread, the issue described above is resolved with a patch from Putty-X (https://github.com/atsepkov/putty-X/commit/bbcedf5a85ca1ccaa27005e7f7ebeb4c8a783b88):

Link to gmane thread: http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/5498.

NOTE: I haven't validated the above solution myself, so please review the gmane thread for additional information.

share|improve this answer
    
This is basically a link-only answer, which is not the preferred answer format for superuser. Can you summarize the steps here? Leaving the link is okay. –  Heptite Apr 24 at 20:24

Scrolling with the mouse wheel in Vim under PuTTY over an ssh connection works for me if I have executed this:

:set mouse=a

Tested with tmux, screen and no screen multiplexer.

Edit

As requested, here is the ~/.screenrc from the machine I used for testing.

startup_message off
vbell off
bell_msg 'Bell in window %n^G'
defscrollback 500
hardstatus off
altscreen on

share|improve this answer
    
wait, here it works with plain putty->vim. but with putty->screen->vim it does not work. it scrolls the putty scroll back when i'm under screen. can you paste your screenrc? –  gcb Apr 19 '13 at 21:44
    
thanks. mine is way more complex than that, but even with this basic one it still does not work :/ will probably end up giving tmux a try –  gcb Apr 20 '13 at 3:43
1  
tested mouse=a on xterm under debian, and i can scroll just fine. but not when in windows using putty. –  gcb Jun 10 '13 at 12:58

Why not use use gvim instead of vim? Then all the GUI stuff, like wheel events, becomes simple and obvious.

What, you say you can't run X software remotely from Windows? But you can. Just run an X-server on Windows. I use XMing, but there's also Cygwin/X. Then you just tell Putty to forward X data and your Windows desktop becomes an extension of your remote machine.

share|improve this answer
    
i do that for seeing larger diffs on meld, but using vim over ssh is already too slow for me (and the machines have a 80ms ping). i think gvim over X would kill me. I use Xming as well. –  gcb Apr 20 '13 at 3:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.