Skip to content
Closed
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
15 changes: 14 additions & 1 deletion tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,24 @@ def reattach(session):
reattach(builder.session)
return

session = None
if session_name == 'current':
sessions = t.list_sessions() or []
for s in sessions:
if s.attached == '1' and (answer_yes or click.confirm(
'Reuse session [%s]?' % s.name
)):
session = s
# need to create a new window,
# or the currently-active one will be clobbered
session.new_window()
break

try:
click.echo(
click.style('[Loading] ', fg='green') +
click.style(config_file, fg='blue', bold=True))
builder.build()
builder.build(session)

if 'TMUX' in os.environ: # tmuxp ran from inside tmux
if not detached and (answer_yes or click.confirm(
Expand Down