Skip to content

chore(Server.attached_sessions): Use .filter() #538

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
Mar 23, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ $ pip install --user --upgrade --pre libtmux

<!-- To maintainers and contributors: Please add notes for the forthcoming version above -->

### Bug fix

- {attr}`Server.attached_sessions` fix for when multiple clients attached, thank you @patrislav1 (#537)

- #538 fix to `QueryList`.

## libtmux 0.35.0 (2024-03-17)

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion src/libtmux/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def attached_sessions(self) -> t.List[Session]:
-------
list of :class:`Session`
"""
return [s for s in self.sessions if s.session_attached != "0"]
return self.sessions.filter(session_attached__noeq="1")

def has_session(self, target_session: str, exact: bool = True) -> bool:
"""Return True if session exists.
Expand Down