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.

struct libtmux-rs latest

Pane

One tmux pane, as reached through one window link.

Source and package
Qualified name
libtmux::pane::Pane
Module
pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
Other languages
Perlclass ErlangPowerShellcmdlet Juliastruct Elixirstruct Haskell Common Lispclass PythonRubyLuaTypeScriptGoJavaC#C++SwiftKotlinScalaOCamlF#module Clojurefunction
struct pane.Pane

Description#

A pane belongs to exactly one window, but that window can be linked into several sessions. The handle retains the link it was discovered through so traversal back up the hierarchy lands where the caller came from.

Examples#

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
let pane = window.active_pane().await?.expect("a window has a pane");
pane.send_line("echo hello").await?;
// Capture returns `TmuxText`, because a pane can print any bytes.
let lines = pane.capture().await?;
assert!(!lines.is_empty());
guard.shutdown().await?;

Members73#

Parent objects2#

  • window method Return the window that contains this pane.
  • session method Return the session this pane was reached through.

Common operations62#

  • capture method Capture the pane's visible contents, one entry per line.
  • send_keys method Send keys to the pane as if typed.
  • split method Split this pane, putting a new one beside it.
  • kill method Kill the pane.
  • respawn method Restart the pane's command in place.
  • select method Make this pane active in its window.
  • resize method Resize the pane to an exact size in cells.
  • id method Return the tmux pane identity.
  • index method Return the pane's index within its window.
  • break_out method Move this pane out into a window of its own.
  • set_title method Set the pane's title.
  • height method Return the pane height in cells.
  • width method Return the pane width in cells.
  • title method Return the pane title.
  • is_active method Report whether this pane is the active one in its window.
  • current_command method Return the command currently running in the pane.
  • swap_with method Swap this pane's position with another.
  • clear_history method Clear the pane's scrollback history.
  • paste_buffer method Paste a buffer's contents into the pane.
  • options method Read every option set on this pane, decoded by its declared kind.
  • pipe method Pipe the pane's output to a shell command.
  • set_option method Set one option to text, unchecked.
  • unset_option method Remove one option, restoring whatever it inherits.
  • current_path method Return the pane's working directory.
  • copy_mode method Enter copy mode.
  • typed_option method Read one option, decoded according to what tmux declares about it.
  • pid method Return the process id of the pane's foreground process.
  • window_id method Return the window that contains this pane.
  • set_hook method Set one hook to a tmux command.
  • unset_hook method Remove one hook.
  • refresh method Replace this handle's snapshot with the pane's current state.
  • is_at_top method Report whether the pane touches the top edge of its window.
  • is_at_bottom method Report whether the pane touches the bottom edge of its window.
  • is_at_left method Report whether the pane touches the left edge of its window.
  • is_at_right method Report whether the pane touches the right edge of its window.
  • display method Show a message on the clients viewing this pane's window.
  • is_dead method Report whether the pane's process has exited while the pane remains.
  • send_prefix method Send the configured prefix key to the pane.
  • cmd method Run a raw tmux command against this pane.
  • tty method Return the pane's controlling terminal.
  • session_id method Return the session this handle reached the pane through.
  • clock_mode method Show the clock in this pane.
  • is_in_mode method Report whether the pane is in copy mode or another pane mode.
  • send_key_names method Send tmux key names, such as C-c or Enter.
  • send_line method Send literal text followed by Enter as one dispatch.
  • append_option method Append to one option rather than replacing it.
  • from_env method Find the pane this process is running in.
  • hook method Read one hook's commands, or None when it holds nothing.
  • option_names method List the option names set at this pane's scope.
  • capture_lines method Capture with the per-line flags tmux records, marking shell prompts.
  • capture_with method Read the pane's contents, choosing how much and in what form.
  • format method Expand a tmux format string in this pane's context.
  • get method Read one field of this pane's snapshot, named by the handle that filters it.
  • is_piped method Report whether tmux is copying this pane's output to a command.
  • join_into method Move this pane into another window, beside a pane already there.
  • resize_by method Move one edge of the pane by a number of cells.
  • set_typed_option method Set one option to a typed value, checked before it is sent.
  • stream_output method Watch what this pane writes, as it writes it.
  • toggle_zoom method Zoom the pane to fill its window, or restore it if it already fills it.
  • wait_for_quiet method Wait until this pane stops producing output for quiet_for.
  • wait_for_text method Wait until this pane's output contains needle.
  • wait_until method Wait until settled holds for this pane's captured lines.

Other members9#

  • exit_mode method Leave copy mode, or any other mode the pane is in.
  • from_env_value method Find a pane from an explicit TMUX_PANE value.
  • is_input_disabled method Report whether tmux has disabled input for this pane.
  • is_synchronized method Report whether this pane has synchronized input enabled.
  • left method Return the pane's left edge, in cells from its window's own left edge.
  • refreshed method Return a new handle holding the pane's current state.
  • stream_output_with_limits method Like Self::stream_output(), with explicit frame budgets.
  • top method Return the pane's top edge, in cells from its window's own top edge.
  • window_index method Return the window index for the session through which this pane was reached.

Guides#

Pages that discuss Pane.

Topics

In other ports#

A tmux pane

Equivalents of A tmux pane in other languages
Language Equivalent
Python libtmux.Pane
Ruby LibTmux::Pane
Lua libtmux.Pane
PowerShell LibTmux\Get-TmuxPane This cmdlet reads shared .NET LibTmux.Pane objects. Its -Server, -Session, and -Window parameter sets select the scope.
Julia LibTmux.PaneSnapshot PaneSnapshot holds captured pane data. Actions use its PaneRef; PaneOccurrence adds a window placement in a session.
Erlang #tmux_model:pane{}
Elixir LibTmux.Pane Pane is an immutable physical pane observation. It does not send keys or capture text.
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Common Lisp libtmux:pane pane is an immutable captured physical pane.
TypeScript pane.Pane
Go tmux.Pane
Java io.github.libtmux.Pane
Clojure libtmux.data/panes Traverses captured pane maps without I/O. Use keyword lookup for scalar observations and the preserved :tmux/ref for effects.
Kotlin io.github.libtmux.kotlin.Pane
Scala io.github.libtmux.scaladsl.Pane
C# LibTmux.Pane
F# LibTmux.FSharp.Pane This F# module reads captured fields and starts explicit operations on the shared .NET LibTmux.Pane type.
C++ libtmux::Pane
Swift Pane
OCaml Libtmux.Pane.t
Perl LibTmux::Pane A physical pane retains its captured graph, without retaining transport.
Esc

Type to search.

Reference previewOpen reference