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

class libtmux-kotlin

Window

A tmux window at a specific position in a session.

Source and package
Qualified name
io.github.libtmux.kotlin.Window
Package
io.github.libtmux.kotlin
Distribution
io.github.libtmux:libtmux-kotlin
Source
libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Window.kt
public class Window

Description

Holds the Java handle privately, so a member here always wins over a same-named catalog-generated extension in WindowOperations.kt. Companion hosts the generated query field namespace.

A property or a plain function here reads the capture this handle came from and issues no command. Every suspend extension asks tmux now, dispatched through the Server's policy.

What is on here

The members fall into a few groups:

Reading the capture
id, index, context, name, active, linked, size and layout read what this capture stored about the window, and server and session are the Server and Session it sits in. The id names the underlying window and the index names this link, so a window linked into two sessions has one id and two handles. A rename or a resize after the capture does not show in it.
Panes
panes lists this link's panes in tmux's order and activePane is the one tmux had active, null when the capture holds none; both are pure reads. split divides the active pane in half, or as a SplitSpec describes, and returns the pane that appeared. It throws when the spec asks for something this server does not have.
Layout and size
selectLayout rearranges the panes into one of tmux's built-in layouts, nextLayout and previousLayout step to a neighbour, and rotate rotates the panes. Read the arrangement from layout and hand it back to applyLayout, which checks a string before tmux sees it. resizeTo takes terminal cells. synchronizePanes copies input typed into one pane into every pane of the window until stopSynchronizingPanes.
Moving and linking
select makes the window the active one in its session. linkTo links it into another session so one window sits in both, moveTo moves it to another session or to an exact index there, and unlink removes one link and throws when it is the window's only one, which tmux refuses to remove.
Changing the window
rename returns a replacement capture, because this handle keeps its original state. respawn kills what is running in the window and starts it again, displayPopup shows a popup over it and needs an attached client, and kill closes it.
Options and hooks
options and hooks reach what is set on this window alone, and every link to the window shares them.
Formats and refreshing
expand expands a tmux format in this window's context, and refresh takes a new capture to see the window as it is now. It leaves this handle unchanged and returns the new one, and throws if the window is no longer linked here, from a server that still answers.

Members38 members

Parent objects2

  • session property The session this link belongs to. A pure read of the capture.
  • server property

Collections and queries1

  • panes property This link's panes, in tmux's order. A pure read of the capture.

Common operations1

  • split method Splits this window's active pane in half, putting the new one below it.

Other members34

  • active property Whether this was its session's active window when captured.
  • activePane property The pane tmux had active here. A pure read of the capture.
  • applyLayout method Restores an exact arrangement previously read from [.layout()].
  • asJava property The Java window this wraps: the same object, for a Java API that takes one.
  • Companion module
  • context property The winlink this handle addresses.
  • displayPopup method Shows a popup over this window, running a command in it.
  • equals method
  • expand method Expands a tmux format in this window's context, and answers with what it came to.
  • hashCode method
  • hooks method This window's own hooks, which every link to it shares.
  • id property The underlying window, shared by every link to it.
  • index property Where this link sits in its session.
  • kill method Closes this window.
  • layout property tmux's own layout for this window, in whichever form this server writes it.
  • linked property Whether the underlying window is linked into more than one session.
  • linkTo method Links this window into another session, so one window sits in both.
  • moveTo method Moves this window into another session.
  • name property The window name.
  • nextLayout method Moves to the next built-in layout, as tmux's own binding does.
  • options method This window's own options, which every link to it shares.
  • previousLayout method Moves to the previous built-in layout, as tmux's own binding does.
  • refresh method Takes a new capture and returns this winlink as it is now.
  • rename method Renames this window and returns its replacement capture.
  • resizeTo method Resizes this window in terminal cells.
  • respawn method Kills what is running in this window and starts it again.
  • rotate method Rotates the panes within this window.
  • select method Makes this the active window of its session.
  • selectLayout method Rearranges this window's panes into one of tmux's built-in layouts.
  • size property How large the window was when captured, in terminal cells.
  • stopSynchronizingPanes method Stops copying input between this window's panes.
  • synchronizePanes method Copies input to one pane into every pane in this window, until .stopSynchronizingPanes.
  • toString method
  • unlink method Removes this link, leaving the window wherever else it is linked.

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

Guides

task material

Pages that discuss Window.

In other ports

task equivalence 22 other ports mapped

Source-verified mappings for A tmux window. A mapping says these APIs perform the same task. It does not say they share defaults, errors or completion: check each page.

A tmux window in each port
PortAPIDiffers from Kotlin
Kotlin io.github.libtmux.kotlin.Window
A tmux window at a specific position in a session.
This page
Python libtmux.Window
tmux(1) Window [window_manual].
None recorded in the model
Ruby LibTmux::Window None recorded in the model
Lua libtmux.Window None recorded in the model
PowerShell LibTmux\Get-TmuxWindow
Read contextual windows from a server or session.
2 overloads
This cmdlet reads shared .NET LibTmux.Window placements. Use -Server for all sessions or -Session for one session.
Julia LibTmux.WindowSnapshot 2 overloads
WindowSnapshot holds captured physical-window data. WindowLink records a placement in a session; actions use WindowRef.
Erlang #tmux_model:window{}
A physical window can have several session memberships. window_link holds the session-relative index and active flag.
Elixir LibTmux.Window
An immutable physical window, independent of session membership and index.
Window is a physical window. WindowLink records its session index and active state.
Haskell LibTmux.Snapshot.Window
Detached physical window, independent of its session and index appearances.
Window is a detached physical window, independent of its session placements. WindowLink records each session, index and window binding, and operations take a generation-bound WindowRef.
Common Lisp libtmux:window
A physical window shared by zero or more captured links.
window is a physical captured window. window-link preserves each session placement.
TypeScript window.Window
One window on one tmux server, as a handle rather than a copy of it.
None recorded in the model
Rust window.Window
One tmux window, as reached through one session that links it.
None recorded in the model
Go tmux.Window
Window is one materialized (session, index, window) winlink record. It is normally returned by Server.Snapshot, Server.Window, or Window.Refresh. A zero Window is not a usable tmux target.
None recorded in the model
Java io.github.libtmux.Window
One tmux window at one of its positions, as one capture saw it.
readonly
Clojure libtmux.data/windows
Returns the captured window occurrences in a snapshot or session.
Traverses captured window-placement maps without I/O; the window value is a map with an explicit Java reference for effects.
Scala io.github.libtmux.scaladsl.Window
One captured window placement, opaque over the Java handle. Equality includes its session and index, since a window linked into more than one session has more than one placement. Every operation beyond equality is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT, STREAM or LIFECYCLE.
2 overloads
C# LibTmux.Window
Represents an immutable window handle and snapshot.
None recorded in the model
F# LibTmux.FSharp.Window
Identifies window placements and starts queries confined to one window.
This F# module identifies shared .NET LibTmux.Window placements and builds deferred pane queries. Query.list acquires their results from tmux.
C++ libtmux::Window
One window, as one listing saw it.
None recorded in the model
Swift Window
One tmux window, independent of every session that links it.
None recorded in the model
OCaml Libtmux.Window.t
A global window can have several session placements. Window_link holds the session, index and current flag.
Perl LibTmux::Window
Captured window entity
Physical window identity. WindowLink owns each session/index placement.
Raku LibTmux::Model::Window
Captured physical window; session-relative indices belong to WindowLink.
A physical window may have multiple WindowLink placements, including distinct indexes in one session.
Esc
Search in

Type to search.

Reference previewOpen reference