Pane
A tmux pane, as it was when the listing was read.
Source and package
- Qualified name
-
Pane - Package
- libtmux-swift
- Source
- Sources/LibTmux/Pane.swift
- Other languages
- Perlclass ErlangPowerShellcmdlet Juliastruct Elixirstruct Haskell Common Lispclass PythonRubyLuaTypeScriptRustGoJavaC#C++KotlinScalaOCamlF#module Clojurefunction
-
Description#
A pane belongs to one window; session membership runs through
WindowLink.Examples#
Find a window's panes. Read all panes and select those whose windowID matches a newly created window. Pane values are snapshots; reading a property does not query tmux again. Use Swift 6.2 or newer and tmux 3.3a or newer on Linux or macOS. In an empty directory, save this consumer package as
Package.swift; SwiftPM fetches the library from release 0.1.1:// swift-tools-version: 6.2import PackageDescriptionlet package = Package(name: "ApiExample",platforms: [.macOS(.v13)],dependencies: [.package(url: "https://github.com/libtmux/libtmux-swift.git", from: "0.1.1")],targets: [.executableTarget(name: "ApiExample",dependencies: [.product(name: "LibTmux", package: "libtmux-swift"),.product(name: "TmuxFixture", package: "libtmux-swift"),],path: "Sources")])Create a
Sourcesdirectory and save this complete program asSources/Example.swift. ThewithTmuxServerfixture owns a private tmux server and stops it after success or failure. Ordinary application code usesServerfor its own socket; these examples use the fixture until their setup moves to ordinary server objects. View sourceimport Foundationimport LibTmuximport TmuxFixture@mainstruct ApiPanes {static func main() async {do {try await withTmuxServer { @Sendable server inlet session = try await server.newSession(named: "work")let appearance = try await server.newWindow(in: session, named: "logs")let panes = try await server.panes()let logPanes = panes.filter { $0.windowID == appearance.window.id }print("Log panes: \(logPanes.count)")for pane in logPanes {print("Active: \(pane.isActive)")}}} catch {FileHandle.standardError.write(Data("Example failed: \(error)\n".utf8))exit(EXIT_FAILURE)}}}Build and run the saved program. An operation or cleanup error produces a failing exit status. Set
LIBTMUX_TMUX_BINto an absolute executable path to select a tmux version:Terminal window $ swift run ApiExampleExpected output:
Log panes: 1Active: true
Members22#
Common operations12#
- id: let id: Pane
ID property tmux's own pane id —%0,%1. - index: let index: Int property Position within its window, renumbered as panes come and go.
- height: let height: Int property The height tmux is drawing this pane at, in cells.
- width: let width: Int property The width tmux is drawing this pane at, in cells.
- isActive: let is
Active : Bool property The pane a command reaches when it names the window and stops there. - currentCommand: let current
Command : String property The command tmux believes is running. It reflects the foreground process, so it changes as the user works. - currentPath: let current
Path : String property The working directory of the process in the pane, which follows the user around rather than staying where the pane was created. - windowID: let window
ID : WindowID property The window this pane is in. Panes move between windows, so this is where it is now rather than where it started. - isAtTop: let is
At : Bool property Whether the pane reaches its window's top edge. A pane can be against more than one edge, and a lone pane is against all four.Top - isAtBottom: let is
At : Bool property Whether the pane reaches its window's bottom edge.Bottom - isAtLeft: let is
At : Bool property Whether the pane reaches its window's left edge.Left - isAtRight: let is
At : Bool property Whether the pane reaches its window's right edge.Right
Other members10#
- filterFieldID(for:) method The stable wire id for a key path, or
nilif the property is not filterable. - filterFieldType(_:) method The value kind an id names, or
nilwhen this model does not know it. - filterFormatField(_:) method The tmux format field an id reads, or
nilwhen it has no single one. - filterValue(_:of:) method Reads the field an id names, or
nilif this model has no such field. - incarnation: let incarnation: Server
Incarnation property The daemon this value was read from. - init(id:index:width:height:isActive:isDead:isInputOff:modeCount:isSynchronized:currentCommand:currentPath:isAtTop:isAtBottom:isAtLeft:isAtRight:windowID:incarnation:) method
- isDead: let is
Dead : Bool property Whether the pane's configured process has exited. - isInputOff: let is
Input : Bool property Whether tmux has disabled input to the pane.Off - isSynchronized: let is
Synchronized : Bool property Whether input to this pane participates in synchronized-pane delivery. - modeCount: let mode
Count : Int property The number of human-client modes stacked on the pane.
Inherited members2 members#
Reached through Equatable.!=(_:_:), Decodable.init(from:).
- !=(_:_:) function inherited Returns a Boolean value indicating whether two values are not equal.
- init(from:) method inherited Creates a new instance by decoding from the given decoder.
Guides#
Pages that discuss Pane.
- Concepts
In other ports#
A tmux pane
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| PowerShell | Lib This cmdlet reads shared .NET LibTmux.Pane objects. Its -Server, -Session, and -Window parameter sets select the scope. |
| Julia | Lib PaneSnapshot holds captured pane data. Actions use its PaneRef; PaneOccurrence adds a window placement in a session. |
| Erlang | #tmux |
| Elixir | Lib 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 is an immutable captured physical pane. |
| TypeScript | pane |
| Rust | pane |
| Go | tmux |
| Java | io |
| Clojure | libtmux Traverses captured pane maps without I/O. Use keyword lookup for scalar observations and the preserved :tmux/ref for effects. |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| F# | Lib This F# module reads captured fields and starts explicit operations on the shared .NET LibTmux.Pane type. |
| C++ | libtmux:: |
| OCaml | Libtmux |
| Perl | Lib A physical pane retains its captured graph, without retaining transport. |