libtmux Reference MCP Search
On this page

libtmux::Window::split

View as Markdown

Module
libtmux
Declared in
Window
Package
libtmux-cxx
Source
include/libtmux/entities.hpp
Other languages
PythonTypeScriptRustGoJava.NETSwift
split ( ) expected< Pane, CommandFailure > ( options : SplitOptions ) expected< Pane, CommandFailure >
methodreadonlyoverload2 overloads [source]
methodreadonlyoverload2 overloads [source]
split
In other languages Split a pane in two

Examples

>>> (pane.at_left, pane.at_right,
...  pane.at_top, pane.at_bottom)
(True, True,
True, True)
>>> new_pane = pane.split()
>>> (new_pane.at_left, new_pane.at_right,
...  new_pane.at_top, new_pane.at_bottom)
(True, True,
False, True)
>>> right_pane = pane.split(direction=PaneDirection.Right)
>>> (right_pane.at_left, right_pane.at_right,
...  right_pane.at_top, right_pane.at_bottom)
(False, True,
True, False)
>>> left_pane = pane.split(direction=PaneDirection.Left)
>>> (left_pane.at_left, left_pane.at_right,
...  left_pane.at_top, left_pane.at_bottom)
(True, False,
True, False)
>>> top_pane = pane.split(direction=PaneDirection.Above)
>>> (top_pane.at_left, top_pane.at_right,
...  top_pane.at_top, top_pane.at_bottom)
(False, False,
True, False)
>>> pane = session.new_window().active_pane
>>> top_pane = pane.split(direction=PaneDirection.Above, full_window_split=True)
>>> (top_pane.at_left, top_pane.at_right,
...  top_pane.at_top, top_pane.at_bottom)
(True, True,
True, False)
>>> bottom_pane = pane.split(
... direction=PaneDirection.Below,
... full_window_split=True)
>>> (bottom_pane.at_left, bottom_pane.at_right,
...  bottom_pane.at_top, bottom_pane.at_bottom)
(True, True,
False, True)
const created = await pane.split({ vertical: true });
created.id;
use libtmux::{PaneSize, SplitDirection, SplitOptions};

let session = server.new_session("split-from-pane").await?;
let pane = session.panes().await?.remove(0);

let above = pane
    .split(
        SplitOptions::new(SplitDirection::Above)
            .size(PaneSize::Percent(30))
            .command("sleep 300"),
    )
    .await?;

assert_ne!(above.id(), pane.id());
assert_eq!(above.window_id(), pane.window_id());

0 declared, 0 inherited

Esc

Type to search.