Core Library0.xAPI reference

Choose documentation 2

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

cmdlet libtmux-powershell

LibTmux.Get-TmuxSession

Read sessions with optional exact selectors.

Source and package
Qualified name
LibTmux\Get-TmuxSession
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/GetTmuxSessionCommand.cs

Description

Acquire sessions from a native Server. Id and Name are ordinal, case-sensitive literal selectors; combining them requires both to match. Wildcards are not expanded. An unmatched selector emits nothing; a failed acquisition writes an error.

What is on here. A session is the native LibTmux.Session that Get-TmuxSession returns. The cmdlets below return one, take one directly or from the pipeline, or query for one. They fall into a few groups:

Finding sessions
Get-TmuxSession lists every session on a server, or the ones that match an exact id or name. Get-TmuxSnapshot captures sessions with their windows and panes, and Get-TmuxClientAttachment resolves the session a client is viewing.
Filtering and querying sessions
Select-TmuxSession filters sessions you already captured without contacting tmux, and can require exactly one match. New-TmuxQuery builds criteria for the Session target and Get-TmuxQueryField lists the fields they accept. Invoke-TmuxQuery acquires fresh sessions instead.
Creating a session
New-TmuxSession creates a detached session with its first window and pane, and returns it. It can start a daemon that is not running yet, and an existing name is an error.
Renaming or removing a session
Rename-TmuxSession names the session by id and, with PassThru, returns a replacement that carries the new name. Remove-TmuxSession deletes it, and destroys the windows that only it owns. Windows linked into another session survive.
Working inside a session
New-TmuxWindow adds a window, and New-TmuxWindowLink links an existing one into the session. Move-TmuxWindow moves a window placement to it. Get-TmuxWindow and Get-TmuxPane list what it holds.
Attaching a terminal
Enter-TmuxSession attaches your foreground terminal to the session and returns when you detach. Run it outside tmux; it rejects redirected input.
Saving a session as a workspace
ConvertTo-TmuxWorkspace turns a captured session into a workspace declaration without contacting tmux. Capture the session with Get-TmuxSnapshot first, at the Panes depth, so its windows and panes come with it.

Notes

Wrap results in @() when a stable array is needed. A missing daemon is an error, not a successful empty list. Session-only capture does not acquire windows.

Command details

Command type
cmdlet
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: Native pipeline type for this command.
Outputs
LibTmux.Session
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.Session: Native pipeline type for this command.

Examples

Example 1 List sessions on the existing server identified by $SocketPath. View source

Terminal window
LibTmux\New-TmuxServer -SocketPath $SocketPath | LibTmux\Get-TmuxSession

Recorded calls

source calls
No call edges in the PowerShell model.

The PowerShell 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\Get-TmuxSession.

tmux command

task material

The tmux commands behind Get-TmuxSession.

tmux C API

task material

The C declarations in tmux that implement these commands.

Guides

task material

Pages that discuss Get-TmuxSession.

In other ports

task equivalence

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

