Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux latest

Window.split

Split window on active pane and return the created Pane.

Source and package
Qualified name
libtmux.Window.split
Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Ruby Lua TypeScriptRustGoJavaC#C++SwiftKotlinScala OCaml F# Clojure
split
( 17 parameters ) ( self, target: int | str | None = None, start_directory: StrPath | None = None, attach: bool = False, direction: PaneDirection | None = None, full_window_split: bool | None = None, zoom: bool | None = None, shell: str | None = None, size: str | int | None = None, percentage: int | None = None, environment: dict[str, str] | None = None, empty: bool | None = None, style: str | None = None, active_border_style: str | None = None, inactive_border_style: str | None = None, message: str | None = None, keep: bool | None = None, )
→ Pane
Parameters
  • target (int | str | None) #

  • start_directory (StrPath | None) # – Specifies the working directory in which the new window is created.

  • attach (bool) # – Make new window the current window after creating it, default True.

  • direction (PaneDirection | None) # – Split in direction. If none is specified, assume down.

  • full_window_split (bool | None) # – Split across full window width or height, rather than active pane.

  • zoom (bool | None) # – Expand pane.

  • shell (str | None) # – Execute a command on splitting the window. The pane will close when the command exits. NOTE: When this command exits the pane will close. This feature is useful for long-running processes where the closing of the window upon completion is desired.

  • size (str | int | None) # – Cell/row count to occupy with respect to current window.

  • percentage (int | None) # – Percentage (0-100) of the window to occupy (-p flag). Mutually exclusive with size. added 0.56

  • environment (dict[str, str] | None) # – Environmental variables for new pane. Passthrough to -e.

  • empty (bool | None) # – Create an empty pane with no command (-E flag) instead of spawning the default shell. Requires tmux 3.7+. If used with tmux < 3.7, a warning is issued and the flag is ignored.

  • style (str | None) # – Style for the new pane (-s). Requires tmux 3.7+.

  • active_border_style (str | None) # – Active-pane border style (-S). Requires tmux 3.7+.

  • inactive_border_style (str | None) # – Inactive-pane border style (-R). Requires tmux 3.7+.

  • message (str | None) # – Keep the pane open (until a key is pressed) after exit, showing this remain-on-exit-format message (-m). Requires tmux 3.7+.

  • keep (bool | None) # – Keep the pane open until a key is pressed after exit (-k). Requires tmux 3.7+. These 3.7 flags warn and are ignored below 3.7.

Returns

Pane The newly created pane.

tmux command#

The tmux commands behind split.

tmux C API#

The C declarations in tmux that implement these commands.

Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.

Split a window

  1. 1 cmd_split_window_exec
  2. references → 2 spawn_pane
  3. calls → 3 window_add_pane
  4. calls → 4 window_pane_create

In other ports#

Split a window's active pane

Equivalents of Split a window's active pane in other languages
Language Equivalent
Ruby LibTmux::Window#split
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript window.Window.split
Rust window.Window.split
Go tmux.Window.SplitPane
Java io.github.libtmux.Window.split
Kotlin io.github.libtmux.kotlin.Window.split
Scala io.github.libtmux.scaladsl.Window.split
C# LibTmux.Window.SplitPaneAsync
C++ libtmux::Window::split
Swift Server.splitWindow(_:direction:size:startDirectory:environment:shell:)
OCaml No direct public OCaml equivalent is recorded for this operation.
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure or F#.

Esc

Type to search.

Reference previewOpen reference