File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -636,10 +636,6 @@ def new_window(
636636 if window_name is not None and isinstance (window_name , str ):
637637 window_args += ("-n" , window_name )
638638
639- if window_index is not None :
640- # empty string for window_index will use the first one available
641- window_args += (f"-t{ self .session_id } :{ window_index } " ,)
642-
643639 if environment :
644640 if has_gte_version ("3.0" ):
645641 for k , v in environment .items ():
@@ -664,6 +660,9 @@ def new_window(
664660 logger .warning (
665661 "Window target ignored, requires tmux 3.1 or newer." ,
666662 )
663+ elif window_index is not None :
664+ # empty string for window_index will use the first one available
665+ window_args += (f"-t{ self .session_id } :{ window_index } " ,)
667666
668667 if window_shell :
669668 window_args += (window_shell ,)
You can’t perform that action at this time.
0 commit comments