Skip to content

Commit 992a50c

Browse files
committed
Add an option to load a session without attaching to it.
1 parent a82bb39 commit 992a50c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tmuxp/cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ def load_workspace(config_file, args):
290290
else:
291291
sys.exit('Session created in detached state.')
292292

293-
builder.session.attach_session()
293+
if not args.detached:
294+
builder.session.attach_session()
294295
except exc.TmuxSessionExists as e:
295296
if args.answer_yes or prompt_yes_no('%s Attach?' % e):
296297
if 'TMUX' in os.environ:
@@ -845,6 +846,14 @@ def get_parser():
845846
)
846847
load.set_defaults(callback=command_load)
847848

849+
load.add_argument(
850+
'-d',
851+
dest='detached',
852+
default=None,
853+
help='Load a session without attaching to it.',
854+
action='store_true'
855+
)
856+
848857
convert = subparsers.add_parser(
849858
'convert',
850859
help='Convert tmuxp config between YAML and JSON format.'

0 commit comments

Comments
 (0)