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.

MoreLess about this notice

class libtmux-dotnet

Pane

Represents an immutable pane handle and snapshot.

Source and package
Qualified name
LibTmux.Pane
Namespace
LibTmux
Package
LibTmux
Source
src/LibTmux/Pane.cs
class LibTmux.Pane

Description

Thread-safe: the handle is immutable once constructed and may be shared freely, including as a singleton. Every mutating call answers a new handle rather than changing this one.

What is on here

A tmux pane runs one program and has a good many members of its own. They fall into a few groups:

Reaching a pane
Ask for the pane this process was spawned in. It throws when the environment does not name a pane or tmux no longer has it.
Identity and state
A handle carries what tmux reported when it was made, so reading its title, size, command, or flags is local and never reaches tmux; re-read the pane to see current state. Two handles are equal when they name the same pane on the same server generation. A pane outlives its program only while remain-on-exit is on, and then Dead is true; a dead pane keeps the process ID of the program that exited, and tmux 3.8 reports none, which reads as 0.
Dead panes
Re-read
Sending input
Text is typed into the pane, with or without Enter, and a request can send key names or literal text. A request that sends nothing, or text containing NUL, throws ArgumentException. When the text was sent but Enter failed, the dispatch state is unknown and the whole request must not be retried.
Reading output
Capturing reads the pane at one instant. Reading since a position returns only what the pane printed after it, and the position to pass next time, and a read without a position returns none. Lines a program rewrote in place are reported again when they change.
Since a position
Waiting
A wait ends with a result that says how it ended rather than throwing when time runs out. Text already on screen ends a wait for text at once, and a line the pane wrapped is matched as one line. Sending and then waiting judges only what the pane prints afterwards and discounts the shell's echo of literal text, so waiting for done after typing echo done waits for the command's output. The pattern wait sleeps on the pane's output through an owned control-mode client, and falling back to timed reads needs AllowPollingFallback. Each throws TmuxObjectNotFoundException when tmux no longer has the pane.
A condition
Running a command
Run a shell command in the pane and wait for its exit status and what it printed. The pane must sit at a POSIX shell prompt, a command that outlasts the timeout may keep running, and one already sent when the call is cancelled raises LibTmuxException saying it may have run, so inspect the pane before a retry. The command runs in a subshell, so cd and export do not persist, and it needs tmux 3.4.
Splitting and arranging
Splitting makes a tiled pane beside this one and creating a pane makes a floating one, which needs tmux 3.7. Resizing answers a replacement handle, and tmux clamps a size that does not fit rather than refusing it. Breaking out moves the pane to a window of its own.
Modes and choosers
Copy mode, clock mode, and customize mode put the pane into that mode. The choosers and the finder open in this pane. A popup waits for tmux to close it, so one whose command never exits keeps the call waiting until it is canceled. The pane numbers show on every client, because the command's target names a client.
Restarting and ending
Respawning restarts the pane's command, and tmux refuses a pane that is still running unless the request kills it first. Stopping a pane can stop every other pane in its window instead.
Options and hooks
The pane's options and its hooks are objects of their own: TmuxOptions and TmuxHooks.

Anything tmux can do to a pane that is not here is reachable through ExecuteCommandAsync(), which runs one raw command against this pane.

Properties29

Pane properties
NameTypeDescription
Window Window Gets the window containing this pane, with captured scalar state.
Session Session Gets the session containing this pane.
Server Server Gets the server that owns this pane.
Id PaneId Gets the pane identifier.
Index int Gets the index this pane holds in its window.
Height int Gets the pane height captured with this handle.
Width int Gets the pane width captured with this handle.
Title string? Gets the pane title captured with this handle.
Options TmuxOptions Gets the options of this pane.
Hooks TmuxHooks Gets the hooks of this pane.
AtTop bool Gets whether the pane touches the top of its window.
AtBottom bool Gets whether the pane touches the bottom of its window.
AtLeft bool Gets whether the pane touches the left of its window.
AtRight bool Gets whether the pane touches the right of its window.
Active bool Gets whether the pane is its window's active pane.
CurrentCommand string? Gets the foreground command captured with this pane.
CurrentPath string? Gets the current working directory captured with this pane.
Dead bool Gets whether the pane's program has exited and the pane remains.
DeadStatus int? Gets the exit status of a dead pane's program.
Generation ServerGeneration Gets the server generation captured with this pane.
HistorySize int Gets how many lines have scrolled into the pane's history.
InMode bool Gets whether the pane is in a mode, such as copy mode.
Left int Gets the pane's left offset, in cells, from its window's edge.
ProcessId int Gets the process ID of the program the pane started.
RawFormatFields IReadOnlyDictionary<string, string?> Gets the tmux fields captured when this handle materialized.
StartCommand string? Gets the command the pane started, as tmux prints it, or empty for the default shell.
Synchronized bool Gets whether keys typed into the pane go to every synchronized pane in its window.
Top int Gets the pane's top offset, in cells, from its window's edge.
Tty string? Gets the terminal device the pane's program reads and writes, such as /dev/pts/3.

