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.

Go API

struct libtmux-go latest

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.

Source and package
Qualified name
tmux.Pane
Package
tmux
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/model.go
Other languages
Perlclass ErlangPowerShellcmdlet Juliastruct Elixirstruct Haskell Common Lispclass PythonRubyLuaTypeScriptRustJavaC#C++SwiftKotlinScalaOCamlF#module Clojurefunction
struct tmux.Pane

Members176#

Parent objects5#

  • Window method Window returns this pane's exact winlink record when it remains in the same snapshot. It never queries tmux.
  • ResolveWindow method ResolveWindow snapshots live tmux state and returns the exact winlink containing this pane view. It returns SnapshotLookupError cardinality errors.
  • Session method Session returns this view's parent record when it remains in the same snapshot. It never queries tmux.
  • ResolveSession method ResolveSession snapshots live tmux state and returns the parent session of this pane's exact winlink. It returns SnapshotLookupError cardinality errors.
  • Server method Server returns the configured handle that produced the pane.

Common operations62#

  • Capture method Capture captures printed content from the receiver's exact linked pane. It returns a caller-owned slice. Completed stderr becomes a CommandError; any stdout tmux still printed is returned alongside it. A nonzero exit with empty stderr is not an error, as for every command (see the package documentation), and its stdout is returned.
  • SendKeys method SendKeys invokes tmux send-keys with the receiver's exact linked session-window-pane target. This is tmux key input, not shell execution: Literal only changes tmux key parsing, and any delivered text may still be interpreted by the pane's application. KeyName routes through a client's key table instead of delivering to the pane.
  • Split method Split creates a tiled pane relative to the receiver's exact linked-pane view. Attach makes the new pane active in that session and winlink; it is not a global client-focus guarantee. The returned Pane is freshly materialized in the receiver SessionID and WindowID. Named Split rather than SplitPane to avoid repeating Pane; Window.SplitPane is the equivalent operation relative to a window.
  • Kill method Kill destroys the receiver pane through its exact linked-pane target. If panes remain and the receiver was active, tmux selects another active pane. If this was the last pane, tmux also destroys the window and removes all of its winlinks. Affected sessions preserve their current selection unless the destroyed window was current, in which case they select another. A session left without windows is destroyed; Session.Kill describes how tmux handles its clients. The receiver is not refreshed. Only stderr makes a completed command a CommandError; nonzero exits without stderr are ignored.
  • Respawn method Respawn restarts the process in the receiver's exact linked pane on every supported tmux. Command, when present, is passed as one tmux shell-command operand; Go neither executes it locally nor adds inner-shell quoting. Final semicolon protection applies only to tmux's outer command parser. See RespawnRequest for zero-value, directory, environment, and Kill behavior.
  • Select method Select applies select-pane to the receiver's exact linked-pane view. Direction makes an adjacent pane active, but the returned Pane is a fresh exact refresh of the receiver rather than the newly active pane. With no Direction, Mark, or Input, the receiver becomes active. Mark changes the server-wide marked pane without selection; Input changes the receiver's input state without selection. None of these modes selects the window in its session or promises client focus.
  • Resize method Resize runs tmux resize-pane against the receiver's exact linked session-window-pane target, then refreshes by PaneID. The returned canonical Pane may therefore carry a different linked-session or winlink context. If the resize is accepted but refresh fails, Resize returns the original receiver with that error.
  • ID method ID returns the stable tmux pane identity.
  • Index method Index returns the pane's index in its exact window view. Unlike the materialized format accessors it sits beside, it returns a plain int, because a pane record always carries the index tmux placed it at.
  • BreakPane method BreakPane moves the receiver into a new window in its exact session. Attach lets that new winlink become current in the session; it is not a global client-focus guarantee. The returned Window is freshly materialized in the receiver SessionID rather than by canonical ID-only refresh.
  • SetTitle method SetTitle sets the title of the receiver's exact linked pane. tmux expands format expressions in title; the value is not a shell command. SetTitle then refreshes by PaneID, so the returned canonical Pane may carry a different linked-session or winlink context. If the mutation is accepted but refresh fails, SetTitle returns the original receiver with that error.
  • Height method Height returns tmux #{pane_height} as int from this Pane's materialized pane-scoped fields.
  • Width method Width returns tmux #{pane_width} as int from this Pane's materialized pane-scoped fields.
  • Title method Title returns tmux #{pane_title} as string from this Pane's materialized pane-scoped fields.
  • Active method Active returns tmux #{pane_active} as bool from this Pane's materialized pane-scoped fields.
  • CurrentCommand method CurrentCommand returns tmux #{pane_current_command} as string from this Pane's materialized pane-scoped fields.
  • Swap method Swap exchanges the receiver with one exact or adjacent pane. Explicit targets use exact linked-pane views; PaneID alone does not distinguish linked views. Unless Detach is set, tmux may change active-pane selection; this is not a global client-focus guarantee. A directional swap cannot identify the adjacent target because tmux does not report it, so the returned PaneSwapResult.Target is zero.
  • ClearHistory method ClearHistory removes scrollback from the receiver's exact linked pane. ResetHyperlinks triggers a version probe before mutation. A completed command produces a redacted CommandError only for stderr; nonzero exits without stderr are ignored. Accepted changes are not rolled back.
  • PasteBuffer method PasteBuffer pastes a named or top buffer into the receiver's exact linked pane. DeleteAfter requests deletion after tmux processes an existing buffer; an exited target or missing named buffer fails before deletion, while deletion after disabled pane input does not prove byte delivery.
  • Options method Options returns a freshly decoded, caller-owned view of known options at this exact pane target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values. Each returned accessor names the setter that writes it, so PaneOptionValues.WindowStyle pairs with Pane.SetWindowStyle.
  • Join method Join relocates the receiver with join-pane. Its selection, source-destruction, partial-result, and delivery behavior matches Pane.Move.
  • Pipe method Pipe starts, toggles, or stops piping for the receiver's exact linked pane. tmux expands formats and time formats in Command before running it with sh -c. The library's protection for a final semicolon applies only to tmux's outer command parser; it does not quote or neutralize the child shell.
  • SetOption method SetOption stores a pane option at this exact pane target without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.
  • UnsetOption method UnsetOption unsets a pane option at this exact pane target without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.
  • Hooks method Hooks returns a freshly decoded, caller-owned view of known hooks at this exact pane target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values.
  • CurrentPath method CurrentPath returns tmux #{pane_current_path} as string from this Pane's materialized pane-scoped fields.
  • CopyMode method CopyMode enters or cancels copy mode using the receiver's exact linked session-window-pane target. PageDown requires tmux 3.5 and follows UnsupportedPolicy. A version-probe error stops the operation. tmux resolves the receiver and optional SourcePane before processing Cancel; a stale target can therefore fail without resetting the current mode. Cancel then takes precedence over other actions.
  • RawOption method RawOption returns one exact pane option value at this exact pane target. A successful string is caller-owned; the receiver's exact linked session context controls tmux format evaluation, and a completed failure is returned.
  • WindowID method WindowID returns the underlying stable tmux window identity.
  • SetHook method SetHook stores a pane hook at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.
  • UnsetHook method UnsetHook removes every matching pane hook index at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the unset was accepted.
  • Refresh method Refresh performs a canonical live lookup for the pane's stable ID and returns a new record without mutating the receiver. It does not preserve a linked-session view; use Pane.ResolveWindow for exact relationships.
  • Move method Move relocates the receiver pane into one exact destination with tmux's move-pane command. Unless Attach is set, the destination's active-pane selection remains unchanged; Attach is not a global client-focus guarantee. The returned Pane is freshly materialized in the destination SessionID and WindowID rather than by canonical ID-only refresh.
  • AtTop method AtTop returns tmux #{pane_at_top} as bool from this Pane's materialized pane-scoped fields.
  • AtBottom method AtBottom returns tmux #{pane_at_bottom} as bool from this Pane's materialized pane-scoped fields.
  • AtLeft method AtLeft returns tmux #{pane_at_left} as bool from this Pane's materialized pane-scoped fields.
  • AtRight method AtRight returns tmux #{pane_at_right} as bool from this Pane's materialized pane-scoped fields.
  • DisplayMessage method DisplayMessage displays or prints a message at this pane's exact target. Embedded NoExpand requires tmux 3.4 and UpdatePane requires tmux 3.6; each follows UnsupportedPolicy. Print returns an owned stdout slice even on a completed nonzero exit. Completed stderr synchronously reaches WarningHandler as tmux.WarningCommandStderr, not an error; cancellation does not prove display or pane update did not occur.
  • Dead method Dead returns tmux #{pane_dead} as bool from this Pane's materialized pane-scoped fields.
  • SendPrefix method SendPrefix sends a tmux prefix key to the receiver's exact linked pane. Unsupported PrefixKey values fail before execution. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. Nonzero exits without stderr are ignored; transport errors are delivery-ambiguous.
  • Cmd method Cmd executes a tmux subcommand targeted to the pane's stable ID.
  • TTY method TTY returns tmux #{pane_tty} as string from this Pane's materialized pane-scoped fields.
  • SessionID method SessionID returns the linked session containing this pane view.
  • SetHeight method SetHeight resizes the pane to a nonnegative absolute height in cells. Zero is an explicit height. Targeting, refresh, and error semantics match Pane.Resize.
  • SetWidth method SetWidth resizes the pane to a nonnegative absolute width in cells. Zero is an explicit width. Targeting, refresh, and error semantics match Pane.Resize.
  • ClockMode method ClockMode enters clock mode using the receiver's exact linked target.
  • CustomizeMode method CustomizeMode enters tmux's interactive option browser using the receiver's exact linked target. It requires an attached client.
  • ChooseTree method ChooseTree enters tmux's interactive session, window, and pane chooser using the receiver's exact linked target. It requires an attached client. Format and Filter are tmux expressions; neither is interpreted by a shell. Unsupported sort values fail before execution. Only stderr produces a redacted CommandError; transport errors may leave tree mode active.
  • ChooseBuffer method ChooseBuffer enters tmux's interactive buffer chooser using the receiver's exact linked target. It requires an attached client.
  • FindWindow method FindWindow opens a tree chooser filtered by Match using the receiver's exact linked target. It requires an attached client. Match is passed as one tmux search operand and protected from leading-dash option parsing; it is not a tmux format or shell command. Only stderr produces a redacted CommandError; transport errors may leave the chooser open.
  • DisplayPopup method DisplayPopup displays an overlay on the selected client and waits until it closes after command exit or user dismissal. A zero request starts tmux's default command or default shell and may wait indefinitely. The API exposes no popup process handle, stdout, or child exit status.
  • InMode method InMode returns tmux #{pane_in_mode} as int from this Pane's materialized pane-scoped fields.
  • RunHook method RunHook asks tmux to run one pane hook directly at this exact target. The receiver's exact linked session context controls tmux format evaluation; no racy preflight is issued. Completed failures are secret-safe option errors; cancellation does not prove execution did not occur.
  • ChooseClient method ChooseClient enters tmux's interactive client chooser using the receiver's exact linked target. It requires an attached client.
  • Clear method Clear types the text "reset" and then Enter into the receiver's exact linked pane, the way a person at the keyboard would. Whatever is running reads it: a shell runs reset(1), and an editor receives the word. Use Pane.Reset or Pane.ClearHistory to act on the pane itself rather than on its program. A transport error may leave the text delivered without Enter.
  • Reset method Reset submits one tmux command list that resets terminal state and then clears history for the exact linked pane. The mutations are not atomic and may be partial. Only stderr makes a completed command a CommandError; nonzero exits without stderr are ignored. Transport errors are delivery-ambiguous.
  • Enter method Enter sends the Enter key to the receiver's exact linked pane. Stderr becomes a redacted CommandError; a nonzero exit with empty stderr is success, as for every mutation. Transport errors are delivery-ambiguous.
  • Path method Path returns tmux #{pane_path} as string from this Pane's materialized pane-scoped fields.
  • OpenObservation method OpenObservation captures the pane's visible text and returns an owned observation whose notifications begin at the capture's exact control-wire boundary. It resolves the pane's exact linked session before opening a dedicated control client. The caller must close the result.
  • DeadSignal method DeadSignal returns tmux #{pane_dead_signal} as string from this Pane's materialized pane-scoped fields.
  • DeadTime method DeadTime returns tmux #{pane_dead_time} as time.Time from this Pane's materialized pane-scoped fields.
  • Writer method Writer returns the pane's keyboard as an io.Writer. Bytes written to it are typed into the pane literally, and each newline is the Enter key, so fmt.Fprintln submits a line as a person at the keyboard would. Text with no trailing newline is typed and left on the line.

Other members109#

Guides#

Pages that discuss Pane.

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
Rust pane.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