Session
A tmux session and its captured windows and properties.
Source and package
- Qualified name
-
io.github .libtmux .kotlin. Session - Package
- io.github.libtmux.kotlin
- Distribution
- io.github.libtmux:libtmux-kotlin
- Source
- libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Session.kt
-
Description
Holds the Java handle privately, so a member here always wins over a same-named catalog-generated extension in
SessionOperations.kt.Companionhosts the generated query field namespace (Session.name,Session.attached, ...).A property or a plain function here reads the capture this handle came from and issues no command. Every
suspendextension asks tmux now, dispatched through theServer's policy.What is on here
The members fall into a few groups:
- Reading the capture
id,nameandattachedread what this capture stored about the session, andserveris theServerit 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
windowslists the session's windows in tmux's order, andactiveWindowandactivePaneare the window tmux had active and the active pane of that window, each null when the capture holds none. All three are pure reads and issue no command.selectWindowmakes a window the active one,nextWindowandpreviousWindowstep to a neighbour with wrap-around, andlastWindowgoes back to the one that was active before.- Changing the session
newWindowcreates a window from a name or aWindowSpecand returns the window tmux made.renamereturns a replacement capture, because this handle keeps its original state.setHistoryLimitsets the scrollback retained by panes created in this session afterwards.detachClientsleaves the session running, andkilltakes 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
Serverholds the global ones, which a session inherits. Each returns a wrapper whose own operations aresuspend.
Members26 members
Parent objects1
- server property
Collections and queries1
- windows property This session's windows, in tmux's order. A pure read of the capture.
Common operations2
- newWindow method Creates a window in this session and returns that exact window.
- environment method This session's own environment, which a process started in it is given on top of the server's.
Other members22
- activePane property The active pane of the active window. A pure read of the capture.
- activeWindow property The window tmux had active in this session. A pure read of the capture.
- asJava property The Java session this wraps: the same object, for a Java API that takes one.
- attached property Whether a client was attached when this was captured.
- Companion module
- detachClients method Detaches every client attached to this session, leaving the session running.
- equals method
- expand method Expands a tmux format in this session's context, and answers with what it came to.
- hashCode method
- hooks method This session's own hooks.
- id property The session's stable id.
- kill method Ends this session.
- lastWindow method Returns to the window that was active before this one.
- name property The session name, which a user may change at any time.
- 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.
- toString method
No members of Session match . The filter searches only this type. Search the whole API.
Order: the accessors that walk the hierarchy, the operations the ports share, then the rest.
Guides
task materialPages that discuss Session.
- Concepts
In other ports
task equivalence 22 other ports mappedSource-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.
| Port | API | Differs from Kotlin |
|---|---|---|
| Kotlin | io A tmux session and its captured windows and properties. | 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 |
| PowerShell | Lib Read sessions with optional exact selectors. | This cmdlet reads and returns shared .NET LibTmux.Session objects. Child windows and panes require further acquisition. |
| 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. |
| 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 |