Skip to content

Commit e5ce64c

Browse files
committed
feat: Rename Window.attached_pane -> Window.active_pane
Deprecate Window.attached_pane
1 parent 61a94d0 commit e5ce64c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/libtmux/window.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ def select(self) -> "Window":
728728
# Computed properties
729729
#
730730
@property
731-
def attached_pane(self) -> t.Optional["Pane"]:
731+
def active_pane(self) -> t.Optional["Pane"]:
732732
"""Return attached :class:`Pane`."""
733733
panes = self.panes.filter(pane_active="1")
734734
if len(panes) > 0:
@@ -820,6 +820,21 @@ def width(self) -> t.Optional[str]:
820820
#
821821
# Legacy: Redundant stuff we want to remove
822822
#
823+
@property
824+
def attached_pane(self) -> t.Optional["Pane"]:
825+
"""Return attached :class:`Pane`.
826+
827+
Notes
828+
-----
829+
.. deprecated:: 0.30
830+
831+
Deprecated in favor of :meth:`.active_pane`.
832+
"""
833+
panes = self.panes.filter(pane_active="1")
834+
if len(panes) > 0:
835+
return panes[0]
836+
return None
837+
823838
def select_window(self) -> "Window":
824839
"""Select window.
825840

0 commit comments

Comments
 (0)