Attach to a tmux session. When there are multiple sessions, pick one with fzf. When there is only one, attach directly.
tmuxfzf
ta [query]If run from inside tmux, switches the client to the selected session. If run outside, attaches to it.
With no argument, all sessions are listed. If there is only one, it attaches immediately.
query can be:
- A session number (e.g.
0,2) — attaches directly without a list. - An exact session name — attaches directly.
- A substring — if one session matches, attaches directly; if several match, they are listed in fzf.
The fzf list shows the session name (or the active window name for auto-numbered sessions), the active window name, and whether the session is currently attached.
Copy ta somewhere on your PATH and make it executable.
cp ta ~/.local/bin/ta
chmod +x ~/.local/bin/ta