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