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-rs latest

Pane.break_out

Move this pane out into a window of its own.

Source and package
Qualified name
libtmux::pane::Pane::break_out
Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptGoJavaC#C++Swift Kotlin Scala OCaml F# Clojure
pub async fn break_out(self) -> Result<Self, Error>

Description#

This consumes the handle, because the pane's window changes and any snapshot of its old position is now wrong.

A pane that is already alone in its window is a no-op, not a refusal. tmux relinks the window rather than rejecting the command -- see cmd-break-pane.c, which links the window into the target session and unlinks it from the source when the pane count is one -- so within one session nothing moves and the call still succeeds. The returned handle names the window it is in either way, which is how a caller tells the two apart.

Errors

Returns an error when tmux refuses the command. Being the window's only pane is not one of those, and neither is it a no-op: tmux relinks the window rather than breaking a pane out of it, which moves the window to a free index. The window and pane ids are unchanged, so a Window held across this call keeps its identity and loses its index.

Examples#

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);

tmux command#

The tmux commands behind break_out.

tmux C API#

The C declarations in tmux that implement these commands.

In other ports#

Move a pane out into a window of its own

Equivalents of Move a pane out into a window of its own in other languages
Language Equivalent
Python libtmux.Pane.break_pane
Ruby LibTmux::Pane#break_out
Lua libtmux.Pane:break_out
Erlang tmux_pane:break/4
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript pane.Pane.breakOut
Go tmux.Pane.BreakPane
Java io.github.libtmux.Pane.breakOut
C# LibTmux.Pane.BreakAsync
C++ libtmux::Pane::break_out
Swift Server.breakPane(_:from:named:)
OCaml Libtmux_unix.Client.break_pane
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

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

Esc

Type to search.

Reference previewOpen reference