8000 Add an option to load a session without attaching to it. by roxit · Pull Request #43 · tmux-python/tmuxp · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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