libtmux Reference MCP Search
On this page

io.github.libtmux.Pane.Pane.split

View as Markdown

Module
io.github.libtmux.Pane
Declared in
Pane
Package
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/Pane.java
Other languages
PythonTypeScriptRustGo.NETC++Swift
split ( ) Pane ( configure : Consumer<SplitSpec.Builder> ) Pane ( spec : SplitSpec ) Pane
methodoverload3 overloads [source]
methodoverload3 overloads [source]
split

Splits this pane in half, putting the new one below it.

Returns

the pane that appeared

Raises
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.