Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

View as Markdown

Module
libtmux
Declared in
Pane
Package
libtmux
Source
src/libtmux/pane.py
Other languages
RubyLuaTypeScriptRustGoJava.NETC++Swift
break_pane ( self , detach : bool = True , window_name : str | None = None ) → Window
method [source]
method [source]
break_pane

Break this pane out into a new window via $ tmux break-pane.

Parameters
  • detach ( bool ) – Do not switch to the new window (-d flag), default True.

  • window_name ( str | None ) – Name for the new window (-n flag).

Returns

Window The newly created window containing the pane.

In other ports Move a pane out into a window of its own

Examples

>>> pane_to_break = window.split(shell='sleep 1m')
>>> new_window = pane_to_break.break_pane(window_name='broken')
>>> new_window.window_name
'broken'
await pane.breakOut("extracted");
use libtmux::{SplitDirection, SplitOptions};
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("broken-out").await?;
let pane = session.panes().await?.remove(0);
let stays = pane.window_id().clone();
let moved = pane.split(SplitOptions::new(SplitDirection::Below)).await?;
let moved = moved.break_out().await?;
// The window it landed in, without listing the server to find it.
assert_ne!(moved.window_id(), &stays);

0 declared, 0 inherited

Esc

Type to search.