Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to load a session without attaching to it. #43

Merged
merged 1 commit into from
Jan 9, 2014
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