I love using Tmux for my terminal.
I have a tiling window manager (i3) for my 15” notebook.
On the left side I open a web browser. Now I can watch videos, read tutorials, develop React applications, etc.
On the right side of my screen I use tmux with two or three panes. The major pane holds a NeoVim instance. That’s what I’m using as my text editor for coding.
Yesterday I improved my tmux workflow. Chris Toomey offers some fantastic customization options for your tmux configuration:
My favorite is the “fuzzy session switching”. Using this option, you can search your tmux session easily with approximate string matching.
I use fzy:
Here is the modified script (add it to ~/.tmux.conf):
Fuzzy tmux session switching bind w split-window -v "tmux list-sessions | sed -E ‘s/:.*$//’ | grep -v "^$(tmux display-message -p ‘#S’)$" | fzy | xargs tmux switch-client -t" What it does:
You’ve created a tmux session and worked with it. You’ve created a pane layout that works for you, and started your Vim editor.
What happens when you shut down your computer, and start it again later?
Tmux doesn’t remember your sessions. When you restart tmux, you loose all your running programs, etc.
There are two tmux plugins that can help with that: Tmux Resurrect and tmux-continuum.
Installation with Tmux Plugin Manager Add theses lines to the list of plugins inside tmux.
A few days ago, I wanted to copy text from my tmux shell.
Unfortunately, the defaults from your standard terminal and shell (kitty and fish) don’t work, as tmux has its own key bindings.
I came across an excellent blog post called Everything you need to know about Tmux copy paste - Ubuntu, which listed all the steps you need to take.
First, the default behavior:
Enter ‘copy mode’ by pressing CTRL+b, [.
Now that we’ve installed tmux, the terminal multiplexer, how do we use it?
Start your project from your shell In the terminal, I navigate to the directory containing my project.
Start a new tmux session tmux new -t <project-name> I usually name the tmux session after the project directory to avoid confusion.
For example, if the project folder is called flask-react-auth, I create a new session with: tmux new -t flask-react-auth.
I’ve been toying around with tmux today.
tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
My terminal of choice is kitty, a GPU-based terminal emulator with tons of options.
kitty even offers windows and tabs, so I didn’t need to use tmux for creating new terminal panes.