Core Library0.xAPI Reference

Choose documentation 3

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.

class libtmux-ts latest

Session

One session on one tmux server, as a handle rather than a copy of it.

Source and package
Qualified name
Session
Module
session
Package
libtmux
Source
packages/libtmux/src/session.ts
Other languages
PowerShellcmdlet Juliastruct Elixirstruct PythonRubyLuaRustGoJavaC#C++SwiftKotlinScalaF#module
class session.Session

Description#

Reached from Server.sessions() or by creating one; the constructor throws. The tmux format row the handle was built from reads back through format, and by tmux's own field names directly on the handle — a snapshot taken when the handle was made, not a live view.

A session outlives the clients attached to it: killing the last client leaves the session running, which is the property the whole tool is built around.

Members32#

Parent objects1#

  • server: Server attribute The server this handle addresses.

Collections and queries2#

  • windows method Windows placed in this session, in listing order.
  • panes method Panes contained by this session's windows.

Common operations25#

  • newWindow method Create a window in this session and resolve it as a handle.
  • kill method Destroy this session.
  • rename method Rename this session.
  • showHooks method Every hook this session reports.
  • showOptions method Every option set on this session itself, not the ones it inherits.
  • showEnvironment method Every variable in this session's environment.
  • detach method Detach every client attached to this session.
  • activeWindow method The window tmux marks active in this session.
  • setOption method Set an option on this session.
  • unsetOption method Remove an option from this session.
  • setHook method Bind a tmux command to a hook on this session.
  • setEnvironment method Set a variable in this session's environment.
  • unsetEnvironment method Drop a variable from this session's environment entirely.
  • activePane method The pane tmux marks active in this session's active window.
  • refreshed method This session, read again at a new instant.
  • unsetHook method Remove a hook from this session.
  • removeEnvironment method Mark a variable in this session's environment for removal from the environment of processes tmux starts, leaving the entry in place.
  • selectWindow method Select the last, next, or previous window, or one named by target.
  • cmd method Run a tmux command this package does not model, addressed at this session.
  • fromEnv method Resolve the session this process is running inside.
  • getEnvironment method One variable from this session's environment, or undefined when tmux carries no entry.
  • equals method Whether other is this same session on this same server.
  • plan method The same mutations, described instead of run.
  • sameTmuxIdAs method Whether other carries the same $n, wherever it came from.
  • showResolvedOptions method The option values that govern this session, own and inherited together.

Other members4#

Guides#

Pages that discuss Session.

Topics

In other ports#

A tmux session

Equivalents of A tmux session in other languages
Language Equivalent
Python libtmux.Session
Ruby LibTmux::Session
Lua libtmux.Session
PowerShell LibTmux\Get-TmuxSession 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.
Elixir LibTmux.Session Session is an immutable observation. Fields not captured read as :unloaded.
Rust session.Session
Go tmux.Session
Java io.github.libtmux.Session
Kotlin io.github.libtmux.kotlin.Session
Scala io.github.libtmux.scaladsl.Session
C# LibTmux.Session
F# LibTmux.FSharp.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
Swift Session
Esc

Type to search.

Reference previewOpen reference