Attach to a session with the name mysession

sessions

// what it does

The `-t` flag names which session to attach to, so `tmux attach -t mysession` connects to that specific session regardless of which one was used last. All four spellings (`a`, `at`, `attach`, `attach-session`) are equivalent. Reach for this when several sessions are running and you want a particular one by name.

// shell

$ tmux a -t mysession
$ tmux at -t mysession
$ tmux attach -t mysession
$ tmux attach-session -t mysession

// gotcha

Session targets are matched by exact name first, then by prefix, then as an fnmatch pattern — so `-t my` can silently attach to `mysession` if it's the only match, and names are case-sensitive.