Bye bye screen, hello tmux

 For quite some time i have used screen from time to time. Screen is the gnu terminal multiplexor that allows you to start multiple terminal windows in a terminal session.

One of the main reasons for this is to be able to detach a number of terminals when running over a ssh session to one of our servers, logout, shutdown my computer and go home, and start up and reatach all the terminals once I am home. Its very convenient.

Screen as been around for ages, and works quite well, but development has stopped since 2008. So there will be no new features. Its also a but of a memory hog and consumes quite a lot of memory on the server when running many windows.

This is where tmux comes in. Tmux is an newer program that is in constant development, has more features that screen, and is also a lot more efficient and not as memory hogging as screen. So there is not mush reason to stay with screen. Is one looks a google the trend is very clear in tmux favour.

Clearly tmux if gaining more and more interest.

And if you are a bit afraid to take the jump, you can (and i will describe that later) configure tmux to be almost compatible in keystrokes with screen.

Installing tmux

If you have a modern ubuntu system, like the laptop im doing most of my work on you can install simpy by getting it from the repositories

But i also have an olde centos 5.2 version that om doing a lot of work on, and i needed it there to. So how to install it there. Well the simplest way its to get the libenevt and ncurses packages, and build static verission of that and the tmux and install it locally. That way the libraries and other stuff will not comflict wth anything running on the server.

Install llibevent-2.0

First you need libevent-2.0

 Install ncurses 5.9

And then we need the ncurses libraries

 Install tmux

And now we can build and install tmux:

Now we have the tmux installed and running.

If you start tmux now the command key will be CTRL+B, but in the next post I will show you how to reconfigure tmux to use CTRL+A as screen does, to make the transition easier.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.