The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,640 other followers

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

Posted by jpluimers on 2016/11/16

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: