Pane
Represents an immutable pane handle and snapshot.
Source and package
- Qualified name
-
LibTmux. Pane - Namespace
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux/Pane.cs
-
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-exitis on, and thenDeadis true; a dead pane keeps the process ID of the program that exited, and tmux 3.8 reports none, which reads as 0. - IdentityDead panesRawRe-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. - TextPaste
- 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 positionPipe
- 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
doneafter typingecho donewaits 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 needsAllowPollingFallback. Each throwsTmuxObjectNotFoundExceptionwhen tmux no longer has the pane. - Send, then waitA 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
LibTmuxExceptionsaying it may have run, so inspect the pane before a retry. The command runs in a subshell, socdandexportdo 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.
- FocusTitle
- 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:
TmuxOptionsandTmuxHooks.
Anything tmux can do to a pane that is not here is reachable through
ExecuteCommandAsync(), which runs one raw command against this pane.
Properties29
| Name | Type | Description |
|---|---|---|
| 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 | Pane | 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 | Tmux | Gets the options of this pane. |
| Hooks | Tmux | 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 | Server | 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 | IRead | 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
- CaptureAsync Reads the pane's contents.
- SendKeysAsync Sends keys to the pane.
- SplitAsync Splits this pane.
- KillAsync Stops this pane.
- RespawnAsync Restarts the command running in this pane.
- SelectAsync Selects this pane.
- ResizeAsync Resizes this pane.
- BreakAsync Moves this pane out into a window of its own.
- SetTitleAsync Sets this pane's title.
- SwapAsync Swaps this pane with another.
- ClearHistoryAsync Drops the pane's scrollback history.
- PasteBufferAsync Pastes a tmux buffer into the pane.
- JoinAsync Joins this pane into another window.
- PipeAsync Pipes the pane's input or output through a command.
- EnterCopyModeAsync Puts the pane into copy mode.
- RefreshAsync Re-reads this pane from tmux.
- MoveAsync Moves this pane to another position.
- SendPrefixAsync Sends the configured prefix key to the pane.
- DisplayMessageAsync Shows a message on the client viewing this pane.
- EnterClockModeAsync Puts the pane into clock mode.
- FindWindowAsync Opens the window finder in this pane.
- DisplayPopupAsync Shows a popup over the client viewing this pane.
- SetHeightAsync Sets this pane's height.
- SetWidthAsync Sets this pane's width.
- EnterCustomizeModeAsync Puts the pane into customize mode.
- ChooseTreeAsync Opens the session tree chooser in this pane.
- ChooseBufferAsync Opens the buffer chooser in this pane.
- ResetAsync Resets the pane's terminal state and drops its history.
- ChooseClientAsync Opens the client chooser in this pane.
- ClearAsync Clears the pane by running the shell's reset.
- EnterAsync Presses Enter in the pane.
- SendTextAsync Types text into the pane.
- Equals
- FromEnvironmentAsync Returns the pane this process was spawned in.
- WaitForTextAsync Waits until the pane shows literal text.
Other members10
- CaptureToBufferAsync Captures the pane's contents into a tmux buffer.
- CreatePaneAsync Creates a floating pane against this one.
- DisplayPaneNumbersAsync Shows the pane numbers on every client.
- ExecuteCommandAsync Executes one raw tmux command against this pane.
- GetHashCode
- ReadOutputSinceAsync Reads what the pane has printed since a position, and where this read finished.
- RunAsync Runs a shell command in the pane and waits for its exit status.
- SendKeysAndWaitAsync Sends keys to the pane and waits for what it prints in response.
- SendTextAndWaitAsync Types a line, presses Enter, and waits for a later line to contain the text.
- WaitUntilAsync Waits until a condition holds over the rows the pane shows.
No members of Pane match . The filter searches only this type. Search the whole API.
Order: the accessors that walk the hierarchy, the operations the ports share, then the rest.
Guides
task materialPages that discuss Pane.
- Concepts
- Guides
- Topics
In other ports
task equivalence 22 other ports mappedSource-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.
| Port | API | Differs from C# |
|---|---|---|
| C# | Lib Represents an immutable pane handle and snapshot. | This page |
| Python | libtmux tmux(1) Pane [pane_manual]. | None recorded in the model |
| Ruby | Lib | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| PowerShell | Lib 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 | Lib | 2 overloads PaneSnapshot holds captured pane data. Actions use its PaneRef; PaneOccurrence adds a window placement in a session. |
| Erlang | #tmux | None recorded in the model |
| Elixir | Lib 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 | Lib 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: A physical pane belonging to one captured window. | pane is an immutable captured physical pane. |
| TypeScript | pane One pane on one tmux server, as a handle rather than a copy of it. | None recorded in the model |
| Rust | pane One tmux pane, as reached through one window link. | None recorded in the model |
| Go | tmux 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 One tmux pane, as one capture saw it. | readonly |
| Clojure | libtmux 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 A tmux pane, with operations for input, output, and layout. | None recorded in the model |
| Scala | io 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# | Lib 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:: 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 | None recorded in the model |
| Perl | Lib Captured pane entity | A physical pane retains its captured graph, without retaining transport. |
| Raku | Lib Captured pane fields and its local physical-window relationship. | None recorded in the model |