Skip to content

Commit 976bbbe

Browse files
committed
tests(doctests): Window example
1 parent 16d2441 commit 976bbbe

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

libtmux/window.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,32 @@ class Window(TmuxMappingObject, TmuxRelationalObject["Pane", "PaneDict"]):
3939
----------
4040
session : :class:`Session`
4141
42+
Examples
43+
--------
44+
>>> window = session.new_window('My project')
45+
46+
>>> window
47+
Window(@... ...:My project, Session($... ...))
48+
49+
Windows have panes:
50+
51+
>>> window.panes
52+
[Pane(...)]
53+
54+
>>> window.attached_pane
55+
Pane(...)
56+
57+
Relations moving up:
58+
59+
>>> window.session
60+
Session(...)
61+
62+
>>> window == session.attached_window
63+
True
64+
65+
>>> window in session.windows
66+
True
67+
4268
References
4369
----------
4470
.. [window_manual] tmux window. openbsd manpage for TMUX(1).

0 commit comments

Comments
 (0)