|
15 | 15 | ListCmd = Literal["list-sessions", "list-windows", "list-panes"]
|
16 | 16 | ListExtraArgs = t.Optional[t.Tuple[str]]
|
17 | 17 |
|
18 |
| - from libtmux.common import WindowOptionDict |
| 18 | + from libtmux.common import WindowDict, WindowOptionDict |
19 | 19 | from libtmux.server import Server
|
20 | 20 |
|
21 | 21 | logger = logging.getLogger(__name__)
|
@@ -380,6 +380,25 @@ def attached_window(self) -> "_Window":
|
380 | 380 | if len(self._windows) == 0:
|
381 | 381 | raise exc.LibTmuxException("No Windows")
|
382 | 382 |
|
| 383 | + # |
| 384 | + # Redundant stuff we want to remove |
| 385 | + # |
| 386 | + def _list_windows(self) -> t.List["WindowDict"]: |
| 387 | + return [w.__dict__ for w in self.windows] |
| 388 | + |
| 389 | + @property |
| 390 | + def _windows(self) -> t.List["WindowDict"]: |
| 391 | + """Property / alias to return :meth:`Session._list_windows`.""" |
| 392 | + |
| 393 | + return self._list_windows() |
| 394 | + |
| 395 | + def list_windows(self) -> t.List["_Window"]: |
| 396 | + """Return a list of :class:`Window` from the ``tmux(1)`` session.""" |
| 397 | + return self.windows |
| 398 | + |
| 399 | + #: Was used by TmuxRelationalObject (but that's longer used in this class) |
| 400 | + children = windows |
| 401 | + |
383 | 402 |
|
384 | 403 | @dataclasses.dataclass()
|
385 | 404 | class _Window(Obj):
|
@@ -769,15 +788,12 @@ def kill_window(self) -> None:
|
769 | 788 |
|
770 | 789 | proc = self.cmd(
|
771 | 790 | "kill-window",
|
772 |
| - # '-t:%s' % self.id |
773 | 791 | "-t{}:{}".format(self.session_id, self.window_index),
|
774 | 792 | )
|
775 | 793 |
|
776 | 794 | if proc.stderr:
|
777 | 795 | raise exc.LibTmuxException(proc.stderr)
|
778 | 796 |
|
779 |
| - # self.server._update_windows() |
780 |
| - |
781 | 797 | def move_window(
|
782 | 798 | self, destination: str = "", session: t.Optional[str] = None
|
783 | 799 | ) -> "_Window":
|
|
0 commit comments