Learning Tmux2

Feb 24, 2021

As most of my work flow is done in the terminal, I open up a lot of terminal windows. Using i3 I can handle quite a few at a time but sometimes I have long running processes which just clutter up my screen. For example running a local Django server, it essentially runs in the background and if there is an unexpected crash you would need to look at the logs but most of the time it just takes up screen real estate without doing anything. Tmux promises to give me back full control over my screen.

I have seen some videos on tmux and I have read some articles about it as well. It is a highly configurable UNIX program which lets you create and manage sessions. The first few chapters are about learning how to navigate tmux and setting up your own config file. The introduction covers the basics and the added screenshots are really helpful to see what the change will be.

The book gives a quick overview of tmux functionalities and presents it in a way you can follow along. The commands are explained and then added to a config file which you can follow along with. With this information you can branch out on your own and customize it to your liking. The settings in this book mirror the vim keys setup that a lot of programs use, which is nice unless you prefer emacs. In that case you will have to set it up to your liking yourself.

Tmux automation can also helps my work flow. Now I open up a terminal and use a custom command to list all my projects, select one from the list and then navigate to the actual code. Usually I open up the code in nvim and then create extra windows if needed. While it is just a few short commands, it is waste. Seeing as there is only a finite amount of projects I can work on (probably less then 10) it makes sense to create some scripts to automate the starting up. To make this scripting easier it is essential to set up each project in the same way. The third chapter goes into depth on how to set this all up. I am currently working on getting my setup just right. After that I will set up some workflows for projects so I can open all the needed tools with one script.

After this the book goes in depth about pair programming. As tmux creates sessions which you can detach from, you can allow multiple users to view a session. In this case you could allow others to access your machine via ssh and connect to a session. This can be done with plain tmux or through the use of addons such as tmate. I have not tried this yet but I did some pair programming through VSCode which I found to work a lot better than just reading someones pull request. You can follow along and have the original developer explain their thoughts while you can follow along on screen.

You can find the book here

ProgrammingBooksTech

Vito Minheere

Goodbye Things

Mastering basic Python algorithms