PuTTY or other Windows SSH client: mouse wheel to scroll less/more or other pager on UNIX server?

6

1

I like GNOME terminal because when you ssh to a server and run commands such as man init then you can use the scroll wheel to navigate the man page.

Unfortunately my Windows SSH clients do not support this.

How can I find an SSH client that supports this short of operating a Linux VM?

Edit: I found that PuTTY supports this in vim when you use :set mouse=a.

However, with commands like less, I can only seem to get it to work in GNOME terminal. Surely there's a way to make this work with PuTTY also? I'm also open to suggestions of alternate Windows SSH clients.

Bryan Field

Posted 2016-01-12T17:25:33.170

Reputation: 487

Simple: use Linux :-) – Jakuje – 2016-01-12T18:11:15.837

That would be so cool! Unfortunately I cannot wash my hands of Windows just yet. (although I could try to get Windows in a VM, just don't feel like doing all that just yet) – Bryan Field – 2016-01-12T18:33:44.977

An alternative windows client would indeed be one way to get this. Another would be to just use a remote desktop client and remote into a real Gnome desktop from windows. – Warren P – 2016-11-30T18:43:08.617

Answers

4

Regarding less, it is done all in the terminal emulator, because less is unaware of the mouse.

The way it works with gnome-terminal is that it sees that the program switches to the alternate screen (an xterm feature) and since normal wheel mouse scrolling would be pointless (the alternate screen does not scroll), the developer chose to send up/down cursor-key escape sequences. That works with less, just as if you pressed those keys on the keyboard.

PuTTY does not have this feature; its development has been glacial for several years. A comparable feature was added to xterm in 2012, called alternateScroll.

Before (or if the feature is not used), xterm (which Putty imitates) would send a different escape sequence for the wheel mouse, but only if the program sends an escape sequence to turn on the mouse protocol. less does not do this (and actually does not expect to read xterm mouse escape-sequences).

Because the feature in gnome-terminal relies upon the terminal description using the alternate screen, that means that it will work on say half of the various systems, since people liking or disliking the feature seem to be fairly evenly split.

Thomas Dickey

Posted 2016-01-12T17:25:33.170

Reputation: 6 891

Your info on the alternate screen has been quite helpful. – Bryan Field – 2016-11-30T18:58:30.857