tmux is one of my favourite terminal multiplexer, it enables number of terminals to be access via a single connection.
Unfortunately most package manager has an older version of tmux, and some of the features I like only available in the latest version of tmux, so we will need to build tmux in source. Here are the steps required:
First add all the build tools and the libraries it required:
$ sudo apt install -y build-essential
$ sudo apt install -y libevent-dev
$ sudo apt install -y libncurses5-dev
Then you need to download the source from tmux release page. I am currently using 2.9. After you download it, you can then configure and build:
$ ./configure && make
$ sudo make install
If everything goes well, then you should have access to the latest version of tmux.
But wait, this is not the end. While tmux is nice, the default configuration is rather limited and require you to learn a lots of custom command for very simple things like scrolling back history, select text for copy'n'paste.. etc. Enter On My Tmux. This configuration template support mouse scroll back history, mouse resize pane, mouse select pane, automatically select text... etc. Highly recommend you check it out if you are using tmux.