Skip to content

Commit e50041c

Browse files
committed
feat: Rename Session.attached_window -> Session.active_window
Deprecate Session.attached_window
1 parent 10c898d commit e50041c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/libtmux/session.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def select_window(self, target_window: t.Union[str, int]) -> "Window":
353353
# Computed properties
354354
#
355355
@property
356-
def attached_window(self) -> "Window":
356+
def active_window(self) -> "Window":
357357
"""Return active :class:`Window` object."""
358358
active_windows = self.windows.filter(window_active="1")
359359

@@ -676,6 +676,24 @@ def name(self) -> t.Optional[str]:
676676
#
677677
# Legacy: Redundant stuff we want to remove
678678
#
679+
@property
680+
def attached_window(self) -> "Window":
681+
"""Return active :class:`Window` object.
682+
683+
Notes
684+
-----
685+
.. deprecated:: 0.31
686+
687+
Deprecated in favor of :meth:`.active_window`.
688+
"""
689+
warnings.warn(
690+
"Session.attached_window() is deprecated in favor of "
691+
+ "Session.active_window()",
692+
category=DeprecationWarning,
693+
stacklevel=2,
694+
)
695+
return self.active_window
696+
679697
def attach_session(self) -> "Session":
680698
"""Return ``$ tmux attach-session`` aka alias: ``$ tmux attach``.
681699

0 commit comments

Comments
 (0)