@@ -355,7 +355,7 @@ def select_window(self) -> "Window":
355
355
"""
356
356
return self .session .select_window (self .index )
357
357
358
- def select_pane (self , target_pane : str ) -> Pane :
358
+ def select_pane (self , target_pane : str ) -> t . Optional [ Pane ] :
359
359
"""
360
360
Return selected :class:`Pane` through ``$ tmux select-pane``.
361
361
@@ -379,7 +379,7 @@ def select_pane(self, target_pane: str) -> Pane:
379
379
380
380
return self .attached_pane
381
381
382
- def last_pane (self ) -> Pane :
382
+ def last_pane (self ) -> t . Optional [ Pane ] :
383
383
"""Return last pane."""
384
384
return self .select_pane ("-l" )
385
385
@@ -492,7 +492,7 @@ def split_window(
492
492
return Pane (window = self , ** pane )
493
493
494
494
@property
495
- def attached_pane (self ) -> Pane :
495
+ def attached_pane (self ) -> t . Optional [ Pane ] :
496
496
"""
497
497
Return the attached :class:`Pane`.
498
498
@@ -505,10 +505,6 @@ def attached_pane(self) -> Pane:
505
505
# for now pane_active is a unicode
506
506
if pane .get ("pane_active" ) == "1" :
507
507
return Pane (window = self , ** pane )
508
- else :
509
- continue
510
-
511
- return []
512
508
513
509
def _list_panes (self ) -> t .List [PaneDict ]:
514
510
panes = self .server ._update_panes ()._panes
0 commit comments