tmuxtmuxCLI manual

Choose documentation 1

latest

tmux manual version

Latest (3.7c) 3.7c 3.2a
English

tmux list-sessions

command tmux 3.7c

List all sessions managed by the server.

Syntax

tmux list-sessions [-r] [-F format] [-f filter] [-O order]

Alias: ls.

Behavior

List all sessions managed by the server. -F specifies the format of each line and -f a filter. Only sessions for which the filter is true are shown. See the FORMATS section. -O specifies the sort order: one of ‘index’, ‘name’, ‘creation’ (time), or ‘activity’ (time). -r reverses the sort order.

Guides

C implementation

Internal declarations in tmux 3.7c:

Use from a library

These methods send list-sessions. Each describes its own defaults, errors and execution model.

Library methods that send tmux list-sessions, by scope
Language Methods
Python Server.is_alive Server.raise_if_dead Server.search_sessions Server.sessions Session.from_session_id Session.refresh Window.linked_sessions
Ruby Async::Server#list_sessions Async::Server#snapshot LibTmux::Server#list_sessions LibTmux::Server#snapshot
Lua Server:snapshot
PowerShell Get-TmuxSession
Julia snapshot
Erlang fetch/1 fetch/2 snapshot/1 snapshot/2
Elixir Capture.fetch/2 Server.snapshot!/2 Server.snapshot/2
TypeScript main
Rust Server.check_alive
Go Client.ResolveAttachment Server.CheckAlive Server.IsAlive Server.SearchSessions Server.Session Server.SessionByName Server.Snapshot Session.Refresh
Java Server.sessions
Clojure find-session! snapshot!
Kotlin Server.sessions
Scala cats.Server.sessions scaladsl.Server.sessions
C# Client.GetAttachedSessionAsync Server.CaptureSnapshotAsync Server.GetAttachedSessionsAsync Server.GetSessionsAsync Server.IsAliveAsync Server.SearchSessionsAsync Server.ThrowIfDeadAsync Window.GetLinkedSessionsAsync
C++ Server::check_alive Server::sessions
Swift Server.isRunning() Server.sessions() Server.sessions(where:)
OCaml capture capture
Perl Async::Server::clients Async::Server::listings kind is session Async::Server::new_session after accepted creation Async::Server::new_window after accepted creation Async::Server::query_panes Async::Server::snapshot Async::Server::split_pane after accepted creation LibTmux::Server::clients LibTmux::Server::listings kind is session LibTmux::Server::new_session after accepted creation LibTmux::Server::new_window after accepted creation LibTmux::Server::query_panes LibTmux::Server::snapshot LibTmux::Server::split_pane after accepted creation
Raku ClientRef.inspect Connection.query session/group query or full graph Connection.query-async session/group query or full graph Connection.query-panes relationship predicates require a full graph Connection.snapshot Connection.snapshot-async PaneRef.inspect Server.has-session Server.query session/group query or full graph Server.query-async session/group query or full graph Server.query-panes relationship predicates require a full graph Server.query-sessions Server.query-window-links relationship predicates require a full graph Server.query-windows relationship predicates require a full graph Server.snapshot Server.snapshot-async SessionRef.inspect WindowRef.inspect

No method in Haskell, Common Lisp, or F# sends this command itself.

tmux sources and license

Syntax comes from tmux 3.7c list-commands. See the global options for sockets and configuration, and command syntax and targets.

Behavior is taken from the tmux 3.7c manual.

Command declaration

Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Esc

Type to search.

Reference previewOpen reference