From 992a50c71187f676249e8eae9f549a19dc37d91d Mon Sep 17 00:00:00 2001 From: Shanshi Shi Date: Thu, 9 Jan 2014 13:17:59 +0800 Subject: [PATCH] Add an option to load a session without attaching to it. --- tmuxp/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 78db174657..d25e6fe905 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -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: @@ -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.'