Quantcast
Channel: SuSE Linux – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 217

tmux attach to named session or create when it doesn’t exist yet – via: How to start tmux with attach if a session exists – Unix & Linux Stack Exchange

$
0
0

In my alias list:

alias "tmux-attach-or-create-main-session=tmux new-session -A -s main"

Via User Wesley Baugh – Unix & Linux Stack Exchange who answered:

If naming your session is okay, then it’s easy to do with the new-session command:

tmux new-session -A -s main

where main is the session name that will be attached to or created if needed.

From man tmux

 The -A flag makes new-session behave like attach-session if session-name already exists; in this case, -D behaves like -d to attach-session.

–jeroen

Source: How to start tmux with attach if a session exists – Unix & Linux Stack Exchange


Filed under: *nix, *nix-tools, Linux, openSuSE, Power User, SuSE Linux, tmux

Viewing all articles
Browse latest Browse all 217

Trending Articles