Scrolling/mouse wheel improvments (VTE-like) in urxvt

I like urxvt a lot, but there's one little thing that always annoyed me, especially since I used to use XFCE's terminal which, like (I assume) all VTE-based terminals, behaves differently.
Like pretty much all other emulators, urxvt supports using the mouse wheel to scroll in the terminal's buffer; But, unlike some others, that is all it does.
Other (VTE-based) terminals, when running an application that uses the "secondary screen"(*), will disable their scrollbar, and instead you can use the wheel to interact with said application. For example, when in `less` or `man` you can scroll around using the mouse wheel. And it's a really nice thing, because it feels very natural (to me, at least).
(*) not sure whether this is the "official" term or not, but at least that's how it's called in urxvt.
And it is the one thing that always annoyed me about urxvt: even in such applications, the mouse wheel will simply scroll through urxvt's own buffer. So I finally decided to grab the source code and have a look, and lucky enough it turned out to be pretty easy to change things.
Introducing a new option: secondaryWheel (ssw)
Yeah, that name might not be the best, but it goes along side secondaryScreen (ssc) - which is obviously required for this to work at all - as well as secondaryScroll (ssr) - with which, IMHO, it is somewhat related. So, there you go.
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 some (3, to be exact) "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.
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.
This is just another option (disabled by default), so you can either use it from command-line (ssw), or specify it in your .Xdefaults using it's long-name: secondaryWheel
Like I mentioned earlier, I believe this option is related to secondaryScroll, as in it works best if you disable it, while enabling secondaryWheel
That way, not only can you use your mouse wheel to scroll around in those applications, but whatever you do here will not "mess up" your scrolling buffer (on primary screen). That's how I use it, and I really like it that way.
Less blah, more download
The modified source code is available on this BitBucket repository. Note that it not only features this patch, but also this great one from rlblaster.
Or, you can also simply use this PKGBUILD.
Note: The PKGBUILD includes both patches, and also uses different compilation options (than the official package) to disable utmp/wtmp support and tabbed support. This is mainly because I don't use those, plus I beleive that utmp/wtmp doesn't actually work anyway (it would require setuid to be set, which isn't the case in the official package. Though, I did include the required lines (commented out) in the PKGBUILD; should you want to use it, you can simply uncomment them, and don't forget to change the options as well).
And of course bug reports, suggestions or any other form of constructive criticism is very much welcome.

Sorry for the necro-bump, but I found this thread while troubleshooting an issue with scrolling in urxvt.
This is the precise patch I was looking for, but the link to PKGBUILD in the OP's post is broken.
Here is the direct link to the AUR package: https://aur.archlinux.org/packages/rxvt … -scrolling
Also this patch is great. I moved over from Gentoo who includes this patch in the rxvt-unicode ebuild so I never really knew about it.
Moving to Arch caused some frustration as this patch wasn't included and I had no idea what was wrong.
Anyway, this package is great and I hope it's maintained forever and ever (or for as long as I use urxvt).

