@@ -36,6 +36,20 @@ class Pane(TmuxMappingObject):
36
36
----------
37
37
window : :class:`Window`
38
38
39
+ Examples
40
+ --------
41
+ >>> pane
42
+ Pane(%1 Window(@1 1:...sh, Session($1 ...)))
43
+
44
+ >>> pane in window.panes
45
+ True
46
+
47
+ >>> pane.window
48
+ Window(@1 1:...sh, Session($1 ...))
49
+
50
+ >>> pane.session
51
+ Session($1 ...)
52
+
39
53
Notes
40
54
-----
41
55
@@ -119,8 +133,7 @@ def send_keys(
119
133
suppress_history : t .Optional [bool ] = True ,
120
134
literal : t .Optional [bool ] = False ,
121
135
) -> None :
122
- """
123
- ``$ tmux send-keys`` to the pane.
136
+ r"""``$ tmux send-keys`` to the pane.
124
137
125
138
A leading space character is added to cmd to avoid polluting the
126
139
user's history.
@@ -135,6 +148,22 @@ def send_keys(
135
148
Don't add these keys to the shell history, default True.
136
149
literal : bool, optional
137
150
Send keys literally, default True.
151
+
152
+ Examples
153
+ --------
154
+ >>> pane = window.split_window(shell='sh')
155
+ >>> pane.capture_pane()
156
+ ['$']
157
+
158
+ >>> pane.send_keys('echo "Hello world"', suppress_history=False, enter=True)
159
+
160
+ >>> pane.capture_pane()
161
+ ['$ echo "Hello world"', 'Hello world', '$']
162
+
163
+ >>> print('\n'.join(pane.capture_pane())) # doctest: +NORMALIZE_WHITESPACE
164
+ $ echo "Hello world"
165
+ Hello world
166
+ $
138
167
"""
139
168
prefix = " " if suppress_history else ""
140
169
0 commit comments