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 coreLibTmux.Panehandle, 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
IncompleteSnapshotExceptionwhen the field was not captured. Capturing the contents asks tmux, and reading since a position returns only what the pane printed after it, withLinesMissedwhen scrollback dropped output first. Finding text on screen searches only the rows tmux shows, counted from 1. - CapturedContents
- 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
TimedOutwhen time runs out, where onlyMirror.waitUntilraises. 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 throwsTmuxPaneExceptionwhen the pane's program had already exited, andTmuxObjectNotFoundExceptionwhen 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 asMayHaveRun, 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.
- SplitTitle
- Restarting and ending
- Respawning starts the pane's program again, and tmux refuses a pane whose program is still running unless
KillExistingProcessis set. Killing takes the program in the pane with it, and leaves off the core'sallExcept. 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 throughExecuteCommandAsync.
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-corUp. - 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.
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.
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 F# |
|---|---|---|
| F# | Lib Reads captured pane fields and starts explicit pane operations. | 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 |
| C# | Lib Represents an immutable pane handle and snapshot. | None recorded in the model |
| 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 |