- Published on
A nifty tmux management script
- Authors
- Name
- Luke Wood
A nifty tmux management script
This is hardly a blog post - but here is a shell script I use to manage tmux sessions.
tn
stands for tmux-new - though this will also attach if the session already exists:
#!/bin/bash
# `tn`
tmux ls | grep "$1" && {
tmux attach -t $1;
return 0;
};
tmux new -s $1
This makes it impodent from the perspective of:
I'm entering a terminal, and I want to be in the session named "yt"
Once you get in the habit of using the same names per-project or workspace, this becomes a pretty convenient way to make sure you pick back up from where you left off on whichever project you're working on.