# LibTmux.Pane

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/entities.ex#L488
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-pane/

An immutable physical pane with explicit actions. It belongs to a window; text may be empty.

## What is on here

A Pane is a value captured in a `LibTmux.Snapshot`. Actions take a
`LibTmux.Ref` and a Server or Control connection. Start with these groups:

**Finding the pane.** Select panes from a captured snapshot, or look one up by
its exact ID. Neither contacts tmux. An ID that was not captured returns
`{:error, error}` with kind `:not_found`. Turn the pane into a reference tied
to the server incarnation that supplied it, ready for an action.

- Select: `LibTmux.Snapshot.panes/1`
- By ID: `LibTmux.Snapshot.fetch/3`
- Reference: `LibTmux.Ref.from_observation/1`

**Splitting.** Split the pane and get the new pane's ID in the completed value.
A qualified Control connection also returns a bound reference; one-shot
execution returns `ref: nil`. The defaults are a vertical, detached split at
half size; options set the axis, size, directory and command.

- Split: `split/3`
- Raise on failure: `split!/3`

**Resizing.** Request an exact pane width or height in cells through either
transport. tmux adjusts adjacent panes to fit the window.

- Resize: `resize/3`
- Raise on failure: `resize!/3`

**Sending input.** Send literal bytes, up to 995 of them, without interpreting
key names, or send named keys such as `"Enter"` and `"C-c"`. An unknown key
name is rejected. Acknowledgement does not prove the program consumed the
input.

- Literal bytes: `send_text/4`, `send_text!/4`
- Named keys: `send_keys/4`, `send_keys!/4`

**Reading the screen.** Capture the rendered screen through one-shot
execution; a Control connection returns `unsupported_transport`. Output over
the byte limit is an error, never a partial screen. This reads screen state,
not the program's original output stream.

- Capture: `capture/3`
- Raise on failure: `capture!/3`
- Wait for literal text: `wait_for_text/4`, `wait_for_text!/4`

**Killing.** Kill the pane through a Server. A Control connection returns
`unsupported_transport`. Killing the last pane of a window removes the window.

- Kill: `kill/3`
- Raise on failure: `kill!/3`

## Members

### Common operations

- [`id`](/en/elixir/pr-173/reference/libtmux-pane-id/) (property): Required: building the struct without this key is an error.
- [`index`](/en/elixir/pr-173/reference/libtmux-pane-index/) (property)
- [`height`](/en/elixir/pr-173/reference/libtmux-pane-height/) (property)
- [`width`](/en/elixir/pr-173/reference/libtmux-pane-width/) (property)
- [`title`](/en/elixir/pr-173/reference/libtmux-pane-title/) (property)
- [`active`](/en/elixir/pr-173/reference/libtmux-pane-active/) (property)
- [`current_command`](/en/elixir/pr-173/reference/libtmux-pane-current_command/) (property)
- [`pid`](/en/elixir/pr-173/reference/libtmux-pane-pid/) (property)
- [`window_id`](/en/elixir/pr-173/reference/libtmux-pane-window_id/) (property)
- [`capture!/3`](/en/elixir/pr-173/reference/libtmux-pane-capture-bang-3/) (function): Returns screen bytes when `capture/3` completes; raises API errors or `LibTmux.Action.CompletionError` otherwise.
- [`current_path`](/en/elixir/pr-173/reference/libtmux-pane-current_path/) (property)
- [`dead`](/en/elixir/pr-173/reference/libtmux-pane-dead/) (property)
- [`exit_status`](/en/elixir/pr-173/reference/libtmux-pane-exit_status/) (property)

### Other members

- [`capture_option/0`](/en/elixir/pr-173/reference/libtmux-pane-capture_option-0/) (typealias): Bounded one-shot screen capture; line numbers are relative to the visible screen, with negative history offsets.
- [`capture/3`](/en/elixir/pr-173/reference/libtmux-pane-capture-3/) (function): Captures bounded screen bytes through explicit one-shot execution.
- [`kill!/3`](/en/elixir/pr-173/reference/libtmux-pane-kill-bang-3/) (function): Returns `:ok` when `kill/3` completes; raises API errors or `LibTmux.Action.CompletionError` otherwise.
- [`kill/3`](/en/elixir/pr-173/reference/libtmux-pane-kill-3/) (function): Kills an exact pane through one-shot execution.
- [`resize!/3`](/en/elixir/pr-173/reference/libtmux-pane-resize-bang-3/) (function): Returns `:ok` for a completed pane resize or raises the action error.
- [`resize/3`](/en/elixir/pr-173/reference/libtmux-pane-resize-3/) (function): Requests an absolute width, height or both for an exact pane.
- [`send_keys!/4`](/en/elixir/pr-173/reference/libtmux-pane-send_keys-bang-4/) (function): Returns `:ok` when `send_keys/4` completes; raises API errors or `LibTmux.Action.CompletionError` otherwise.
- [`send_keys/4`](/en/elixir/pr-173/reference/libtmux-pane-send_keys-4/) (function): Sends 1..128 named keys to an exact pane; unknown names are rejected.
- [`send_text!/4`](/en/elixir/pr-173/reference/libtmux-pane-send_text-bang-4/) (function): Returns `:ok` when `send_text/4` completes; raises API errors or `LibTmux.Action.CompletionError` otherwise.
- [`send_text/4`](/en/elixir/pr-173/reference/libtmux-pane-send_text-4/) (function): Sends 0..995 literal bytes to an exact pane, without interpreting key names.
- [`server_instance`](/en/elixir/pr-173/reference/libtmux-pane-server_instance/) (property): Required: building the struct without this key is an error.
- [`split_option/0`](/en/elixir/pr-173/reference/libtmux-pane-split_option-0/) (typealias): Split geometry and process arguments.
- [`split_value/0`](/en/elixir/pr-173/reference/libtmux-pane-split_value-0/) (typealias): A created pane ID; `ref` is bound for qualified control and `nil` for one-shot.
- [`split!/3`](/en/elixir/pr-173/reference/libtmux-pane-split-bang-3/) (function): Returns the created pane value when `split/3` completes; raises API errors or `LibTmux.Action.CompletionError` otherwise.
- [`split/3`](/en/elixir/pr-173/reference/libtmux-pane-split-3/) (function): Splits an exact pane and returns its ID and optional bound reference as `value`.
- [`t/0`](/en/elixir/pr-173/reference/libtmux-pane-t-0/) (typealias): A physical pane; PID and exit status can be known absent, with separate coverage sentinels.
- [`text_wait_option/0`](/en/elixir/pr-173/reference/libtmux-pane-text_wait_option-0/) (typealias): Capture options plus the literal match and polling interval.
- [`wait_for_text!/4`](/en/elixir/pr-173/reference/libtmux-pane-wait_for_text-bang-4/) (function): Returns matching screen bytes or raises the error from `wait_for_text/4`.
- [`wait_for_text/4`](/en/elixir/pr-173/reference/libtmux-pane-wait_for_text-4/) (function): Polls an exact pane through one-shot capture and returns the first matching screen.

