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

module libtmux-fsharp

Pane

Reads captured pane fields and starts explicit pane operations.

Source and package
Qualified name
LibTmux.FSharp.Pane
Namespace
LibTmux.FSharp
Package
LibTmux.FSharp
Source
src/LibTmux.FSharp/Hierarchy.fsi

Description

Each function takes the pane it acts on last. One that runs a tmux command also takes the cancellation token first and returns a Task. The pane is the core LibTmux.Pane handle, which is immutable and safe to share, and a function that changes it returns a handle carrying the state afterwards.

What is on here

A tmux pane has a good many members, but this module covers the part an F# caller reaches first. The rest lives on the core handle. The members fall into a few groups:

Reading what the pane holds
The working directory and command name are read from the capture and keep an empty string, and throw IncompleteSnapshotException when the field was not captured. Capturing the contents asks tmux, and reading since a position returns only what the pane printed after it, with LinesMissed when scrollback dropped output first. Finding text on screen searches only the rows tmux shows, counted from 1.
Sending input
Text is typed literally, with or without Enter, and a key is pressed by its tmux name, where tmux types a name it does not know as text. Cancellation can occur after dispatch and does not undo what was sent. A line whose text was sent but whose Enter failed must not be sent again.
Waiting
A wait sleeps on the pane's own output rather than polling, and returns the outcome TimedOut when time runs out, where only Mirror.waitUntil raises. Text already on screen ends a wait at once. Sending and then waiting counts only output after the keys and discounts the shell's echo of literal text, so it does not match the typed line itself. A wait throws TmuxPaneException when the pane's program had already exited, and TmuxObjectNotFoundException when tmux no longer has the pane.
Send, then wait
Running a command
Run a shell command and wait for its exit status and output. The pane must sit at a POSIX shell prompt, a command still running at the timeout keeps running and the result reports TimedOut, and one that was sent but could not be observed fails as MayHaveRun, so inspect the pane before a retry.
Splitting and arranging
Splitting takes the core request, which carries every split-window option, and cancellation can leave the split applied, so do not retry automatically.
Split
Title
Restarting and ending
Respawning starts the pane's program again, and tmux refuses a pane whose program is still running unless KillExistingProcess is set. Killing takes the program in the pane with it, and leaves off the core's allExcept. Clearing history leaves what the screen shows.

The rest of a pane is on the core LibTmux.Pane, which F# calls like any .NET type: the pane's options and hooks, copy mode, pasting, and the raw command through ExecuteCommandAsync.

Members23 members

Common operations22

  • capture Captures pane contents using the supplied core request.
  • run Runs a shell command in the pane and waits for its exit status and output.
  • waitForText Waits for a line the pane prints to contain the text.
  • waitUntil Waits until a condition holds over the rows the pane shows, top to bottom.
  • sendAndWait Types a line, presses Enter, and waits for a later line to contain the text.
  • findOnScreen Returns the first visible row showing the text, counted from 1, or None.
  • readSince Reads what the pane printed since a position, and where this read finished.
  • sendAndWaitFor Sends keys as the request describes, then waits as the wait request describes.
  • sendLine Types a line into the pane as literal text, then presses Enter.
  • waitFor Waits as the request describes: patterns, stop patterns, or any output.
  • clearHistory Clears the pane's scrollback history; what the screen shows stays.
  • kill Kills the pane and the program in it.
  • pressKey Presses one key by its tmux name, such as Enter, C-c or Up.
  • resize Resizes the pane as the request says, and returns a handle carrying the state afterwards.
  • respawn Starts the pane's program again as the request says.
  • select Makes the pane its window's active pane, and returns a handle carrying the state afterwards.
  • sendKeys Sends text or key names according to the request's literal and Enter settings.
  • setTitle Sets the pane's title and returns a handle carrying it.
  • split Splits the pane and returns the new pane handle.
  • swap Swaps the pane with another, as the request names it.
  • currentCommand Reads the captured command name, preserving an empty string.
  • currentPath Reads the captured working directory, preserving an empty string.

Other members1

  • sendText Types text into the pane literally, without pressing Enter.

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 F#
F# LibTmux.FSharp.Pane
Reads captured pane fields and starts explicit pane operations.
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
C# LibTmux.Pane
Represents an immutable pane handle and snapshot.
None recorded in the model
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