Skip to content

Commit 5640bf0

Browse files
committed
Fix has_session for tmux 2.1
The output for the server not existing has changed since last released. See also: tmux/tmux@7a72eff
1 parent 2d25a34 commit 5640bf0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tmuxp/server.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,16 @@ def has_session(self, target_session):
321321

322322
proc = self.cmd('has-session', '-t%s' % target_session)
323323

324-
if 'failed to connect to server' in proc.stdout:
324+
if proc.stdout == []:
325+
return True
326+
if any(
327+
x in proc.stdout for x in
328+
['failed to connect to server', 'error connecting to']
329+
):
325330
return False
326331
elif 'no server running' in proc.stdout: # tmux 2.0
327332
return False
328-
elif 'can\'t find session' in proc.stdout: # tmux 2.1
333+
elif 'can\'t find session' in proc.stdout: # tmux 2.1
329334
return False
330335
elif 'session not found' in proc.stdout:
331336
return False

0 commit comments

Comments
 (0)