A tmux session in each port
PortAPIDiffers from PowerShell
PowerShell LibTmux\Get-TmuxSession
Read sessions with optional exact selectors.
This page
Python libtmux.Session
tmux(1) Session [session_manual].
None recorded in the model
Ruby LibTmux::Session None recorded in the model
Lua libtmux.Session None recorded in the model
Julia LibTmux.SessionSnapshot 2 overloads
SessionSnapshot holds captured session data. Actions use its SessionRef, a typed identity bound to an observed daemon generation.
Erlang #tmux_model:session{} None recorded in the model
Elixir LibTmux.Session
An immutable session observation. Attachment retains tmux's client count.
Session is an immutable observation. Fields not captured read as :unloaded.
Haskell LibTmux.Snapshot.Session
Detached physical session. Navigate its appearances through WindowLink.
Session is a detached physical session. WindowLink records each placement of a window in it, and operations take a generation-bound SessionRef.
Common Lisp libtmux:session
A captured physical tmux session.
session is an immutable captured entity. The same name also has a relation accessor with a distinct public identity.
TypeScript session.Session
One session on one tmux server, as a handle rather than a copy of it.
None recorded in the model
Rust session.Session
One tmux session, together with the snapshot it was discovered with.
None recorded in the model
Go tmux.Session
Session is one materialized tmux session record. It is normally returned by Server.Snapshot, Server.Session, or Session.Refresh. A zero Session is not a usable tmux target.
None recorded in the model
Java io.github.libtmux.Session
One tmux session, as one capture saw it.
readonly
Clojure libtmux.core/sessions!
Acquires captured sessions; acquisition failure throws.
Acquires a vector of captured session maps. The session value is a map, not a wrapper class.
Kotlin io.github.libtmux.kotlin.Session
A tmux session and its captured windows and properties.
None recorded in the model
Scala io.github.libtmux.scaladsl.Session
A captured session, opaque over the Java handle; 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.Session
Represents an immutable session handle and snapshot.
None recorded in the model
F# LibTmux.FSharp.Session
Starts queries confined to one session.
This F# module builds deferred child queries from a shared .NET LibTmux.Session and its server association. Query.list acquires their results from tmux.
C++ libtmux::Session
One session, as one listing saw it.
None recorded in the model
Swift Session
A tmux session, as it was when the listing was read.
None recorded in the model
OCaml Libtmux.Session.t None recorded in the model
Perl LibTmux::Session
Captured session entity
A captured read-only entity; explicit Server operations accept its stable identity.
Raku LibTmux::Model::Session
Captured session with local window-link and group relationships.
None recorded in the model

Source-verified mappings for List the server’s sessions. 21 other ports mapped. 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 sessions in each port
PortAPIDiffers from PowerShell
PowerShell LibTmux\Get-TmuxSession
Read sessions with optional exact selectors.
This page
Python libtmux.Server.sessions
Sessions contained in server.
None recorded in the model
Ruby LibTmux::Server#list_sessions
Behavior: Live acquisition.
None recorded in the model
Lua libtmux.Snapshot.sessions None recorded in the model
Julia LibTmux.sessions
sessions reads membership from a captured Snapshot without contacting tmux.
Erlang tmux_snapshot:sessions/1
Return captured sessions in numeric ID order. Performs no I/O and raises incomplete_snapshot when that collection was not captured.
Returns captured rows without tmux I/O.
Elixir LibTmux.Snapshot.sessions/1
Returns a materialized session selection without I/O.
Returns a Selection of captured sessions without contacting tmux.
Common Lisp libtmux:sessions
Return a fresh vector of physical sessions in captured wire order. No I/O.
2 overloads
sessions returns a fresh vector from a captured snapshot without contacting tmux.
TypeScript server.Server.sessions
Every session on the server, read now.
async
Rust server.Server.sessions
List every session on the server, preserving any failure.
async
Go tmux.Server.Sessions
Sessions materializes the server's sessions. Failures, including ErrNoServer, remain errors rather than empty results.
None recorded in the model
Java io.github.libtmux.Server.sessions
The sessions this expression matches, captured now.
2 overloads
Clojure libtmux.core/sessions!
Acquires captured sessions; acquisition failure throws.
Acquires a new captured graph and returns its session maps; acquisition failure throws.
Kotlin io.github.libtmux.kotlin.Server.sessions
Every session, captured now.
async2 overloads
Scala io.github.libtmux.scaladsl.Server.sessions
The sessions this expression matches, captured now.
2 overloads
C# LibTmux.Server.Sessions
Gets the sessions this handle captured.
None recorded in the model
F# LibTmux.FSharp.Server.sessions
Queries every session.
Builds a deferred session query on LibTmux.Server. Query.list acquires the results; it does not traverse the handle’s captured membership.
C++ libtmux::Server::sessions
One snapshot each.
readonly
Swift Server.sessions()
Every session on this server, in tmux's own order.
async
OCaml Libtmux.Snapshot.sessions
Reads an immutable array of already captured sessions without I/O.
Perl LibTmux::Snapshot::sessions
Return a fresh LibTmux::SessionSelection in captured order. Empty loaded collections yield empty selections; unloaded collections throw.
Reads captured membership locally, preserving order.
Raku LibTmux::Model::Snapshot.sessions
Captured sessions in acquisition order; reading performs no I/O.
None recorded in the model
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