Window
Represents an immutable window handle and snapshot.
Source and package
- Qualified name
-
LibTmux. Window - Namespace
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux/Window.cs
-
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.
- IdentityRawRe-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
TmuxObjectNotFoundExceptionwhen tmux reports none. A window can be linked into several sessions, so reading its sessions reports every one rather than a single parent. - SearchCaptured
- Finding a pane
- Read one pane of this window by a string target. The Get method throws
TmuxObjectNotFoundExceptionwhen this window has no such pane; the Find method answersnull. - GetFind
- 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-sizeoption to manual, so it stops following its clients. - ArrangeSelect a pane
- 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:
TmuxOptionsandTmuxHooks.
Anything tmux can do to a window that is not here is reachable through
ExecuteCommandAsync(), which runs one raw command against this window.
Properties24
| Name | Type | Description |
|---|---|---|
| Session | Session | Gets the session this window was read through. |
| Server | Server | Gets the server that owns this window. |
| Panes | Captured | Gets the panes the capture found in this window. |
| Id | Window | 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 | Tmux | Gets the options of this window. |
| Index | int | Gets the index this window holds in its session. |
| Hooks | Tmux | Gets the hooks of this window. |
| ActivePane | Captured | Gets the captured active pane, or an uncaptured relation. |
| LinkedSessions | Captured | 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 | Session | Gets where this window sits in the session it was read from. |
| EntityKey | Window | 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 | Server | Gets the server generation captured with this window. |
| IsActive | bool | Gets whether this captured placement is the selected window in its session. |
| RawFormatFields | IRead | 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
- GetPanesAsync Reads this window's panes from tmux.
- SearchPanesAsync Runs a tmux-side filter over this window's panes.
Common operations20
- SelectLayoutAsync Applies a layout to this window.
- KillAsync Stops this window.
- RenameAsync Renames this window.
- LinkAsync Links this window into another session.
- UnlinkAsync Removes this window's link to the session it was read through.
- SelectAsync Selects this window in its session.
- MoveAsync Moves this window to another index or session.
- SplitPaneAsync Splits a pane in this window.
- ResizeAsync Resizes this window.
- RotateAsync Rotates the panes in this window.
- RespawnAsync Restarts the command running in this window.
- SwapAsync Swaps this window with another.
- SelectNextLayoutAsync Moves to the next layout.
- RefreshAsync Re-reads this window from tmux.
- SelectPreviousLayoutAsync Moves to the previous layout.
- SelectLastPaneAsync Selects the pane that was last active.
- DisplayMessageAsync Shows a message on the client viewing this window.
- SelectPaneAsync Selects a pane in this window.
- FromEnvironmentAsync Returns the window holding the pane this process runs in.
- FindPaneAsync Reads one pane in this window.
Other members8
- CreatePaneAsync Creates a floating pane in this window.
- CreateWindowAsync Creates a window next to this one.
- Equals
- ExecuteCommandAsync Executes one raw tmux command against this window.
- GetActivePaneAsync Reads from tmux this window's active pane.
- GetHashCode
- GetLinkedSessionsAsync Reads every session this window is linked into.
- GetPaneAsync Reads one pane in this window, throwing when it is absent.
No members of Window 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 Window.
- Concepts
- Guides
In other ports
task equivalence 22 other ports mappedSource-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.
| Port | API | Differs from C# |
|---|---|---|
| C# | Lib Represents an immutable window handle and snapshot. | This page |
| Python | libtmux tmux(1) Window [window_manual]. | None recorded in the model |
| Ruby | Lib | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| PowerShell | Lib 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 | Lib | 2 overloads WindowSnapshot holds captured physical-window data. WindowLink records a placement in a session; actions use WindowRef. |
| Erlang | #tmux | A physical window can have several session memberships. window_link holds the session-relative index and active flag. |
| Elixir | Lib An immutable physical window, independent of session membership and index. | Window is a physical window. WindowLink records its session index and active state. |
| Haskell | Lib 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: A physical window shared by zero or more captured links. | window is a physical captured window. window-link preserves each session placement. |
| TypeScript | window One window on one tmux server, as a handle rather than a copy of it. | None recorded in the model |
| Rust | window One tmux window, as reached through one session that links it. | None recorded in the model |
| Go | tmux 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 One tmux window at one of its positions, as one capture saw it. | readonly |
| Clojure | libtmux 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 A tmux window at a specific position in a session. | None recorded in the model |
| Scala | io 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# | Lib 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:: 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 | A global window can have several session placements. Window_link holds the session, index and current flag. |
| Perl | Lib Captured window entity | Physical window identity. WindowLink owns each session/index placement. |
| Raku | Lib Captured physical window; session-relative indices belong to WindowLink. | A physical window may have multiple WindowLink placements, including distinct indexes in one session. |