universcroll

Description

With scroll(1) and default binds (as of 0.8.4), how to scroll?

With universcroll patch, always use Mouse{4,5} to scroll {Up,Down}. Doesn't matter alt screen or not. No more ^Y^Y^Y^Y^Y^E^E^E^E^E!

universcroll-example on top of universcroll makes some extra changes:

Download

Notes

In the provided config, both Mouse{4,5} and Shift+{PageUp,PageDown} emit {\033[5;2~,\033[6;2~}. In default scroll(1) config, those sequences scroll {Up,Down} by full page each time (like TTY). This is maybe not desired behavior.

You can change st(1) config to use different sequences and define how scroll(1) responds to sequences in scroll(1)'s config.

In st(1) config, some keys are defined to send certain sequences in key[]. Inside mshortcuts[] and shortcuts[], use function ttysend with argument {.s = ""} to send sequences.

My settings: //st { XKNOMOD, Button4, ttysend, {.s = "\033[1;3A"}, 0, -1 }, { XKNOMOD, Button5, ttysend, {.s = "\033[1;3B"}, 0, -1 }, //scroll {"\033[1;3A", SCROLLUP, 3}, /Mod1+Up/ {"\033[1;3B", SCROLLDOWN, 3}, /Mod1+Down/

Bugs

Non-readline shell (zsh, fish) can have prompt issues with scroll(1) (Scrolling down by line after scrolling up, among other things). More problems with non-PS1 prompt.

Author

universcroll was made possible by scrollback-mouse-altscreen. All alt screen detection code is from that patch.