Core Library0.xAPI reference

Choose documentation 1

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

typealias libtmux-scala

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.

Source and package
Qualified name
io.github.libtmux.scaladsl.Pane
Package
io.github.libtmux.scaladsl
Distribution
io.github.libtmux:libtmux-scala_3
Source
libtmux-scala/src/main/scala/io/github/libtmux/scaladsl/Pane.scala
opaque type Pane = JavaPaneobject Pane

Description

A pure read of the capture issues no command; every other operation asks tmux now, blocking the calling thread.

What is on here

The operations fall into a few groups:

Reading the capture
Pane.id, Pane.index, Pane.active, Pane.currentCommand, Pane.floating, Pane.size, Pane.position, Pane.edges, Pane.title, Pane.currentPath, Pane.currentPathText and Pane.pid read what this capture stored about the pane, and Pane.window and Pane.server are what it sits in. The id is stable and the index is state, since panes renumber as neighbours come and go. Pane.floating is empty when the running tmux cannot say, which before 3.7 is always, and Pane.pid is empty when tmux reported no process. Pane.currentPath throws when this JVM cannot represent the directory's name; Pane.currentPathText is what tmux reported and never throws.
Sending input
Pane.send types keys without pressing Enter and Pane.sendLine presses it, which is how a command gets run. Pane.sendKeys resolves each entry through tmux's key table and types an unknown name as text; Pane.sendLiteral types every entry as the characters it spells, so C-c is three characters. Pane.paste delivers text as one block through a private buffer that is removed afterwards, and it throws for text containing NUL and before tmux 3.4. Pane.noteTyped tells a later wait about text that reached the pane without passing through this handle.
Reading output
Pane.capture returns the visible content as a Vector with one element per line, read from tmux now rather than from the capture. Give it a callback on a builder or a CaptureSpec to read part of the history; it throws when the spec asks for something this server does not have. Pane.pipeTo sends everything the pane prints to a shell command until Pane.stopPiping, and Pane.clearHistory discards the scrollback.
Running and waiting
Pane.run runs a shell command to its end and answers with its exit status and output, and throws when the pane is not running a POSIX shell. Reach for it first when the command is yours. When it is not, Pane.awaitText and Pane.await poll the screen or the pane's state on a timer and answer with why they ended; a pane killed mid-wait ends Pane.awaitText as TextOutcome.PANE_GONE rather than an exception. Each wait blocks its thread, and interrupting the thread cancels it with InterruptedException. Pane.dead reads fresh whether the pane's process has exited, and throws when the pane is gone from a server that still answers.
Splitting and arranging
Pane.split divides this pane in half, from a callback on a builder or a SplitSpec, and returns the pane that appeared. Pane.breakOut moves the pane into a window of its own, Pane.joinTo into another window, and Pane.swapWith swaps it with another pane. Pane.resize grows it by cells in one direction, Pane.resizeTo sets exact dimensions, and Pane.select makes it the active pane. An unnamed Pane.breakOut throws on exact tmux 3.7, which a named break or 3.7a avoids.
Modes
Pane.copyMode puts the pane into copy mode, Pane.mode reads live which mode it is in, empty when it is showing its program, and Pane.exitMode leaves whichever mode it is in.
Changing the pane
Pane.retitle returns a replacement capture, because this handle keeps its original state. Pane.respawn kills what runs here and starts the pane's default command or one you give, Pane.respawnIn does so in a directory, and Pane.kill closes the pane.
Options and hooks
Pane.options and Pane.hooks reach what is set on this pane alone.
Formats and refreshing
Pane.expand expands a tmux format, and Pane.variables reads several named variables, in this pane's context. Pane.refresh takes a new capture to see the pane as it is now. It leaves this handle unchanged and returns the new one, and throws if the pane is gone from a server that still answers.

Members62 members

Parent objects2

  • window method The window link this pane was reached through.
  • server method The server this pane lives on.

