Question

iTerm2:

Mouse reporting works out of the box, works in Vim, works fully in Tmux, mouse wheel reporting works in Vim and for navigating Tmux history, but mouse wheel reporting does not work in manpages, does not work in git log, does not work in less

Terminal.app:

Mouse reporting does not work out of the box, but once installed mouse wheel reporting works everywhere including less and manpages and git log, etc. However mouse click+drag fails in Tmux, but still works in Vim.

So I'd rather use just one of these terminal apps, and I am particularly digging the immense feature set of iTerm2 (e.g. mouse-over to select which term to input to beats the hell out of anything Tmux can offer since it is zero keys to switch contexts) so I'd prefer if I can get mouse wheel reporting working fully in those programs.

I am having a hard time trying to debug the terminal codes being sent because the only way I can intercept them is through Vim, (as ctrl+V followed by scroll in my terminal will just have it scroll the terminal buffer) but Vim seems to be doing everything correctly.

Update: According to mouseterm project, it seems to be using a feature called "Simulated mouse wheel scrolling" to scroll programs like less... maybe I can configure iTerm to do the same. Somehow. I do believe PuTTY also accomplishes this, and I'd like to have at least the functionality I can get on Windows on the Mac... Nope, I'm just spoiled by the neatness of MouseTerm.

Was it helpful?

Solution

Although less (which is also used in git log) does not use mouse reporting itself, iTerm2 can be configured to send up/down-arrow escape codes for scrolling (from mouse wheel or trackpad two-finger swipe) and less understands those.

See my answer to a related question about how to set this up for iTerm2.

OTHER TIPS

less does not actually recognize any terminal mouse events. (As such, tools that use it, like man and git log will not recognize mouse events either.) Something else you've done must be making it appear to support mouse events.

If you want the mouse wheel to work in your pager, you'll need to find a pager other than less which supports it. You might be able to put something together using view (vim in read-only mode), but applications like man which output content with control codes will be an issue there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top