Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have started working with rxvt-unicode (aka urxvt) but found an issue with mouse-wheel scrolling, as compared to gnome-terminal and konsole. The mouse wheel works fine for going through the scrollback buffer, but it doesn't work for automatic scrolling in less/most or vim (though in vim, setting mouse=a makes it work, but in a very different way, which I don't have to do with gnome-terminal/konsole).

Is there a way to make urxvt behave like gnome-terminal and konsole when in less and vim where the mouse wheel Just Works?

share|improve this question
    
A similar question has been on serverfault for a while, but hasn't received a positive answer: serverfault.com/questions/10308/… –  nidi Jan 15 '10 at 14:34
    
Thanks, this wasn't annoying me until you pointed it out! –  Kyle Smith May 18 '11 at 15:02

2 Answers 2

Old question, but: while this is not possible in urxvt, I made some changes that will add an option (secondaryWheel) to do exactly that, and make it behave like VTE-based terminals.

What this new option does, is pretty simple: when using the mouse wheel, if you’re on secondary screen(*) then no scrolling will occur, and instead 3 “fake” keystrokes will be sent to the running application. So, a wheel up will have the same result as pressing the Up key three times, and wheel down will do the same as pressing 3 times the Down key.

(*) not sure whether this is the “official” term or not, but at least that’s how it’s called in urxvt.

Easy enough, but that does the trick: now when running man, less or any other application that uses the secondary screen, you can use the mouse wheel to move around (or whatever said application would do, if you pressed the Up/Down keys).

It should be noted that I'm not sure this is actually how things are done in VTE-based terminals - I never checked - but this does the job, so it works for me.

A little more info, and links to the code & PKGBUILD for Arch Linux can be found there: http://mywaytoarch.tumblr.com/post/14455320734/scrolling-mouse-wheel-improvments-vte-like-in-urxvt

Hopefully this can be helpful to some!

share|improve this answer
    
Any updates on the patch? Has it been suggested for inclusion? –  blueyed 2 days ago

Nice question! Some useful post I'll cite Linux Question - "less" command output-I cannot scroll through it! and Archlinux Forum - Use Mouse Wheel in man/less.

Seems like less are just listening to keyboard events and does not have support for mouse. The enchantment request for mouse support is open Ref # 272.

The real solution is to use another terminal or pager(Vimpager).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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