TL;DR
Throughout the years, tmux has been on the top of the productivity tools that I use on a daily basis. It allows me to manage multiple projects simultaneously with ease in the terminal.
What’s tmux?
Simply put, tmux (Terminal Multiplexer) is a tool that you can use to easily manage working on projects in the terminal.
It allows you to have multiple sessions, in each session you can have multiple windows, and you can split each window into several panes.
You can think of a session as the biggest unit you could have in tmux, the window is a smaller part, and the panes are the smallest part of any window.
Any window could be split up to as many panes as you like. Personally, I prefer having at least 2 to 3 panes per project (window).
My setup
Back in the days when I first started using tmux, I was using Linux as my main OS. But right now, I’m using it on MacOS version 10.15.3.
My setup on Mac consists of
Setting-up tmux on MacOS
Install tmux via HomeBrew of OSX
1brew install tmuxAfter downloaded, check the version
1tmux -VIf you wanna start an unnamed session
1tmuxTo exit tmux
1exitTo start a named session
1tmux new -t someProjectIf you wanna keep a session running in the background, but you don’t wanna see it. You can detach a session.
1tmux detachIf you wanna go back to a detached session. You can attach to it.
1tmux attach -t someProjectTo list all tmux sessions.
1tmux lstmux prefix (the keys you press before any of the next shortcuts) is control + b.
Change the session’s number
1<prefix> + $Change Window Name
1<prefix> + ,Kill the Current Window
1<prefix> + &Split window into panes Vertically (top/bottom)
1<prefix> + "Split Horizontally (left/right)
1<prefix> + %Kill the Current Pane
1<prefix> + xor type
1exitKill the existing sessions
1tmux kill-server
Configuring the mouse for scrolling and navigation
I noticed an issue on MacOS using iTerm2, that the mouse can’t resize the pane size’s, it can’t either scroll, nor can switch between panes. Sometimes using the mouse makes things easier.
To get the mouse to work do the following
1nano ~/.tmux.conf
Then paste this into the file
1set-option -g mouse on
Save the file and run
1tmux source ~/.tmux.conf
Voila, your mouse is functional in tmux now! 🚀🔥
I hope that this article helps you become more productive at work. Don’t forget to subscribe to my mailing list if you wanna get notified about new posts in the future.