Skip to content

Commit 10c898d

Browse files
committed
Session.attached_window: Use .filter
1 parent 99109cf commit 10c898d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libtmux/session.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,7 @@ def select_window(self, target_window: t.Union[str, int]) -> "Window":
355355
@property
356356
def attached_window(self) -> "Window":
357357
"""Return active :class:`Window` object."""
358-
active_windows = [
359-
window for window in self.windows if window.window_active == "1"
360-
]
358+
active_windows = self.windows.filter(window_active="1")
361359

362360
if len(active_windows) == 1:
363361
return next(iter(active_windows))

0 commit comments

Comments
 (0)