Common operations10

  • capture method This pane's visible content, one element per line.
  • sendKeys method Sends an ordered group of key names to this pane, as tmux resolves them.
  • split method Splits this pane in half, putting the new one below it.
  • awaitText method Waits until text appears, or timeout passes first. A pane killed mid-wait answers TextOutcome.PANE_GONE rather than raising.
  • active method Whether this was its window's active pane.
  • await method Waits until settled holds for this pane as it is now. settled receives a fresh capture each look.
  • command method The command tmux reported running in the pane.
  • options method This pane's own options.
  • run method Runs a shell command in this pane to its end, and answers with its exit status and output.
  • sendLine method Sends a line to this pane and presses Enter, which is how a command gets run.

Other members50

  • asJava method The underlying Java pane. Opaque wrapping is free, so this never copies scope or state.
  • atBottom method Whether the pane touches the bottom of its window.
  • atLeft method Whether the pane touches the left of its window.
  • atRight method Whether the pane touches the right of its window.
  • atTop method Whether the pane touches the top of its window.
  • batch method Collects commands fenced to the server incarnation that produced this pane.
  • breakOut method Moves this pane into a window of its own, leaving tmux to name it.
  • clearHistory method Discards this pane's scrollback.
  • copyMode method Puts this pane into copy mode, where its scrollback can be navigated.
  • currentCommand method The command tmux reported running here.
  • currentPath method The working directory tmux reported for the pane.
  • currentPathText method The working directory tmux reported for the pane, exactly as tmux reported it.
  • dead method Whether this pane's process has exited, read fresh rather than from the capture.
  • edges method Which sides of its window the pane touches.
  • exitMode method Leaves whichever mode this pane is in.
  • expand method Expands a tmux format in this pane's context, and answers with what it came to.
  • floating method Whether this pane floats, or empty when the running tmux cannot say.
  • given_CanEqual_Pane_Pane constant
  • height method The pane's height, in cells.
  • hooks method This pane's own hooks.
  • id method The pane id.
  • index method The pane's position in its window.
  • info method The fields this capture stored.
  • joinTo method Moves this pane into another window, splitting it.
  • kill method Closes this pane.
  • left method The column of the pane's left edge in its window.
  • mode method Which mode this pane is in at this moment, or empty when it is in none.
  • noteTyped method Notes text that reached this pane without going through this handle, so a wait discounts its echo the way it discounts text sent through #sendLiteral.
  • paste method Pastes text into this pane as one block, leaving nothing behind on the server.
  • pasteBuffer method Pastes a named buffer into this pane, as though it had been typed.
  • path method The pane's working directory, as the text tmux reported.
  • pid method The process id of the program running in the pane, captured at the time of the read this handle came from.
  • pipeTo method Sends everything this pane prints to a shell command, until #stopPiping.
  • position method Where the pane's top-left corner sat in its window when captured, in terminal cells.
  • refresh method Takes a new capture and returns this pane as it is now.
  • resize method Grows this pane by a number of cells in one direction.
  • resizeTo method Resizes this pane.
  • respawn method Kills whatever runs here and starts the pane's default command again.
  • respawnIn method Restarts the configured pane process in a caller-supplied literal directory, resolved against this process's working directory when relative.
  • retitle method Retitles this pane and returns its replacement capture.
  • select method Makes this the active pane of its window.
  • send method Sends keys to this pane without pressing Enter.
  • sendLiteral method Sends an ordered group of strings to this pane as the characters they spell.
  • size method How large the pane was when captured, in terminal cells.
  • stopPiping method Stops sending this pane's output anywhere.
  • swapWith method Swaps this pane's position with another's.
  • title method The pane's title, which a program running in it can set.
  • top method The row of the pane's top edge in its window.
  • variables method Reads validated tmux variables in this pane's format context.
  • width method The pane's width, in cells.

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

Guides

task material

Pages that discuss Pane.

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 Scala
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.
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
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
C# LibTmux.Pane
Represents an immutable pane handle and snapshot.
None recorded in the model
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