tmux is still an essential tool in my development workflow. Today I’m writing to share a few aliases/helper functions I’ve recently added to my dotfiles. Those change all the time so I’m hesitant to link to the files which the helper aliases and functions currently live in.
The implementation is mostly stolen from other people’s dotfiles and is gnarly to look at so I’ll just share how I use them:
Here’s how to use these aliases:
When I’m not in a tmux session, and I want to see the list of tmux sessions, I
used to run
tmux ls. Now I run
When I’m not in a tmux session and I’d like to start a new one, I used to run
tmux new -s blog (where
blog is the name of the new session). Now I run
It auto-chooses a session name based on the current directory’s name.
If there’s already a session with the name of the current directory, it cleverly attaches to that session instead of trying to start a new one with that name.
If I’m not in a tmux session and I’d like to attach to any existing tmux
session, and I don’t particularly care which one because I’m planning to go into
the session switcher anyway (
C-b s), I used to run
tmux a. Now I run