Skip to content

Fix Server.attached_sessions return type #107

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

Merged
merged 2 commits into from
Jul 3, 2015
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
8 changes: 5 additions & 3 deletions tmuxp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ def _update_panes(self):
return self

def attached_sessions(self):
"""Return active :class:`Session` object.
"""Return active :class:`Session` objects.

This will not work where multiple tmux sessions are attached.

:rtype: :class:`Server`
:rtype: :py:obj:`list` of :class:`Session`

"""

Expand All @@ -307,7 +307,9 @@ def attached_sessions(self):
else:
continue

return attached_sessions or None
return [
Session(server=self, **s) for s in attached_sessions
] or None

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