Skip to content

Commit ed26cf0

Browse files
committed
Session: Consolidate duplicate computed property (attached_pane)
1 parent 96bf4d5 commit ed26cf0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/libtmux/session.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ def select_window(self, target_window: t.Union[str, int]) -> "Window":
352352
#
353353
# Computed properties
354354
#
355+
@property
356+
def attached_pane(self) -> t.Optional["Pane"]:
357+
"""Return active :class:`Pane` object."""
358+
return self.active_window.attached_pane
359+
355360
@property
356361
def active_window(self) -> "Window":
357362
"""Return active :class:`Window` object."""
@@ -625,14 +630,6 @@ def kill_window(self, target_window: t.Optional[str] = None) -> None:
625630
if proc.stderr:
626631
raise exc.LibTmuxException(proc.stderr)
627632

628-
#
629-
# Computed properties
630-
#
631-
@property
632-
def attached_pane(self) -> t.Optional["Pane"]:
633-
"""Return active :class:`Pane` object."""
634-
return self.active_window.attached_pane
635-
636633
#
637634
# Dunder
638635
#

0 commit comments

Comments
 (0)