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

function libtmux-fsharp

Server.windows

Queries window placements across all sessions.

Source and package
Qualified name
LibTmux.FSharp.Server.windows
Namespace
LibTmux.FSharp
Declared in
Server
Package
LibTmux.FSharp
Source
src/LibTmux.FSharp/Hierarchy.fsi
F# value signaturesDeclares the name and type of a value or function in a signature.Language documentation windows: server: LibTmux.Server -> Query<LibTmux.Window>

Description

A linked window appears once for each session it is linked into.

Parameters

Examples

Read current scalar listings from a private server. Each detached session has one window and pane; no clients are attached. Use Linux or macOS with tmux 3.3a or newer, the .NET 10 SDK or newer, and the .NET 8 and 10 runtimes. In an empty directory, save this project as Example.fsproj. It references the 0.1.1 release of LibTmux.FSharp on NuGet: View source

Example.fsproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitLibraryPacksFolder>true</DisableImplicitLibraryPacksFolder>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
<PackageReference Include="FSharp.Core" Version="[10.1.303]" />
<PackageReference Include="LibTmux.FSharp" Version="[0.1.1]" />
</ItemGroup>
</Project>

Save this complete program as Program.fs. It creates a private server with LibTmux.Server.CreateOwnedAsync; use! disposes owned scopes after success, cancellation or failure. The F# facade has no separate server constructor. View source

Program.fsComplete program
// fsharp-snippet: ServerListings
open System
open System.IO
open System.Threading
open LibTmux
open LibTmux.FSharp
let runAsync () =
task {
use deadline = new CancellationTokenSource(TimeSpan.FromSeconds 10.)
let token = deadline.Token
let socketRoot = Directory.CreateTempSubdirectory "libtmux-example-"
use _cleanup =
{ new IDisposable with
member _.Dispose() = socketRoot.Delete true
}
let options =
ServerConnectionOptions(
SocketPath = Path.Combine(socketRoot.FullName, "tmux.sock"),
ConfigurationFile = "/dev/null"
)
use! owned = options |> Server.createOwned token
use! _demo =
owned.Value.CreateOwnedSessionAsync(
NewSessionRequest(Name = "demo", WindowName = "shell", Command = "/bin/sh"),
token
)
use! _worker =
owned.Value.CreateOwnedSessionAsync(
NewSessionRequest(Name = "worker", WindowName = "jobs", Command = "/bin/sh"),
token
)
let server = owned.Value
let! sessions = server |> Server.sessions |> Query.list token
let! windows = server |> Server.windows |> Query.list token
let! panes = server |> Server.panes |> Query.list token
let! clients = server |> Server.clients |> Query.list token
for session in sessions do
printfn "Session: %s (%O)" session.Name session.Id
printfn "Windows: %d; panes: %d; clients: %d" windows.Count panes.Count clients.Count
}
runAsync().GetAwaiter().GetResult()
// endfsharp-snippet

Build the project and run both supported frameworks. Each program checks its result and exits unsuccessfully after an unhandled error:

Terminal window
$ dotnet build Example.fsproj --configuration Release && \
dotnet bin/Release/net8.0/Example.dll && \
dotnet bin/Release/net10.0/Example.dll

Expected program output from each framework:

Session: demo ($0)
Session: worker ($1)
Windows: 2; panes: 2; clients: 0

Recorded calls

source calls
No call edges in the F# model.

The F# reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux.FSharp.Server.windows.

Guides

task material

Pages that discuss windows.

In other ports

task equivalence 21 other ports mapped

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

List the server's windows in each port
PortAPIDiffers from F#
F# LibTmux.FSharp.Server.windows
Queries window placements across all sessions.
This page
Python libtmux.Server.windows
Windows contained in server's sessions.
None recorded in the model
Ruby LibTmux::Server#list_windows
Behavior: Live acquisition.
None recorded in the model
Lua libtmux.Snapshot.windows None recorded in the model
PowerShell LibTmux\Get-TmuxWindow
Read contextual windows from a server or session.
2 overloads
Use the -Server parameter set to acquire window placements across all sessions.
Julia LibTmux.windows 2 overloads
windows with a Snapshot reads every captured physical window. Use windowlinks for session placements.
Erlang tmux_snapshot:windows/1
Return unique captured physical windows in numeric ID order. Performs no I/O. Use window_links/1 for session-relative membership and indexes.
Returns unique captured physical windows. window_links/1 lists session memberships.
Elixir LibTmux.Snapshot.windows/1
Returns a materialized physical window selection without I/O.
Returns a Selection of every captured physical window. window_links/1 lists session placements.
Common Lisp libtmux:windows
Return a fresh vector of captured windows, without I/O. Snapshot windows are physical entities in first-occurrence order. Session windows contain one item per link and preserve repeated physical windows.
3 overloads
windows on a snapshot returns captured physical windows once each.
TypeScript server.Server.windows
Every window on the server, including each placement of a linked window.
async
Rust server.Server.windows
List every window on the server, preserving any failure.
async
Go tmux.Server.Windows
Windows materializes one record per winlink. Failures, including ErrNoServer, remain errors rather than empty results.
None recorded in the model
Java io.github.libtmux.Server.windows
Captures every winlink, preserving each session and index placement.
3 overloads
Clojure libtmux.core/windows!
Acquires captured window occurrences.
Acquires a new graph and returns its window placements without deduplicating linked windows.
Kotlin io.github.libtmux.kotlin.Server.windows
Captures every winlink, preserving each session and index placement.
async3 overloads
Scala io.github.libtmux.scaladsl.Server.windows
Captures every winlink, preserving each session and index placement.
3 overloads
C# LibTmux.Server.Windows
Gets the windows this handle captured, across every session.
None recorded in the model
C++ libtmux::Server::windows
tmux scopes window and pane listings to the current session unless asked for every one, so -a is part of the request rather than a caller's responsibility to remember.
readonly
Swift Server.windows()
Every window on this server, in tmux's own order.
async
OCaml Libtmux.Snapshot.windows
Reads captured global windows; use window_links for indexed session placements.
Perl LibTmux::Snapshot::windows
Return a fresh LibTmux::WindowSelection containing each physical window identity once. Context lives in "window_links".
One entry per physical identity. window_links retains all session placements.
Raku LibTmux::Model::Snapshot.windows
Captured physical windows, unique by daemon-scoped identity.
Physical windows occur once; window-links preserves placements.
No Haskell equivalent.

No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.

Esc
Search in

Type to search.

Reference previewOpen reference