File tree Expand file tree Collapse file tree 1 file changed +43
-3
lines changed Expand file tree Collapse file tree 1 file changed +43
-3
lines changed 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