Re:Awesome Tmux
by seanhunter on Tuesday September 04, 2018 @09:35AM
(#17908906)
I always start tmux using in a shell function like this
tms () {
session_name="${1:-sean}"
tmux new-session -A -s "${session_name}"
}
What that does is create a new session or attach to one if it exists. This makes it really easy to detach a session or to log into the same session in multiple windows or whatever.
I can pass a name for the session but if I don't it defaults to my name (so when I'm on a multi-user box my session doesn't clash with other people's). This makes it easy to have separate "work" and "personal" sessions or whatever.
I think for "tmux new-session -A" to work you need a reasonably recent tmux but anything from the last couple of years or so should work.
I can pass a name for the session but if I don't it defaults to my name (so when I'm on a multi-user box my session doesn't clash with other people's). This makes it easy to have separate "work" and "personal" sessions or whatever.
I think for "tmux new-session -A" to work you need a reasonably recent tmux but anything from the last couple of years or so should work.