vim under screen under PuTTY working with mouse wheel?
Solution 1
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
Solution 2
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.
Related videos on Youtube
gcb
Updated on September 18, 2022Comments
-
gcb over 1 year
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.
-
gcb about 11 yearswait, 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 about 11 yearsi 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 useXming
as well. -
gcb about 11 yearsthanks. 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
-
Heptite about 10 yearsThis 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.
-
Mr. Llama about 7 yearsAs of PuTTY 0.67 (it may have been fixed earlier) this doesn't seem to be an issue anymore.
-
L__ over 5 years+1 It's kinda slow most of the time - but noice