2013-01-30

Quick Bits #2 - Terminal tutoring

Recently I've commented this on one of the G+ threads, so decided to put it on the paper internet. There is these tools - terminal multiplexers. Most commonly known is Screen. Another, a lot younger one is Tmux, oh there is also wrapper for these called Byobu for Ubuntu, but that's a little bit off topic. They share a lot in common, and have some differences as well. Best comparison is here - https://www.wikivs.com/wiki/Screen_vs_tmux.
In short - these programs allows to run multiple terminals in single session, allows to leave it running and continue latter on. If you're doing a lot of work via ssh, most probably you already use one of such multiplexers.
One of great features is session sharing (both of them have it). Session sharing will allow to multiple users enter text/commands and view same outputs and inputs. At least in screen (not sure on tmux yet) there is a problem - when you share a session, and it contains multiple terminal instances - all connected users needs to switch to that terminal manually. So the easiest solution is to run screen within a screen (no screenception pun intended) or mix screen and tmux, whatever works, personally I like mixing screen and tmux since by default they use different keys ^a and ^b... In such case only the bottom layer  (first screen/tmux) will need to share the session while top layer (second one) will just display output for all users, meaning that if one will switch terminal it will be switched for all. So far it seems to me to be the best way to introduce to code/configs and terminal based tools.

To share screen session (what I personally used) - http://serverfault.com/questions/336594/share-screen-session-with-users-in-the-same-group-linux
For Tmux - http://readystate4.com/2011/01/02/sharing-remote-terminal-session-between-two-users-with-tmux/