Skip to content

Commit 6d68dab

Browse files
committed
Merge pull request #107 from thomasballinger/fix-attached-sessions
Fix Server.attached_sessions return type
2 parents 25bc68b + 75d5d6b commit 6d68dab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tmuxp/server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ def _update_panes(self):
286286
return self
287287

288288
def attached_sessions(self):
289-
"""Return active :class:`Session` object.
289+
"""Return active :class:`Session` objects.
290290
291291
This will not work where multiple tmux sessions are attached.
292292
293-
:rtype: :class:`Server`
293+
:rtype: :py:obj:`list` of :class:`Session`
294294
295295
"""
296296

@@ -307,7 +307,9 @@ def attached_sessions(self):
307307
else:
308308
continue
309309

310-
return attached_sessions or None
310+
return [
311+
Session(server=self, **s) for s in attached_sessions
312+
] or None
311313

312314
def has_session(self, target_session):
313315
"""Return True if session exists. ``$ tmux has-session``.

0 commit comments

Comments
 (0)