I am using Screen with MinTTY at a bash prompt. Sometimes I want to activate scrollback and copy some stuff that was on the output. My first instinct is to scroll with the mouse, but all that happens is old bash commands start showing up (like when I press the up arrow). Is there a way to re-map the mouse wheel to:

  1. Go into scrollback mode, or
  2. If already in scrollback mode, start moving up in the scrollback window

The easy thing to do is to stick the following into .screenrc:

termcapinfo xterm ti@:te@

That disables screen's use of mintty's alternate screen, but please note that old lines from all of screen's windows will get mixed up in the terminal's scrollback.

Screen maintains its own window-specific scrollback buffers though. Using mintty's "application mousewheel mode", and with the appropriate mappings in .screenrc, it should be possible to access those with the mousewheel, but I haven't tried that.

(Normally the mousewheel sends cursor keycodes, so that it works out of the box in things like "less", but in "application mousewheel mode" it sends separate codes. See the mintty manual for details.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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