Core Library0.xAPI reference

Choose documentation 1

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

typealias libtmux-scala

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.

Source and package
Qualified name
io.github.libtmux.scaladsl.Session
Package
io.github.libtmux.scaladsl
Distribution
io.github.libtmux:libtmux-scala_3
Source
libtmux-scala/src/main/scala/io/github/libtmux/scaladsl/Session.scala
opaque type Session = JavaSessionobject Session

Description

A pure read of the capture issues no command; every other operation asks tmux now, blocking the calling thread.

What is on here

The operations fall into a few groups:

Reading the capture
Session.id, Session.name and Session.attached read what this capture stored about the session, and Session.server is the Server it lives on. The id is stable, the name is state a user may change at any time, and a rename or an attach after the capture does not show in it.
Windows and panes
Session.windows lists the session's windows in tmux's order as a Vector, and Session.activeWindow and Session.activePane are the window tmux had active and the active pane of that window, each an Option. All three are pure reads. Session.selectWindow makes a window the active one, Session.nextWindow and Session.previousWindow step to a neighbour with wrap-around, and Session.lastWindow goes back to the one that was active before.
Changing the session
Session.newWindow creates a window from a name, a callback on a builder, or a WindowSpec, and returns the window tmux made. Session.rename returns a replacement capture, because this handle keeps its original state. Session.setHistoryLimit sets the scrollback retained by panes created in this session afterwards. Session.detachClients leaves the session running, and Session.kill takes every window with it.
Options, environment, and hooks
These reach what is set on this session alone: its own options, its own environment, which a process started in it is given on top of the server's, and its own hooks. The Server holds the global ones, which a session inherits.
Formats and refreshing
Session.expand expands a tmux format in this session's context, and Session.refresh takes a new capture to see the session as it is now. It leaves this handle unchanged and returns the new one, and throws if the session is gone from a server that still answers.

Members25 members

Parent objects1

  • server method The server this session lives on.

Collections and queries1

  • windows method This session's windows.

Common operations1

  • newWindow method Creates a window in this session and returns that exact window.

Other members22

  • activePane method The active pane of the active window.
  • activeWindow method The window tmux had active in this session.
  • asJava method The underlying Java session. Opaque wrapping is free, so this never copies scope or state.
  • attached method Whether a client was attached when this was captured.
  • detachClients method Detaches every client attached to this session, leaving the session running.
  • environment method This session's own environment, which a process started in it is given on top of the server's.
  • expand method Expands a tmux format in this session's context, and answers with what it came to.
  • given_CanEqual_Session_Session constant
  • hooks method This session's own hooks.
  • id method The session id, as text, so it can be compared and listed.
  • info method The fields this capture stored.
  • kill method Ends this session.
  • lastWindow method Returns to the window that was active before this one.
  • name method The session name.
  • nextWindow method Moves to the next window in this session, wrapping at the end.
  • options method This session's own options.
  • previousWindow method Moves to the previous window in this session, wrapping at the start.
  • refresh method Takes a new capture and returns this session as it is now.
  • rename method Renames this session and returns its replacement capture.
  • selectWindow method Makes a window of this session the active one.
  • setHistoryLimit method Sets the scrollback retained by panes created in this session.
  • windowCount method How many windows this session holds.

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

Guides

task material

Pages that discuss Session.

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 Scala
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.
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
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
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
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