@@ -85,27 +85,30 @@ def cmd(self, cmd, *args, **kwargs):
85
85
Specifying ``('-t', 'custom-target')`` or ``('-tcustom_target')`` in
86
86
``args`` will override using the object's ``pane_id`` as target.
87
87
88
- :rtype: :class:`Server.cmd`
89
-
88
+ Returns
89
+ -------
90
+ :class:`Server.cmd`
90
91
"""
91
92
if not any (arg .startswith ('-t' ) for arg in args ):
92
93
args = ('-t' , self .get ('pane_id' )) + args
93
94
94
95
return self .server .cmd (cmd , * args , ** kwargs )
95
96
96
97
def send_keys (self , cmd , enter = True , suppress_history = True ):
97
- """``$ tmux send-keys`` to the pane.
98
+ """
99
+ ``$ tmux send-keys`` to the pane.
98
100
99
101
A leading space character is added to cmd to avoid polluting the
100
102
user's history.
101
103
102
- :param cmd: Text or input into pane
103
- :type cmd: str
104
- :param enter: Send enter after sending the input.
105
- :type enter: bool
106
- :param suppress_history: Don't add these keys to the shell history
107
- :type suppress_history: bool
108
-
104
+ Parameters
105
+ ----------
106
+ cmd : str
107
+ Text or input into pane
108
+ enter : bool, optional
109
+ Send enter after sending the input, default True.
110
+ suppress_history : bool, optional
111
+ Don't add these keys to the shell history, default True.
109
112
"""
110
113
prefix = ' ' if suppress_history else ''
111
114
self .cmd ('send-keys' , prefix + cmd )
@@ -123,17 +126,21 @@ def reset(self):
123
126
self .cmd ('send-keys' , '-R \; clear-history' )
124
127
125
128
def split_window (self , attach = False , vertical = True , start_directory = None ):
126
- """Split window at pane and return newly created :class:`Pane`.
127
-
128
- :param attach: Attach / select pane after creation.
129
- :type attach: bool
130
- :param vertical: split vertically
131
- :type vertical: bool
132
- :rtype: :class:`Pane`.
133
- :param start_directory: specifies the working directory in which the
134
- new pane is created.
135
- :type start_directory: str
136
-
129
+ """
130
+ Split window at pane and return newly created :class:`Pane`.
131
+
132
+ Parameters
133
+ ----------
134
+ attach : bool, optional
135
+ Attach / select pane after creation.
136
+ vertical : bool, optional
137
+ split vertically
138
+ start_directory : str, optional
139
+ specifies the working directory in which the new pane is created.
140
+
141
+ Returns
142
+ -------
143
+ :class:`Pane`
137
144
"""
138
145
return self .window .split_window (
139
146
target = self .get ('pane_id' ),
@@ -143,30 +150,50 @@ def split_window(self, attach=False, vertical=True, start_directory=None):
143
150
)
144
151
145
152
def set_width (self , width ):
146
- """Set width of pane.
147
-
148
- :param width: pane width, in cells.
149
- :type width: int
153
+ """
154
+ Set width of pane.
150
155
156
+ Parameters
157
+ ----------
158
+ width : int
159
+ pane width, in cells
151
160
"""
152
161
self .resize_pane (width = width )
153
162
154
163
def set_height (self , height ):
155
- """Set height of pane.
156
-
157
- :param height: pane height, in cells.
158
- :type height: int
164
+ """
165
+ Set height of pane.
159
166
167
+ Parameters
168
+ ----------
169
+ height : int
170
+ height of pain, in cells
160
171
"""
161
172
self .resize_pane (height = height )
162
173
163
174
def resize_pane (self , * args , ** kwargs ):
164
- """``$ tmux resize-pane`` of pane and return ``self``.
165
-
166
- :param target_pane: ``target_pane``, or ``-U``,``-D``, ``-L``, ``-R``.
167
- :type target_pane: str
168
- :rtype: :class:`Pane`
169
-
175
+ """
176
+ ``$ tmux resize-pane`` of pane and return ``self``.
177
+
178
+ Parameters
179
+ ----------
180
+ target_pane : str
181
+ ``target_pane``, or ``-U``,``-D``, ``-L``, ``-R``.
182
+
183
+ Optional Parameters
184
+ -------------------
185
+ height : int
186
+ ``resize-pane -y`` dimensions
187
+ width : int
188
+ ``resize-pane -x`` dimensions
189
+
190
+ Returns
191
+ -------
192
+ :class:`Pane`
193
+
194
+ Raises
195
+ ------
196
+ exc.LibTmuxException
170
197
"""
171
198
172
199
if 'height' in kwargs :
@@ -183,22 +210,24 @@ def resize_pane(self, *args, **kwargs):
183
210
return self
184
211
185
212
def enter (self ):
186
- """Send carriage return to pane.
213
+ """
214
+ Send carriage return to pane.
187
215
188
216
``$ tmux send-keys`` send Enter to the pane.
189
-
190
217
"""
191
218
self .cmd ('send-keys' , 'Enter' )
192
219
193
220
def select_pane (self ):
194
- """Select pane. Return ``self``.
221
+ """
222
+ Select pane. Return ``self``.
195
223
196
224
To select a window object asynchrously. If a ``pane`` object exists
197
225
and is no longer longer the current window, ``w.select_pane()``
198
226
will make ``p`` the current pane.
199
227
200
- :rtype: :class:`pane`
201
-
228
+ Returns
229
+ -------
230
+ :class:`pane`
202
231
"""
203
232
return self .window .select_pane (self .get ('pane_id' ))
204
233
0 commit comments