File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,20 @@ def reset(self):
104104
105105 self .cmd ('send-keys' , '-R \; clear-history' )
106106
107- def split_window (self , attach = False ):
107+ def split_window (self , attach = False , vertical = True ):
108108 """Split window at pane and return newly created :class:`Pane`.
109109
110110 :param attach: Attach / select pane after creation.
111111 :type attach: bool
112+ :param vertical: split vertically
113+ :type vertical: bool
112114 :rtype: :class:`Pane`.
113115
114116 """
115117 return self .window .split_window (
116118 target = self .get ('pane_id' ),
117- attach = attach
119+ attach = attach ,
120+ vertical = vertical
118121 )
119122
120123 def set_width (self , width ):
Original file line number Diff line number Diff line change @@ -346,7 +346,8 @@ def split_window(
346346 self ,
347347 target = None ,
348348 start_directory = None ,
349- attach = True
349+ attach = True ,
350+ vertical = True
350351 ):
351352 """Split window and return the created :class:`Pane`.
352353
@@ -372,6 +373,8 @@ def split_window(
372373 :type start_directory: string
373374 :param target: ``target_pane`` to split.
374375 :type target: bool
376+ :param vertical: split vertically
377+ :type vertical: bool
375378
376379 :rtype: :class:`Pane`
377380
@@ -390,6 +393,11 @@ def split_window(
390393 else :
391394 tmux_args += ('-t%s' % self .panes [0 ].get ('pane_id' ),)
392395
396+ if vertical :
397+ tmux_args += ('-v' ,)
398+ else :
399+ tmux_args += ('-h' ,)
400+
393401 tmux_args += (
394402 '-P' , '-F%s' % '' .join (tmux_formats ) # output
395403 )
You can’t perform that action at this time.
0 commit comments