Members45 members

Common operations35

Other members10

Order: the accessors that walk the hierarchy, the operations the ports share, then the rest.

Guides

task material

Pages that discuss Pane.

Topics

In other ports

task equivalence 22 other ports mapped

Source-verified mappings for A tmux pane. A mapping says these APIs perform the same task. It does not say they share defaults, errors or completion: check each page.

A tmux pane in each port
PortAPIDiffers from C#
C# LibTmux.Pane
Represents an immutable pane handle and snapshot.
This page
Python libtmux.Pane
tmux(1) Pane [pane_manual].
None recorded in the model
Ruby LibTmux::Pane None recorded in the model
Lua libtmux.Pane None recorded in the model
PowerShell LibTmux\Get-TmuxPane
Read panes from a server, session or window.
3 overloads
This cmdlet reads shared .NET LibTmux.Pane objects. Its -Server, -Session, and -Window parameter sets select the scope.
Julia LibTmux.PaneSnapshot 2 overloads
PaneSnapshot holds captured pane data. Actions use its PaneRef; PaneOccurrence adds a window placement in a session.
Erlang #tmux_model:pane{} None recorded in the model
Elixir LibTmux.Pane
An immutable physical pane. It belongs to a window; text may be empty.
Pane is an immutable physical pane observation. It does not send keys or capture text.
Haskell LibTmux.Snapshot.Pane
Detached physical pane. Its window can appear in several session contexts; PaneOccurrence preserves an appearance without duplicating physical identity.
Pane is a detached physical pane. PaneOccurrence keeps the window placement it was seen in, and operations take a generation-bound PaneRef.
Common Lisp libtmux:pane
A physical pane belonging to one captured window.
pane is an immutable captured physical pane.
TypeScript pane.Pane
One pane on one tmux server, as a handle rather than a copy of it.
None recorded in the model
Rust pane.Pane
One tmux pane, as reached through one window link.
None recorded in the model
Go tmux.Pane
Pane is one materialized pane record within a specific winlink. It is normally returned by Server.Snapshot, Server.Pane, or Pane.Refresh. A zero Pane is not a usable tmux target.
None recorded in the model
Java io.github.libtmux.Pane
One tmux pane, as one capture saw it.
readonly
Clojure libtmux.data/panes
Returns captured pane occurrences in a snapshot, session, or window.
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
A tmux pane, with operations for input, output, and layout.
None recorded in the model
Scala io.github.libtmux.scaladsl.Pane
A captured pane occurrence, opaque over the Java handle. Java equality identifies the physical pane; every operation beyond that is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT, STREAM or LIFECYCLE.
2 overloads
F# LibTmux.FSharp.Pane
Reads captured pane fields and starts explicit pane operations.
This F# module reads captured fields and starts explicit operations on the shared .NET LibTmux.Pane type.
C++ libtmux::Pane
One pane, as one listing saw it.
None recorded in the model
Swift Pane
A tmux pane, as it was when the listing was read.
None recorded in the model
OCaml Libtmux.Pane.t None recorded in the model
Perl LibTmux::Pane
Captured pane entity
A physical pane retains its captured graph, without retaining transport.
Raku LibTmux::Model::Pane
Captured pane fields and its local physical-window relationship.
None recorded in the model
Esc
Search in

Type to search.

Reference previewOpen reference