Install tmux 2.3 on Redhat 6

tmux

I started using tmux about fours years ago and immediately decided it was my new favorite terminal multiplexer. Prior to that I used GNU Screen, but tmux sold me on the ability to do both horizontal and vertical splitting (and yes, I know screen now has the same feature).

Starting in tmux 1.8 a new feature called "zoom" (Ctrl+b z) was introduced. This allows you zoom into a pane, do work, and zoom back out.


The Problem

I run mostly RHEL6-based distros in my work and the latest version of tmux available in the repos is 1.6. At the time of writing this, version 2.3 was available from tmux's official site.


The solution

Grab the file

$ wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz
$ tar xzf tmux-2.3.tar.gz
$ cd tmux-2.3

Install the prereq's

According to the tmux site libevent and ncurses is required. What it doesn't say is that that libevent__2__ is required.

$ yum install libevent2-devel libevent2 ncurses-devel ncurses

If you are running libevent (version 1) you will get similar errors during make:

$ make
control.c: In function 'control_callback':
control.c:63: warning: implicit declaration of function 'evbuffer_readln'
control.c:63: error: 'EVBUFFER_EOL_LF' undeclared (first use in this function)
control.c:63: error: (Each undeclared identifier is reported only once
control.c:63: error: for each function it appears in.)
make: *** [control.o] Error 1

Compile

$ ./configure
$ ./make

ERROR!

tty.o: In function 'tty_cmd_setselection':
tty.c:(.text+0x807): undefined reference to '__b64_ntop'
collect2: ld returned 1 exit status
make: *** [tmux] Error 1

Turns out there is a typo in the Makefile. On line 369, replace LIBS = -lutil -lncurses -levent -lrt -lncurses to LIBS = -lutil -lncurses -levent -lrt -lresolv

Retry

$ make clean
$ make
$ make install
$ tmux -V
tmux 2.3

Install to another location

Perhaps you do not have root access to the machine you are working on, or you just want to install tmux to a different location. Run the configure like this:

$ ./configure --prefix=$HOME/local