Skip to content

Commit b6c2e84

Browse files
committed
Fix bug where tmuxp load w/ session already loaded would switch/attach even if no was entered
1 parent bbe44b1 commit b6c2e84

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tmuxp/cli.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,17 @@ def load_workspace(config_file, args):
251251
os.execl(tmux_bin, 'tmux', 'attach-session', '-t', sconfig[
252252
'session_name'])
253253
except exc.TmuxSessionExists as e:
254-
attach_session = prompt_yes_no(e.message + ' Attach?')
254+
if prompt_yes_no(e.message + ' Attach?'):
255255

256-
if 'TMUX' in os.environ:
257-
del os.environ['TMUX']
258-
os.execl(tmux_bin, 'tmux', 'switch-client', '-t',
259-
sconfig['session_name'])
256+
if 'TMUX' in os.environ:
257+
del os.environ['TMUX']
258+
os.execl(tmux_bin, 'tmux', 'switch-client', '-t',
259+
sconfig['session_name'])
260260

261-
if attach_session:
262-
os.execl(tmux_bin, 'tmux', 'attach-session', '-t',
263-
sconfig['session_name'])
261+
if attach_session:
262+
os.execl(tmux_bin, 'tmux', 'attach-session', '-t',
263+
sconfig['session_name'])
264+
return
264265
return
265266

266267

0 commit comments

Comments
 (0)