## In other ports

A tmux pane

| Port | API | Differs from Elixir |
| --- | --- | --- |
| Elixir | `LibTmux.Pane`. An immutable physical pane with explicit actions. It belongs to a window; text may be empty. | This page |
| Python | [`libtmux.Pane`](/en/py/latest/reference/libtmux-pane/) (class). tmux(1) Pane [pane_manual]. | None recorded in the model |
| Ruby | [`LibTmux::Pane`](/en/ruby/latest/reference/libtmux-pane-14z6/) (class). A physical pane on one server, reached through a handle that wraps an EntityRef. Methods take timeout: and cancel:, and raise CommandError when tmux rejects the command. | None recorded in the model |
| Lua | [`libtmux.Pane`](/en/lua/latest/reference/libtmux-pane/) (class) | None recorded in the model |
| PowerShell | [`LibTmux\Get-TmuxPane`](/en/powershell/latest/reference/libtmux-get-tmuxpane/) (cmdlet). Read panes from a server, session or window. | 3 overloads. This cmdlet reads shared .NET `LibTmux.Pane` objects. Its [`-Server`](/en/powershell/latest/reference/libtmux-get-tmuxpane/#LibTmux%5CGet-TmuxPane.parameter.Server), [`-Session`](/en/powershell/latest/reference/libtmux-get-tmuxpane/#LibTmux%5CGet-TmuxPane.parameter.Session), and [`-Window`](/en/powershell/latest/reference/libtmux-get-tmuxpane/#LibTmux%5CGet-TmuxPane.parameter.Window) parameter sets select the scope. |
| Julia | [`LibTmux.PaneSnapshot`](/en/julia/latest/reference/libtmux-panesnapshot/) (struct) | 2 overloads. `PaneSnapshot` holds captured pane data. Actions use its `PaneRef`; `PaneOccurrence` adds a window placement in a session. |
| Erlang | [`#tmux_model:pane{}`](/en/erlang/latest/reference/tmux_model-pane/) (struct) | None recorded in the model |
| Haskell | [`LibTmux.Snapshot.Pane`](/en/haskell/latest/reference/libtmux-snapshot-t-pane/) (data-type). 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`](/en/lisp/latest/reference/libtmux-pane/) (class). A physical pane belonging to one captured window. | `pane` is an immutable captured physical pane. |
| TypeScript | [`pane.Pane`](/en/ts/latest/reference/pane-pane/) (class). One pane on one tmux server, as a handle rather than a copy of it. | None recorded in the model |
| Rust | [`pane.Pane`](/en/rs/latest/reference/pane-pane/) (struct). One tmux pane, as reached through one window link. | None recorded in the model |
| Go | [`tmux.Pane`](/en/go/latest/reference/tmux-pane/) (struct). 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`](/en/java/latest/reference/io-github-libtmux-pane-pane/) (class). One tmux pane, as one capture saw it. | readonly |
| Clojure | [`libtmux.data/panes`](/en/clojure/latest/reference/libtmux-data-panes/) (function). 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`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-pane/) (class). A tmux pane, with operations for input, output, and layout. | None recorded in the model |
| Scala | [`io.github.libtmux.scaladsl.Pane`](/en/scala/latest/reference/io-github-libtmux-scaladsl-pane/) (typealias). 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 |
| C# | [`LibTmux.Pane`](/en/csharp/latest/reference/libtmux-pane/) (class). Represents an immutable pane handle and snapshot. | None recorded in the model |
| F# | [`LibTmux.FSharp.Pane`](/en/fsharp/latest/reference/libtmux-fsharp-pane/) (module). 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`](/en/cxx/latest/reference/libtmux-pane/) (class). One pane, as one listing saw it. | None recorded in the model |
| Swift | [`Pane`](/en/swift/latest/reference/pane/) (struct). A tmux pane, as it was when the listing was read. | None recorded in the model |
| OCaml | [`Libtmux.Pane.t`](/en/ocaml/latest/reference/libtmux-pane-t/) (typealias) | None recorded in the model |
| Perl | [`LibTmux::Pane`](/en/perl/latest/reference/libtmux-pane/) (class). Captured pane entity | A physical pane retains its captured graph, without retaining transport. |
| Raku | [`LibTmux::Model::Pane`](/en/raku/latest/reference/libtmux-model-pane/) (class). Captured pane fields and its local physical-window relationship. | None recorded in the model |
