# LibTmux::Session

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Session.pm#L1
- **Bases:** [`LibTmux::Entity`](/en/perl/latest/reference/libtmux-entity/)
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-session/

```
package LibTmux::Session;
```

Captured session entity


## OWNERSHIP

Readers use the retained graph and never refresh it. Acquire a new snapshot for new state. Inherited [`to_record`](/en/perl/latest/reference/libtmux-entity-to_record/) exports a detached scalar record.



## Members

### Common operations

- [`id`](/en/perl/latest/reference/libtmux-session-id/) (method): string. Local captured data; no I/O.
- [`name`](/en/perl/latest/reference/libtmux-session-name/) (method): string. Local captured data; no I/O.
- [`attached`](/en/perl/latest/reference/libtmux-session-attached/) (method): integer. Local captured data; no I/O.
- [`created`](/en/perl/latest/reference/libtmux-session-created/) (method): integer. Local captured data; no I/O.
- [`path`](/en/perl/latest/reference/libtmux-session-path/) (method): bytes. Local captured data; no I/O.

### Other members

- [`window_links`](/en/perl/latest/reference/libtmux-session-window_links/) (method): [`LibTmux::Selection`](/en/perl/latest/reference/libtmux-selection/) of [`LibTmux::WindowLink`](/en/perl/latest/reference/libtmux-windowlink/) entities. Local captured data; no I/O.

## Inherited members

- [`generation`](/en/perl/latest/reference/libtmux-session-generation/) (method), inherited from `LibTmux::Entity`: Return the captured generation. Restarted daemons cannot silently reuse this handle.
- [`identity`](/en/perl/latest/reference/libtmux-session-identity/) (method), inherited from `LibTmux::Entity`: Return an opaque identity key scoped by server, generation, kind, and string ID. It is suitable for local equality; duplicate selection occurrences remain separate occurrences.
- [`kind`](/en/perl/latest/reference/libtmux-session-kind/) (method), inherited from `LibTmux::Entity`: Return the schema entity-kind string. Concrete public field readers belong to [`LibTmux::Pane`](/en/perl/latest/reference/libtmux-pane/), [`LibTmux::Window`](/en/perl/latest/reference/libtmux-window/), [`LibTmux::WindowLink`](/en/perl/latest/reference/libtmux-windowlink/), [`LibTmux::Session`](/en/perl/latest/reference/libtmux-session/), and [`LibTmux::Client`](/en/perl/latest/reference/libtmux-client/).
- [`server_id`](/en/perl/latest/reference/libtmux-session-server_id/) (method), inherited from `LibTmux::Entity`: Return the captured server scope. No daemon discovery or refresh occurs.
- [`to_record`](/en/perl/latest/reference/libtmux-session-to_record/) (method), inherited from `LibTmux::Entity`: Return a fresh hash reference of captured scalar fields and adjacency IDs. Editing it does not change the retained graph. Retaining the entity retains its captured graph, with no transport ownership or reference cycle.

## In other ports

A tmux session

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session`](/en/py/latest/reference/libtmux-session/) (class) |
| Ruby | [`LibTmux::Session`](/en/ruby/latest/reference/libtmux-session-nvps/) (class) |
| Lua | [`libtmux.Session`](/en/lua/latest/reference/libtmux-session/) (class) |
| PowerShell | [`LibTmux\Get-TmuxSession`](/en/powershell/latest/reference/libtmux-get-tmuxsession/) (cmdlet). This cmdlet reads and returns shared .NET `LibTmux.Session` objects. Child windows and panes require further acquisition. |
| Julia | [`LibTmux.SessionSnapshot`](/en/julia/latest/reference/libtmux-sessionsnapshot/) (struct). `SessionSnapshot` holds captured session data. Actions use its `SessionRef`, a typed identity bound to an observed daemon generation. |
| Erlang | [`#tmux_model:session{}`](/en/erlang/latest/reference/tmux_model-session/) (struct) |
| Elixir | [`LibTmux.Session`](/en/elixir/latest/reference/libtmux-session/) (struct). `Session` is an immutable observation. Fields not captured read as `:unloaded`. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Common Lisp | [`libtmux:session`](/en/lisp/latest/reference/libtmux-session-type/) (class). `session` is an immutable captured entity. The same name also has a relation accessor with a distinct public identity. |
| TypeScript | [`session.Session`](/en/ts/latest/reference/session-session/) (class) |
| Rust | [`session.Session`](/en/rs/latest/reference/session-session/) (struct) |
| Go | [`tmux.Session`](/en/go/latest/reference/tmux-session/) (struct) |
| Java | [`io.github.libtmux.Session`](/en/java/latest/reference/io-github-libtmux-session-session/) (class) |
| Clojure | [`libtmux.core/sessions!`](/en/clojure/latest/reference/libtmux-core-sessions/) (function). Acquires a vector of captured session maps. The session value is a map, not a wrapper class. |
| Kotlin | [`io.github.libtmux.kotlin.Session`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-session/) (class) |
| Scala | [`io.github.libtmux.scaladsl.Session`](/en/scala/latest/reference/io-github-libtmux-scaladsl-session/) (typealias) |
| C# | [`LibTmux.Session`](/en/csharp/latest/reference/libtmux-session/) (class) |
| F# | [`LibTmux.FSharp.Session`](/en/fsharp/latest/reference/libtmux-fsharp-session/) (module). 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`](/en/cxx/latest/reference/libtmux-session/) (class) |
| Swift | [`Session`](/en/swift/latest/reference/session/) (struct) |
| OCaml | [`Libtmux.Session.t`](/en/ocaml/latest/reference/libtmux-session-t/) (typealias) |
