Core Library0.xAPI reference

Choose documentation 3

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-dotnet

Window

Represents an immutable window handle and snapshot.

Source and package
Qualified name
LibTmux.Window
Namespace
LibTmux
Package
LibTmux
Source
src/LibTmux/Window.cs
class LibTmux.Window

Description

Thread-safe: the handle is immutable once constructed and may be shared freely, including as a singleton. Every mutating call answers a new handle rather than changing this one.

What is on here

A tmux window holds panes and has a good many members of its own. They fall into a few groups:

Reaching a window
Ask for the window holding the pane this process runs in. It is resolved through the pane rather than the session id in TMUX, which is frozen at pane spawn and goes stale once the window is moved.
Identity and state
A handle carries what tmux reported when it was made, so reading its name, index, size, or flags is local and never reaches tmux; re-read the window to see current state. Two handles are equal when they name the same window on the same server generation, so two placements of one linked window are equal. A window linked into several sessions holds a different index in each, and the index and the active flag describe the session this handle was read through.
Re-read
Looking inside
Read this window's panes from tmux, or hand tmux an expression to keep only some of them. The captured relations hold what a capture found instead: reading them never reaches tmux, and one the capture did not read stays uncaptured. Reading the active pane from tmux gets the pane the window shows now, and throws TmuxObjectNotFoundException when tmux reports none. A window can be linked into several sessions, so reading its sessions reports every one rather than a single parent.
Finding a pane
Read one pane of this window by a string target. The Get method throws TmuxObjectNotFoundException when this window has no such pane; the Find method answers null.
Splitting and arranging
Splitting makes a tiled pane and creating a pane makes a floating one, which needs tmux 3.7. A layout is applied by request or stepped to the next or previous one. Feeding a captured layout back restores the same pane sizes, but on tmux 3.7 and earlier it can rotate which pane lands in which position, where tmux 3.8 and newer accepts the JSON form and restores the exact arrangement. Resizing switches the window's window-size option to manual, so it stops following its clients.
Moving and linking
Linking puts the window into another session, unlinking removes only the placement it was read through, and moving takes it to another index or session. tmux refuses to unlink a window that belongs to only one session unless the call lets the window die. A guard in the native queue checks that the captured placement still names this window before it links, unlinks, or moves, and a swap on a window linked into several sessions resolves to whichever link tmux picks.
Beside this one
Changing the window
Renaming answers a replacement handle carrying the new name, and tmux expands the name as a format, so a # in it does not survive verbatim. Selecting makes the window current in its session. Respawning restarts the window's command, and tmux refuses it while the window is still running unless the request kills it first, which destroys every pane but one. Stopping a window can stop every other window in the session instead.
Messages
Show a message on the client viewing this window. A message with no client to show it on is not a failure, so tmux's complaint is logged rather than raised.
Options and hooks
The window's options and its hooks are objects of their own: TmuxOptions and TmuxHooks.

Anything tmux can do to a window that is not here is reachable through ExecuteCommandAsync(), which runs one raw command against this window.

Properties24

Window properties
NameTypeDescription
Session Session Gets the session this window was read through.
Server Server Gets the server that owns this window.
Panes CapturedRelation<Pane> Gets the panes the capture found in this window.
Id WindowId Gets the window identifier.
Name string Gets the window name captured with this handle.
Height int Gets the window height captured with this handle.
Width int Gets the window width captured with this handle.
Options TmuxOptions Gets the options of this window.
Index int Gets the index this window holds in its session.
Hooks TmuxHooks Gets the hooks of this window.
ActivePane CapturedValue<Pane> Gets the captured active pane, or an uncaptured relation.
LinkedSessions CapturedRelation<Session> Gets the sessions the capture found this window linked into.
Layout string Gets the layout string captured with this handle.
Active bool Gets whether this is the current window of the session it was read through.
ActivityAlert bool Gets whether the window printed since it was last the current window.
BellAlert bool Gets whether a bell rang in the window since it was last the current window.
Edge SessionWindowEdge Gets where this window sits in the session it was read from.
EntityKey WindowEntityKey Gets the session, window and index this handle names together.
Flags string Gets the window's flags as its status line shows them, such as * for the current window.
Generation ServerGeneration Gets the server generation captured with this window.
IsActive bool Gets whether this captured placement is the selected window in its session.
RawFormatFields IReadOnlyDictionary<string, string?> Gets the tmux fields captured when this handle materialized.
SilenceAlert bool Gets whether the window has been silent for monitor-silence seconds.
Zoomed bool Gets whether one of the window's panes is zoomed to fill it.

Members30 members

Collections and queries2

Common operations20

Other members8

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 C#
C# LibTmux.Window
Represents an immutable window handle and snapshot.
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.
Kotlin io.github.libtmux.kotlin.Window
A tmux window at a specific position in a session.
None recorded in the model
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
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