Screen the app that can split screens like so, is not too intuitive when it comes to scrolling thru your bash shell. Notice where the cursor is in the diagram below, its in the top right window, sitting at an empty prompt right after an ls -1 was run. Lets say I wanted to scroll up. I cant use the mouse wheel (yet), however I can use Control-A [ and then use the arrow keys to scroll up and down (pressing q when im done)

By default mouse wheel support is not enabled.

To enable mouse wheel support in screen you will need to add the following lines to your screen configuration file ~/.screenrc. I would also recommend to make sure you have the latest version of screen installed (I am using 4.04).

I just put the following two lines in my .screenrc in my $HOME dir (thats all thats in my .screenrc)

# cat ~/.screenrc
defscrollback 15000
termcapinfo xterm* ti@:te@

I tested and this and it works with Putty. This should also work in Max OSX and also with Cygwin.

Sidenote: I might actually be misleading you and it might not work so well when you have screen doing window splits. However it works well when the windows are not split. Thats for you to test and find out.

Some other recommendations, that I have seen, are to launch screen like so:

TERM=vt100 screen

Sidenote: If you are already in a screen session when you make these changes, you will not see them be activated, first you need to detach, and then reattach to your screen session. Detach screen like so: Control-A followed by little d  (a.k.a. Control-A+d, or simply ^A d). Then create the file ~/.screenrc (if doesnt exist, and if it does, just add those lines). Finally reattach to your screen detach with screen -x (which will reattach to your last session). If you have several detached screen sessions then you can use screen -ls to see all of your screen session listings. You can connect to different screen sessions by their ID screen -x ID (example: screen -x 9532). Where ID, you get from screen -ls.

Sidenote: try the scroll wheel in a new screen session. If your having troubles not getting mouse wheel support after editing the file, maybe kill all of your screen sessions and try it.

The end.

Leave a Reply

Your email address will not be published. Required fields are marked *