15
15
from libtmux .common import has_gte_version , tmux_cmd
16
16
from libtmux .constants import (
17
17
RESIZE_ADJUSTMENT_DIRECTION_FLAG_MAP ,
18
+ PaneDirection ,
18
19
ResizeAdjustmentDirection ,
19
20
WindowDirection ,
20
21
)
@@ -201,7 +202,8 @@ def split(
201
202
target : t .Optional [t .Union [int , str ]] = None ,
202
203
start_directory : t .Optional [str ] = None ,
203
204
attach : bool = False ,
204
- vertical : bool = True ,
205
+ direction : t .Optional [PaneDirection ] = None ,
206
+ full_window_split : t .Optional [bool ] = None ,
205
207
shell : t .Optional [str ] = None ,
206
208
size : t .Optional [t .Union [str , int ]] = None ,
207
209
environment : t .Optional [t .Dict [str , str ]] = None ,
@@ -215,8 +217,10 @@ def split(
215
217
True.
216
218
start_directory : str, optional
217
219
specifies the working directory in which the new window is created.
218
- vertical : str
219
- split vertically
220
+ direction : PaneDirection, optional
221
+ split in direction. If none is specified, assume down.
222
+ full_window_split: bool, optional
223
+ split across full window width or height, rather than active pane.
220
224
shell : str, optional
221
225
execute a command on splitting the window. The pane will close
222
226
when the command exits.
@@ -228,31 +232,13 @@ def split(
228
232
Cell/row or percentage to occupy with respect to current window.
229
233
environment: dict, optional
230
234
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
231
-
232
- Notes
233
- -----
234
- :term:`tmux(1)` will move window to the new pane if the
235
- ``split-window`` target is off screen. tmux handles the ``-d`` the
236
- same way as ``new-window`` and ``attach`` in
237
- :class:`Session.new_window`.
238
-
239
- By default, this will make the window the pane is created in
240
- active. To remain on the same window and split the pane in another
241
- target window, pass in ``attach=False``.
242
-
243
- .. versionchanged:: 0.28.0
244
-
245
- ``attach`` default changed from ``True`` to ``False``.
246
-
247
- .. deprecated:: 0.28.0
248
-
249
- ``percent=25`` deprecated in favor of ``size="25%"``.
250
235
"""
251
236
active_pane = self .active_pane or self .panes [0 ]
252
237
return active_pane .split (
253
238
start_directory = start_directory ,
254
239
attach = attach ,
255
- vertical = vertical ,
240
+ direction = direction ,
241
+ full_window_split = full_window_split ,
256
242
shell = shell ,
257
243
size = size ,
258
244
environment = environment ,
@@ -863,7 +849,7 @@ def split_window(
863
849
target = target ,
864
850
start_directory = start_directory ,
865
851
attach = attach ,
866
- vertical = vertical ,
852
+ direction = PaneDirection . Below if vertical else PaneDirection . Right ,
867
853
shell = shell ,
868
854
size = size ,
869
855
environment = environment ,
0 commit comments