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.

property libtmux latest

Server.sessions

Sessions contained in server.

Source and package
Qualified name
libtmux.Server.sessions
Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
Other languages
Perlmethod Erlangfunction PowerShellcmdlet Juliafunction Elixirfunction Haskell Common Lispfunction RubyLuaTypeScriptRustGoJavaC#C++SwiftKotlinScalaOCamlfunction F#function Clojurefunction
sessions (self) → QueryList[Session]

Description#

Can be accessed via .sessions.get() and .sessions.filter()

Returns an empty QueryList when tmux's list-sessions fails for any reason — no running daemon, a missing socket, a permission error, or a subprocess failure. To distinguish "no sessions" from "tmux unreachable", call Server.is_alive() or Server.raise_if_dead().

tmux command#

The tmux commands behind sessions.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss sessions.

Topics

In other ports#

List the server’s sessions

Equivalents of List the server’s sessions in other languages
Language Equivalent
Ruby LibTmux::Server#list_sessions
Lua libtmux.Snapshot.sessions
PowerShell LibTmux\Get-TmuxSession Acquires sessions through -Server, with optional exact -Id and -Name selectors.
Julia LibTmux.sessions sessions reads membership from a captured Snapshot without contacting tmux.
Erlang tmux_snapshot:sessions/1 Returns captured rows without tmux I/O.
Elixir LibTmux.Snapshot.sessions/1 Returns a Selection of captured sessions without contacting tmux.
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Common Lisp libtmux:sessions sessions returns a fresh vector from a captured snapshot without contacting tmux.
TypeScript server.Server.sessions
Rust server.Server.sessions
Go tmux.Server.Sessions
Java io.github.libtmux.Server.sessions
Clojure libtmux.core/sessions! Acquires a new captured graph and returns its session maps; acquisition failure throws.
Kotlin io.github.libtmux.kotlin.Server.sessions
Scala io.github.libtmux.scaladsl.Server.sessions
C# LibTmux.Server.Sessions
F# LibTmux.FSharp.Server.sessions 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
Swift Server.sessions()
OCaml Libtmux.Snapshot.sessions Reads an immutable array of already captured sessions without I/O.
Perl LibTmux::Snapshot::sessions Reads captured membership locally, preserving order.
Esc

Type to search.

Reference previewOpen reference