Similar Messages

  • Scrolling mouse wheel

    Hi,
    Does anyone know how to make a movieclip scroll with the
    mouse wheel with a slowdown (makes the movie clip look like its
    slowing down) function so that with one scroll of the wheel the
    movie clip will move down then slow down and with another scroll it
    will go down further etc...? I can get the scroll wheel working
    with the slowdown function but what im finding is flash wont
    recognise the mouse wheel after one 'turn' of the mouse wheel. In
    other words i can scroll once and no more.
    I have attached the code. The code is all on one frame in the
    _root timeline and 'panel' is the movieclip to be scrolled...
    Any help would be great....

    thanks _name for your help, although i didnt have any luck
    with doing it that way. I have made a bit of progress though, i can
    get the mouse to scroll the movieclip (panel) in one direction with
    a friction function attached so once scrolled it goes from faster
    to slow to stop, the main problem is i cant get it to do the same
    thing when scrolled in the opposite direction (i have put a
    function in there to act as a 'stopper' to stop the scroll. Anyone
    have any ideas about this?
    cheers for any advice offered...

  • Mouse wheel value update

    Hello everyone
    I am trying to get the value from "mouse scroll" changed by mouse wheel. The attached code is very simple and seems to be right wired, but it's not working properly. If you run the VI and scroll up and down  mouse wheel, you will see that sometimes the value is updated on the indicator, sometimes don't. If you keep using the mouse wheel always on the same direction (i.e. up), the value on the indicator starts to increase but not after every single roll of the mouse wheel. Seems like a lack of sync between the while loop execution and the mouse wheel usage.
    Any ideas how to trigger the loop just after mouse wheel usage? I have to sync them.
    Thanks
    Dan07
    Attachments:
    Mouse Wheel Value Update.vi ‏10 KB

    Mike
    I got your Vis and did some modifications to adjust them to my code and everything is working like a charm. But I would like to understand what's going wrong with my code (the one that I attached on the first message of this thread). I did a very very very simple code that was supposed to do the jog, but it is not working. As I roll the mouse wheel the value on the indicator does not update in sync with the mouse wheel (sometimes it updates, sometimes don't). If I have my code working I can put it inside an event structure on the timeout case and use:
    Mouser Enter array - feed timeout with 10ms
    Mouse Leave array - feed timeout with -1ms
    Anyway, thanks for your code.
    Please, help me to understand what's wrong with mine.
    Aested, my VI works on my computer too, but the value on the indicator does not update in sync with all movements of mouse wheel.
    Thanks
    Dan07

  • JTextPane: scroll with wheel when using addMouseWheelListener()

    Hello! I have JTextPane with code (code editor) with busy mouseWheelListener() which is used to increase/decrease font size when Ctrl key is hold. I think I overwrite default wheelListener behavior, so it is impossible to scroll text with a wheel. How can I do that?
    My code is below:
    JTextPane editor = new JTextPane();
    editor.addMouseWheelListener(new MouseWheelListener() {
                public void mouseWheelMoved(MouseWheelEvent e) {
                    if (e.getModifiers() == InputEvent.CTRL_MASK) {
                        int notches = e.getWheelRotation();
                        Component originator = e.getComponent();
                        float prevFontSize = originator.getFont().getSize();
                        if (notches < 0) {   //if UP then descrease font size
                            if (prevFontSize > 12.0f)
                            originator.setFont(originator.getFont().deriveFont(prevFontSize - 2));
                        else {  //if DOWN increase
                            originator.setFont(originator.getFont().deriveFont(prevFontSize + 2));
    JScrollPane editorWithScrolls = new JScrollPane(editor);
    //...nothing happens when I scroll mouse wheel...
    How can I scroll text with mouse wheel in my case?
    P.S. May be anybody knows how to scroll and set caret to given line(word)?
    Thank you.

    the textpane processes the event before it gets to the scrollpane.
    you need to "pass it on"
                        else {  //if DOWN increase
                            p.setFont(originator.getFont().deriveFont(prevFontSize + 2));
                    [scrollpane].dispatchEvent(e);//<--------------------------
            });

  • Is there a way to change my mouse wheel's funtion so it will scroll with out

    I'm stuck in habit that's hard to get out of. I started editing in Vegas then moved to Premiere CS3.
    I never use the mouse wheel to scroll frames. I wish it could just zoom in and out of the timeline like it did in Vegas without me having to push alt-scroll wheel.
    I'm might be asking for a lot but is this possible? I just can't break my habit of using just the arrow keys when I want to scroll frame to frame. Even though the alt-scroll has 'clicked' in my brain there's that 10% hesitation. That I know would make me more comfortable.
    Call me weird but is there a solution?

    Josh
    Place the cursor over the Source or the Program Monitor and use the scroll wheel to scroll frames.
    (Your post is not that clear whether you want to scroll frames or zoom the timeline as you mention both)

  • Flash freezes in Firefox when I scroll the mouse wheel over a drop down list or text field (possibly others as well).

    Whenever I scroll in a drop down menu in Flash in Firefox (for example, I move the mouse wheel just one detent), it just continues scrolling on its own all the way to the bottom of the list and freezes all interaction for about 10 seconds.  It's really bizarre.
    If I start click and dragging things, nothing happens, and then all of the sudden everything catches up and moves.  As an experienced programmer, I can say that it looks like some kind of queuing of keyboard/mouse events with delayed execution.   Has anyone else encountered this issue?
    I found something from 2008 that sounds similar, although I am not using the sIFR they mentioned: sIFR mouse wheel scrolling freeze in Firefox - Stack Overflow
    Seems to be a Firefox-specific issue, although it also seems to be something that has just recently started occurring since updating Firefox.
    UPDATE:  I was checking my Firefox version in Help > About Firefox, and it showed version 33, but also had a pending update so I restarted Firefox.  The problem was no longer occurring at that point.  When I checked the version again, it said 33.0.2, but it also said "applying update", with another pending restart. I restarted Firefox again.  It's now stable at version 33.1.  So perhaps it was a problem with that particular version, or even a temporary issue with that running browser instance.

    Hi James,
    Thank you for sharing your solution with us. It will help other users with a similar issue.
    Thanks,
    Preran

  • NOTHING will allow me to mouse wheel scroll through fonts in CS6

    OMG, I am about to have a coronary trying to find fonts!  I have looked on this forum for an answer that works and cannot find anything thus far.  First, WHY is it necessary for CS6 font list in the Character Pallet to take up 1/2 of my screen?!  Second, do i REALLY have to click the little arrows at the top and bottom of the font list to scroll through fonts, ONE.BY.ONE?  Typing the first letter does not work either, it takes me to say the "D" fonts but when i click the drop down arrow to see my list of "D's", it shows a list from the top, not the D section.  I REALLY hope I am missing something here, because seriously, this is totally unusable.
    ETA:  Going to the TYPE>FONT menu at the top does not scroll either and Photoshop CS6 works beautifully...
    ETA (again):  i CAN scroll through the menu on the top (under the FILE-EDIT-etc menus), but there is no font preview (and it is selected as med in preferences)

    Thank you for the reply.  System is a fairly new Windows 7, 64 bit, plenty of RAM, hard drive space, i5 dual core processor.  To have this issue in Illustrator only and not in Photoshop seems less likely a software conflict (just guessing)?  I attached screen shots.
    Character Pallet drop down (mouse wheel, keyboard arrows, typing a letter key...all do nothing)  Only way to navigate is by hitting the little arrows on the top/bottom of the drop down.  And no scroll bar?
    Top Menu Drop Down - scrolls, hit a letter key and works, arrow keys work.  Could use this permanently, but there is no font preview..
    All of what you said works on your system, is how I would expect it to be programmed.  Partially making sure this is not the way it was designed, and hoping to find a fix for why its not working correctly.
    Main programs installed:
    Firefox
    MS Office 2007
    quickbooks
    CS3 Design suite (I JUST upgraded to CS6 and have kept it there for a backup...probably can uninstall now if that could be an issue)
    Thank you for any advice and if you would like to upload the video, that would be great.

  • Mouse wheel scrolling by page instead of 3 lines

    When I scroll my mouse wheel down or up, it goes by page instead of 3 lines (as set in Win7). This is happening only in Nightly 39.0a1 (2015-02-24), and I can't find where to change the setting, and frankly don't know how it got changed in the first place. Every other application does the 3 lines like they're supposed to. I was just scrolling thru my email and BOOM it started going by page. I've rebooted and tried holding every combination of CTRL/ALT/SHIFT and scrolling thinking that might help. Any ideas?

    hi greystoker, nightly is an unstable development branch where things are bound to break or go wrong every now and then.
    what you're describing sounds like [https://bugzilla.mozilla.org/show_bug.cgi?id=1136177 bug #1136177] which will be addressed in one of the next updates.

  • 30EA1 /2.*: Mouse-wheel scroll jumps

    Hi folks,
    Under my XP install, my mouse-wheel jumps the default 3 lines in all programs, so it did in previous sqldev versions.
    Yet in 2.1 EA1, it jumps 12 lines!
    Can someone from the team acknowledge this behaviour, and if so, log a bug?
    Thanks,
    K.

    FINALLY!
    With the arrival of EA2, I reckoned to try to tackle this again.
    A fresh install works OK, but with minimal changes to the UI and settings, I'd get double jumps again.
    So I narrowed it down to the docking position of the LOG pane; a docking size up to
    <SOUTH floatSize="351" dockSize="247">jumps OK, but starting at
    <SOUTH floatSize="351" dockSize="246">and lower, I get double jump size on scrolling the worksheet.
    I hope my efforts aren't in vain and this gets bugged and fixed by production. I like to minimize the pane all together to have more space, but that makes my scroll jumps pretty unusable. And sacrifying 247 pixels more than I'd like is an even bigger drawback.
    Thanks,
    K.
    PS: If screen resolution matters, that's on 1680x1050. Window state or size doesn't matter.

  • Using the mouse wheel to scroll, now jumps a few albums at a time unlike before

    help!  Using the mouse wheel to scroll, now jumps a few albums at a time unlike before ><
    In the past I was just able to go into the mouse control settings in control panel and reduce wheel scrolling to 1 page at a time.  Now i'm not able to scroll one album at a time anymore, even though my mouse control panel is still set to scroll at one page at a time.  Its skipping two albums ahead now and I can't pin point to the album I want now unless if I click on it.  I haven't used ituens in awhile so it must be something new on the last 2 updates, I don't see anything in the perference menu.
    thx

    I can't use the keyboard to scroll. I need to keep my hand on the mouse, otherwise I'd never get anything done. Since I have no problem getting Firefox to scroll one page at a time, and I'm constantly jumping between 3 browsers, it would be nice to be able to scroll a full page at a time in Safari, just like I can in Firefox. Thanks.

  • JScrollPane - Set the rate of the mouse wheel for scrolling

    Hi,
    I'm curious to know a little more about the mouse wheel used for scrolling in a JScrollPane. I'm using it for a JTextComponent at the moment, but the scroll rate is really slow.
    Is this because of the way swing deals with the mouse wheel, and therefore can I increase the rate of scroll?
    Or is it to do with the native OS and the way it processes mouse wheel events?
    Cheers,
    David

    Hey John,
    Scroll rate has nothing to do with the OS you'll be glad to know. As far as Swing goes, it doesn't in this case make any assumptions on how you want you 'views' to scroll.
    I think LookAndFeel implementations often decide on default behaviour - I suppose this is in essence the whole point of the pluggable LnF framework.
    Anyway, JTextComponent is an abstract class so I would not be surprised if it performs like a lame duck! You will however notice that it implements the Scrollable interface. Take a look at Scrollable.getScrollableBlockIncrement() and Scrollable.getScrollableUnitIncrement().
    Overriding these methods will give you the behaviour you desire.
    Warm regards,
    Darren B

  • CS6 Mouse Wheel Scrolling for Fonts in Character Panel

    in Illustrator CS6 I can no longer use my mouse wheel to scroll the list of fonts [which appear when you click the down arrow next to the font family] in the Character control panel. I could do this in CS5.
    Anyone know how to fix this? I think it dos not work in Photoshop CS6 either.

    Thanks Ivan for the quick response.
    Yes, if I simply hover my mouse over the Font drop down it allows me to scroll through fonts [but only shows the single, selected font]. This is quite helpful, if I have text selected, scrolling through fonts quickly changes my selected text to the scrolled to font, allowing me to preview fonts fast.
    While I do love and use the feature, I still often like to pull up the "full drop down list" of fonts like I've previously mentioned and use the mouse wheel to scroll through the list quickly. This enables me to see many fonts at once, instead of just a single one at a time. But again, this is where the mouse scroll wheel does not seem to scroll the list. I was able to scroll though the list in older versions of Illustrator CS.
    I've attached screenshots to show the specific "list" i'm referring to, just so you fully understand what i'm talking about (which I think you already do).

  • Change the amout a scroll bar moves when user uses the mouse wheel?

    hi,
    i have a JScrollPane, and when a user uses the "wheel" on the mouse, it seems to move up/down 1 line at a time...i would like it to scroll faster basically...so that when the "wheel", the scroll bars move up/down like 5 lines at a time....is there some way to set this value, or how can i do it?
    thanks

    It looks like it behaves just like if the user had clicked the up or down arrow on the scrollbar, so
    I would suggest setting the unit increment on the vertical scroll bar to be 5X its current value. Of
    course, this would also increase the amount that gets scrolled when the user clicks on the up
    or down arrow. If you don't want that, you'd need to somehow only change the increment on a
    mouse wheel event, do the scroll, then change it back. My guess is that you'll need to provide
    your own look and feel class to do that.
    : jay

  • Urxvt patch: VTE like clear screen behavior

    I've switched to urxvt last week. I come from the VTE world (gnome-terminal, xfce-terminal and such, the latter in my case). VTE has a nice feature to which I've accustomed myself. This is the way how it handles the clear screen function (ctrl-L).
    In VTE when you press ctrl-L, the screen cursor position gets to top row and the lines get scrolled just before the visible portion of the window. This means that the scrollback remains intact so you can scroll back and see it later. If you press ctrl-L again when you are at top you get a bunch of empty lines - you can use this to mark the scrollback with empty portions when you are scrolling back large amounts of texts.  This is handy for example when you want to quickly glance at an output from a command but you want to differentiate from different outputs - I press ctr-L several times before I execute the command and then I can just quickly scroll back - I immediately spot where the command began because it has a large black spot before it.
    The way urxvt works in this case that it just positions the cursor to the top row and then just erases everything below that point. This means you lose valuable lines from the scrollback. Example: type "seq 1000", press ctr-L. Now you won't see the last lines of the command's output!
    Now it is possible that I have a misconfigured urxvt and I'd be interested in the config option which I have misconfigured.
    Here's a patch for urxvt which adds proper clear screen function and also adds the VTE-like functionality:
    *** src/command.C 2011-10-29 18:06:07.000000000 +0200
    --- src/command.C.patched 2011-10-29 18:05:28.000000000 +0200
    *************** rxvt_term::process_csi_seq ()
    *** 2932,2937 ****
    --- 2932,2948 ----
    case CSI_CUP: /* 8.3.21: (1,1) CURSOR POSITION */
    case CSI_HVP: /* 8.3.64: (1,1) CHARACTER AND LINE POSITION */
    + if (nargs == 1 && current_screen == 0)
    + {
    + // This is usually followed with clear screen so add some extra
    + // lines to avoid deleting the lines already on screen. If we are
    + // already at the top, add an extra screen height of lines.
    + int extra_lines = nrow-1;
    + if (screen.cur.row == 0)
    + extra_lines += nrow;
    + for (int i = 0; i < extra_lines; ++i)
    + scr_add_lines (L"\r\n", 2);
    + }
    scr_gotorc (arg[0] - 1, nargs < 2 ? 0 : (arg[1] - 1), 0);
    break;
    Last edited by rlblaster (2011-10-29 19:07:32)

    Now I see what's happening! Your prompt uses '\e[H' which is used as move to home. I assumed that '\e[H' is usually followed with clear screen. This means if you use it to just move the cursor to home it won't work. I don't really see how could I fix this nicely but here's a workaround for your prompt: use '\e[1;1H'. In other words:
    PS1=$'%{\e[s\e[1;1H\e[30;42;1m%}[%~][%M] %{\e[K\e[256C\e[8D\e[30;42;1m%} [%D{%H:%M}]%(?,%{\e[32;32m%}\u2588,%{\e[31;41;1m\u2588)%}%{\e[u\e[1A%}\n%{\e[0;32m%}> %{\e[0m%}'
    By the way the feature of adding extra blank lines if your cursor is already at top won't work in your prompt because your cursor is always at least on row 1. You could change the patch from
    if (screen.cur.row == 0)
    to
    if (screen.cur.row <= 1)
    to have this feature.

  • Electronic noise is emitted from my computer when manually dragging the vertical scroll bar with hardware accleration enabled, but no noise is emitted when scrolling any other way (ie hyperscroll via mouse wheel).

    [Firefox 4.0]
    When I use my mouse button to hold and drag the vertical scrolling bar, my computer emits a soft grainy sound. However, when I hyper scroll with my mouse wheel, there is no noise.
    I do not get the quiet noise with Internet Explorer. I did not get this with previous versions of Firefox.
    Turning hardware acceleration off resolved this.
    I'm running Windows 7 with a dedicated graphics card (GTX 285).

    Quote
    amd 64=12a @12V
    ati 9800=7.5~10.5a @12V (assuming 90~125 watts) a max load,
    a 9600 ir nvida 5200 used far less power
    so your already at 18a with no fan,s no hd, no cd,no dvd ,no mobo chipset , no mem, no sound..etc
    If you exclude the motherboard, memory, etc like you did there, the amd 64 draws 7.2A @ 12V.
    90~125W for an ATI 9800?! [irony]Are you working for a PSU manufacturer or what?[/irony] That's just absurd.  
    Go read this post to get a feel for the actual power consumption: https://forum-en.msi.com/index.php?postid=297061&sid=#post297061

Maybe you are looking for

  • Rounding Up to be done at Header Level.

    Hi experts, I want to carry out rounding up at header level where there will be a multiple line items. E.G. Condition type JEXP (BED) is a item condition . There are two line items in a sales order and duty applied is Rs. 1.40 per item. Now system is

  • Changing fonts in web galleries....

    there is still no way to change the text font in the web galleries in lightroom correct? for me that is the biggest issue with the software and i really hope they address this asap. i cant imagine what they were thinking when they were coding the web

  • Do I need to get rid of duplicate libraries?

    Hi, I suspect I have a duplicate library of music and duplicates of songs taking up memory on my computer. I searched for a particular artist and found three versions of his songs in the following locations: usr> music> itunes> itunes media> music> a

  • How to read, write file inside the JAR file?

    Hi all, I want to read the file inside the jar file, use following method: File file = new File("filename"); It works if not in JAR file, but it doesn't work if it's in a JAR file. I found someone had the same problem, but no reply. http://forum.java

  • InCopy CS4

    We're currently running InDesign CS4. We've not previously had a copy of InCopy, but need to add it to one workstation. All I can find to purchase is InCopy CS5 or CS5.5 and I'm told that this is incompatible with InDesign CS4. We are not in a positi