Home > MAC > Enabling mouse scrolling in GNU screen when connecting from MAC

Enabling mouse scrolling in GNU screen when connecting from MAC

GNU Scren is a great tool for system administrators, as it allows to do anything on a remote server and then continue from exactly where you left later by reconnecting to the session.

But one of the most annoying issues with screen is that if you connect to a screen session and if you want to see the scrollback history, then you need to press the screen keyboard shortcut CTRL+A+]. This is annoying as most people are used to scroll up via mouse.

This is a repost from this site and it helps in overcoming the above issue in MAC’s default terminal Application. All the credits goes to the Original poster and I am just reposting that  for my own reference incase if the original site goes down/removes the content.

Typical use case of GNU Screen for me

MAC Book Pro: My Office Laptop which is connected to my corporate lan only when I am in office/VPN
Linux Server: My office server which is 24X7 up and has GNU screen running.
Network Devices: I need to have a always on telnet session to my Nexus 7000 devices, so that I can monitor whats going on with the device.

So what I normally do is from my Macbook pro, I ssh to the “Linux Server” and then start a GNU screen session by “screen -S devices”. Now from that  screen session I create multiple Tabs and connect to my network devices. So whenever I turnoff my laptop, these sessions will still be alive as the Linux server is always up. So when I reach home, I can just connect to my VPN and then again connect back to the screen session by typing “screen -x devices”.

This is exactly like you run a vnc on the Linux server and then open xterms to the network devices from the vnc session. The advantage of screen over vnc is that screen is really fast and is very good in low speed internet connections.

GNU screen takes all its setting from a .screenrc file which is in your home directory of the Linux server. To enable this tip add the below lines to your .screenrc file

defscrollback 5000
termcapinfo xterm* ti@:te@

Once done, save the file and connect to the screen session from Terminal app and now you can use your mouse scroll up gesture to see the scrollback history.

Note: This trick works only if you are using the default “Terminal” App in the Mac. If you use another app like “iTerm2”, then this tip doesnt work. There is an open bug with iterm2 for this and you need to wait for that to get resolved. Click on this link to see the bug.


Categories: MAC
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: