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.


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

  • 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

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.

  • 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
  • As of PuTTY 0.67 (it may have been fixed earlier) this doesn't seem to be an issue anymore. – Mr. Llama Feb 28 '17 at 20:56

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.

  • 1
    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
  • +1 It's kinda slow most of the time - but noice – L__ Oct 5 '18 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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