File tree Expand file tree Collapse file tree 3 files changed +46
-6
lines changed Expand file tree Collapse file tree 3 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ Split window (create a new pane):
140
140
``` python
141
141
>> > pane = window.split_window()
142
142
>> > pane = window.split_window(attach = False )
143
- >> > pane.select_pane ()
143
+ >> > pane.select ()
144
144
Pane(% 3 Window(@ 1 1 :... , Session($ 1 ... )))
145
145
>> > window = session.new_window(attach = False , window_name = " test" )
146
146
>> > window
Original file line number Diff line number Diff line change @@ -311,14 +311,14 @@ For one, arguments such as `attach=False` can be omittted.
311
311
312
312
This gives you the {class}` Pane ` along with moving the cursor to a new window. You
313
313
can also use the ` .select_* ` available on the object, in this case the pane has
314
- {meth}` Pane.select_pane () ` .
314
+ {meth}` Pane.select () ` .
315
315
316
316
``` python
317
317
>> > pane = window.split_window(attach = False )
318
318
```
319
319
320
320
``` python
321
- >> > pane.select_pane ()
321
+ >> > pane.select ()
322
322
Pane(% 1 Window(@ 1 ... :... , Session($ 1 ... )))
323
323
```
324
324
Original file line number Diff line number Diff line change @@ -416,13 +416,53 @@ def kill(
416
416
additional scoped window info.
417
417
"""
418
418
419
+ def select (self ) -> "Pane" :
420
+ """Select pane.
421
+
422
+ Examples
423
+ --------
424
+ >>> pane = window.attached_pane
425
+ >>> new_pane = window.split_window()
426
+ >>> pane.refresh()
427
+ >>> active_panes = [p for p in window.panes if p.pane_active == '1']
428
+
429
+ >>> pane in active_panes
430
+ True
431
+ >>> new_pane in active_panes
432
+ False
433
+
434
+ >>> new_pane.pane_active == '1'
435
+ False
436
+
437
+ >>> new_pane.select()
438
+ Pane(...)
439
+
440
+ >>> new_pane.pane_active == '1'
441
+ True
442
+ """
443
+ proc = self .cmd ("select-pane" )
444
+
445
+ if proc .stderr :
446
+ raise exc .LibTmuxException (proc .stderr )
447
+
448
+ self .refresh ()
449
+
450
+ return self
451
+
419
452
def select_pane (self ) -> "Pane" :
420
453
"""Select pane.
421
454
422
- To select a window object asynchrously. If a ``pane`` object exists
423
- and is no longer longer the current window, ``w.select_pane()``
424
- will make ``p`` the current pane.
455
+ Notes
456
+ -----
457
+ .. deprecated:: 0.30
458
+
459
+ Deprecated in favor of :meth:`.select()`.
425
460
"""
461
+ warnings .warn (
462
+ "Pane.select_pane() is deprecated in favor of Pane.select()" ,
463
+ category = DeprecationWarning ,
464
+ stacklevel = 2 ,
465
+ )
426
466
assert isinstance (self .pane_id , str )
427
467
pane = self .window .select_pane (self .pane_id )
428
468
if pane is None :
You can’t perform that action at this time.
0 commit comments