(WIP) Dev Tools - Multiple Terminal Window with tmux

Published
Tags
It’s been nearly one and a half years since I decided to use nvim as my main code editor. Along with it, I also learn to use tmux. In this post, I wanted to share several things:
  1. The problem before tmux,
  1. What is tmux, why and how tmux can help my workflow,
  1. A crash course on how to use tmux
  1. How I configured tmux to boost my workflow

The problem before tmux

I use iTerm2 as my main terminal. iTerm2 supports multiple panes. But there are some limitations that I haven’t explored more on iTerm2 such as managing terminal sessions and arranging the layout of the pane.
There are several things that I keep in mind when looking for the solution:
  1. I can navigate through the panes easily
  1. I can layout the panes effortlessly
  1. I can custom the looks of the terminal
  1. I can do everything above without moving my fingers from the keyboard 🏃
It didn’t take much time until I see my co-workers using tmux and I can it instantly got my attention. Well... I’m a simple man 🏃

Holy-code! What is tmux?

So, what is tmux?
Well, from the Github repository, tmux is a terminal multiplexer. tmux enables us to create, access, and control a number of terminals from a single screen. What makes it more interesting is tmux may be detached from a screen and continue running in the background. Yes, it helps me to manage multiple terminal sessions.
If that doesn’t tell you how important tmux feature is, let me give you my personal use cases.
Since I’m using nvim, I code in the terminal. But, while coding I also need another terminal to run my code. Not to mention, if I need to run tsc --watch when writing TypeScript or bsb make-world for Reason to make get compiler feedback ASAP.
In the case above, I have to look at at least 3 terminals; 1 for nvim, 1 for running the project, and 1 for running the compiler. Since tmux provides an “easy” way to create and move along these terminals, I can say the experience is incredible.
Add terminal recording on moving in tmux session

So, how to use tmux?