Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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

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.


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
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

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 (

Link to gmane thread:

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 '14 at 20:24

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .