LibTmux.Get-TmuxSession
Read sessions with optional exact selectors.
Source and package
- Qualified name
-
LibTmux\ Get-Tmux Session - Declared in
LibTmux- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/GetTmuxSessionCommand.cs
- Get-TmuxSession [-Server] <Lib
Tmux > [-Id <System.Server .String >] [-Name <System.String >] [<CommonParameters >] -
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.SessionthatGet-TmuxSessionreturns. 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-TmuxSessionlists every session on a server, or the ones that match an exact id or name.Get-TmuxSnapshotcaptures sessions with their windows and panes, andGet-TmuxClientAttachmentresolves the session a client is viewing.- Filtering and querying sessions
Select-TmuxSessionfilters sessions you already captured without contacting tmux, and can require exactly one match.New-TmuxQuerybuilds criteria for theSessiontarget andGet-TmuxQueryFieldlists the fields they accept.Invoke-TmuxQueryacquires fresh sessions instead.- Creating a session
New-TmuxSessioncreates 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-TmuxSessionnames the session by id and, with PassThru, returns a replacement that carries the new name.Remove-TmuxSessiondeletes it, and destroys the windows that only it owns. Windows linked into another session survive.- Working inside a session
New-TmuxWindowadds a window, andNew-TmuxWindowLinklinks an existing one into the session.Move-TmuxWindowmoves a window placement to it.Get-TmuxWindowandGet-TmuxPanelist what it holds.- Attaching a terminal
Enter-TmuxSessionattaches your foreground terminal to the session and returns when you detach. Run it outside tmux; it rejects redirected input.- Options, hooks and environment
Get-TmuxOption,Set-TmuxOptionandRemove-TmuxOptionread, write and unset the options of one session.Get-TmuxHook,Set-TmuxHookandRemove-TmuxHookdo the same for its hooks, andInvoke-TmuxHookruns one now.Get-TmuxEnvironment,Set-TmuxEnvironmentandRemove-TmuxEnvironmentmanage its environment table.- Saving a session as a workspace
ConvertTo-TmuxWorkspaceturns a captured session into a workspace declaration without contacting tmux. Capture the session withGet-TmuxSnapshotfirst, 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
-
-
The server whose sessions are read.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
An ordinal, literal session identifier selector.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Completion
ArgumentCompleter("LibTmux.PowerShell.SessionSelectorCompleter")- Validation
ValidateNotNullOrEmpty()
-
An ordinal, literal session name selector.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Completion
ArgumentCompleter("LibTmux.PowerShell.SessionSelectorCompleter")- Validation
ValidateNotNullOrEmpty()
Common parameters 12
PowerShell supplies these parameters. See common parameter behavior for their effects.
-
-Verbose(System.Management ).Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ).Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ).Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ).Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ).Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ).Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String )Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String )Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String )Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String )Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- Returns
-
LibTmux.Session: Native pipeline type for this command.
Examples
Example 1
Listsessions on the existing server identified by$SocketPath. View sourceTerminal window LibTmux\New-TmuxServer -SocketPath $SocketPath | LibTmux\Get-TmuxSession
Recorded calls
source callsThe 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 materialThe tmux commands behind Get-TmuxSession.
tmux C API
task materialThe C declarations in tmux that implement these commands.
Guides
task materialPages that discuss Get-TmuxSession.
- Concepts
In other ports
task equivalenceSource-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.
| Port | API | Differs from PowerShell |
|---|---|---|
| PowerShell | Lib Read sessions with optional exact selectors. | This page |
| Python | libtmux tmux(1) Session [session_manual]. | None recorded in the model |
| Ruby | Lib | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| Julia | Lib | 2 overloads SessionSnapshot holds captured session data. Actions use its SessionRef, a typed identity bound to an observed daemon generation. |
| Erlang | #tmux | None recorded in the model |
| Elixir | Lib An immutable session observation. Attachment retains tmux's client count. | Session is an immutable observation. Fields not captured read as :unloaded. |
| Haskell | Lib 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: 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 One session on one tmux server, as a handle rather than a copy of it. | None recorded in the model |
| Rust | session One tmux session, together with the snapshot it was discovered with. | None recorded in the model |
| Go | tmux 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 One tmux session, as one capture saw it. | readonly |
| Clojure | libtmux 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 A tmux session and its captured windows and properties. | None recorded in the model |
| Scala | io 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# | Lib Represents an immutable session handle and snapshot. | None recorded in the model |
| F# | Lib 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:: 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 | None recorded in the model |
| Perl | Lib Captured session entity | A captured read-only entity; explicit Server operations accept its stable identity. |
| Raku | Lib 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.
| Port | API | Differs from PowerShell |
|---|---|---|
| PowerShell | Lib Read sessions with optional exact selectors. | This page |
| Python | libtmux Sessions contained in server. | None recorded in the model |
| Ruby | Lib Behavior: Live acquisition. | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| Julia | Lib | |
| Erlang | tmux 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 | Lib Returns a materialized session selection without I/O. | Returns a Selection of captured sessions without contacting tmux. |
| Common Lisp | libtmux: 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 Every session on the server, read now. | async |
| Rust | server List every session on the server, preserving any failure. | async |
| Go | tmux Sessions materializes the server's sessions. Failures, including ErrNoServer, remain errors rather than empty results. | None recorded in the model |
| Java | io The sessions this expression matches, captured now. | 2 overloads |
| Clojure | libtmux Acquires captured sessions; acquisition failure throws. | Acquires a new captured graph and returns its session maps; acquisition failure throws. |
| Kotlin | io Every session, captured now. | async2 overloads |
| Scala | io The sessions this expression matches, captured now. | 2 overloads |
| C# | Lib Gets the sessions this handle captured. | None recorded in the model |
| F# | Lib 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:: One snapshot each. | readonly |
| Swift | Server Every session on this server, in tmux's own order. | async |
| OCaml | Libtmux | Reads an immutable array of already captured sessions without I/O. |
| Perl | Lib Return a fresh LibTmux::SessionSelection in captured order. Empty loaded collections yield empty selections; unloaded collections throw. | Reads captured membership locally, preserving order. |
| Raku | Lib Captured sessions in acquisition order; reading performs no I/O. | None recorded in the model |
No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.