Skip to content

Commit

Permalink
Merge pull request #43 from roxit/detached
Browse files Browse the repository at this point in the history
Add an option to load a session without attaching to it.
  • Loading branch information
tony committed Jan 9, 2014
2 parents a82bb39 + 992a50c commit 5de471a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ def load_workspace(config_file, args):
else:
sys.exit('Session created in detached state.')

builder.session.attach_session()
if not args.detached:
builder.session.attach_session()
except exc.TmuxSessionExists as e:
if args.answer_yes or prompt_yes_no('%s Attach?' % e):
if 'TMUX' in os.environ:
Expand Down Expand Up @@ -845,6 +846,14 @@ def get_parser():
)
load.set_defaults(callback=command_load)

load.add_argument(
'-d',
dest='detached',
default=None,
help='Load a session without attaching to it.',
action='store_true'
)

convert = subparsers.add_parser(
'convert',
help='Convert tmuxp config between YAML and JSON format.'
Expand Down

0 comments on commit 5de471a

Please sign in to comment.