Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
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

struct libtmux-elixir

Session

An immutable session observation with explicit actions. Attachment retains tmux's client count.

Source and package
Qualified name
LibTmux.Session
Module
LibTmux
Package
libtmux
Source
lib/libtmux/entities.ex
struct LibTmux.Session

Description

What is on here

A Session is a value captured in a LibTmux.Snapshot. Relationship functions read the snapshot you pass; actions take a LibTmux.Ref and a Server or Control connection. Start with these groups:

Finding the session
Select sessions from a captured snapshot, or look one up by its exact ID. Neither contacts tmux. An ID that was not captured returns {:error, error} with kind :not_found. Turn the session into a reference tied to the server incarnation that supplied it, ready for an action.
Looking inside a session
Read windows, panes and the active window from the snapshot, without I/O. A window linked more than once appears once, and a covered empty relation returns an empty selection. An invalid or stale identity, or a relationship the snapshot did not capture, raises LibTmux.Error. For per-session window indexes use LibTmux.Snapshot.related/4 with :window_links.
Windows
Panes
Focused
Creating a window
Create a named detached window in the session through one-shot execution. The completed value holds the new ID with ref: nil; capture a fresh observation to obtain a reference. A Control connection is unsupported, and a missing server is not started.
Create
Raise on failure
Renaming
Rename the session through a Server or a Control connection. A name holds 1..1024 UTF-8 bytes with no control characters, and tmux still normalizes it. Observations you already hold keep the old name.
Rename
Raise on failure
Killing
Kill the session and the windows and panes only it holds, through a Server. A Control connection returns unsupported_transport. Killing the last session ends a server that exits when empty.
Kill
Raise on failure

Members15 members

Collections and queries2

  • windows/2 function Returns a selection of captured physical windows in first-link order.
  • panes/2 function Returns a selection of captured physical panes in numeric pane-ID order.

Common operations5

Other members8

Order: the accessors that walk the hierarchy, the operations the ports share, then the rest.

In other ports

task equivalence 22 other ports mapped

Source-verified mappings for A tmux session. 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 Elixir
Elixir LibTmux.Session
An immutable session observation with explicit actions. Attachment retains tmux's client count.
This page
Python libtmux.Session
tmux(1) Session [session_manual].
None recorded in the model
Ruby LibTmux::Session
A session on one server, reached through a handle that wraps an EntityRef. A handle never caches state: each method runs one tmux command, and Entity#snapshot reads the session back as a record. Methods take timeout: and cancel:, and raise CommandError when tmux rejects the command. A listing that fails raises, so an empty array means tmux answered with nothing to list.
None recorded in the model
Lua libtmux.Session None recorded in the model
PowerShell LibTmux\Get-TmuxSession
Read sessions with optional exact selectors.
This cmdlet reads and returns shared .NET LibTmux.Session objects. Child windows and panes require further acquisition.
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
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
Esc
Search in

Type to search.

Reference previewOpen reference