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.
Source and package
- Qualified name
-
tmux.Session - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/model.go
- Other languages
- Perlclass ErlangPowerShellcmdlet Juliastruct Elixirstruct Haskell Common Lispclass PythonRubyLuaTypeScriptRustJavaC#C++SwiftKotlinScalaOCamlF#module Clojurefunction
-
Description#
What is on here
A Session is a record read at one moment, and the methods that act on tmux address the session by its stable
SessionID. They fall into the groups below.- Identity and refreshing
- A record does not update:
Session.Refreshlooks the session up again by its stableSessionIDand returns a new record, leaving the receiver as it was.SessionFromEnvfinds the session that holds the environment's pane. Equality compares the stable ID and the tmux server that produced the record. - Reach
- Fields on the record
- The typed accessors read tmux's session formats from the record in hand and never query tmux. Each returns false as its second result when the value is absent, empty, or malformed, and some formats need tmux 3.6 or later. The raw expansions come back as a
FormatValues, whereFormatValues.Rawtells an absent field from a present empty one. - Name and timeAttached clientsRaw
- Windows and panes
- A record from a snapshot holds its windows and panes, and reading them queries nothing; a record from a lookup, a refresh, or
Server.NewSessioncarries no relations and reports false. The resolvers read live state and the search methods ask tmux, and a search takes aTmuxFilter, where nil omits tmux's -f expression. A window made or selected here comes back freshly materialized, and selecting one is session-scoped: it makes no promise about clients attached to other sessions. - Held by the recordRead liveSearchCreate
- Running a command
- Run starts a command in a new window with a terminal, waits for it, and returns its exit status and the screen it left; a nonzero status is a result, not an error. Start returns once the command is under way, and if the
Runningit returns is never waited on, the window it created is never removed. Cmd instead sends a raw tmux subcommand targeted at the session. - Renaming and ending
- Rename returns a new record, and it rejects an invalid name before running tmux with an error matching
ErrInvalidRequest. Killing the session removes its winlinks and detaches ordinary attached clients, destroying any window left with no links; a window kill removes one window from every session it is linked into. KillWith can instead destroy every other session or only clear alerts. A completed kill is aCommandErroronly when it wrote to stderr, so a nonzero exit without stderr is ignored. - Options, hooks, and environment
- Typed reads include inherited values, and a failed read is returned rather than answered with zero values. A write by name reaches an option the typed setters do not cover, and each known option has a typed setter that
SessionOptionValuespairs with its accessor. The environment is the session's own, apart from the server's global one: reading one variable reports false for a missing or hidden entry, and unsetting deletes an entry where removing marks it for removal from the environment of new processes. - Write optionsTyped setters, for exampleWrite hooks
- Clients and connections
- Attach hands the caller's terminal to the session and blocks until detach or context cancellation. The other client methods act on every client attached to the session, except one that switches tmux's current client to it. Opening control mode needs tmux 3.7 and returns a
Connectionthat the caller must close; a session already bound to a connection can open neither another nor a notification stream. - TerminalEvery attached clientCurrent clientControl mode
Members132#
Parent objects1#
- Server method Server returns the immutable configured handle that produced the session.
Collections and queries4#
- Windows method Windows returns newly allocated shallow copies of this snapshot record's winlink views, and reports whether the receiver carries relations at all.
- Panes method Panes returns newly allocated shallow copies of this snapshot record's pane views, and reports whether the receiver carries relations at all.
- SearchWindows method SearchWindows returns this session's winlinks selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. The session's stable identity limits the projection.
- SearchPanes method SearchPanes returns this session's pane views selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. The session's stable identity limits the projection.
Common operations42#
- NewWindow method NewWindow creates a winlink in the receiver session. Attach selects it as that session's current window; it is not a guarantee about clients attached to other sessions. The returned
Windowis freshly materialized in the receiver's exact session context, including when its stableWindowIDis linked elsewhere. - Kill method Kill destroys the receiver session and removes its winlinks. Ordinary attached clients detach; on tmux 3.6 or later, clients carrying no-detach-on-destroy move to another session when one exists. A window with no remaining links and all of that window's panes are also destroyed. The materialized receiver is not refreshed. Only stderr makes a completed command a
CommandError; nonzero exits without stderr are ignored. Transport errors are delivery-ambiguous. Kill is equivalent toSession.KillWithwith a zeroSessionKillRequest. - Rename method Rename changes the receiver session's name and returns a canonical freshly materialized
Session. If the command succeeds but refresh fails, it returns the receiver with that error. A transport or context error can be delivery-ambiguous; no rollback is attempted. Invalid names are rejected before execution and matchErrInvalidRequest. - Hooks method Hooks returns a freshly decoded, caller-owned view of known hooks at this stable session target, including inherited values. A read failure is returned rather than answered with zero values.
- ID method ID returns the stable tmux identity of this session.
- Name method Name returns tmux #{session_name} as string from this Session's materialized session-scoped fields.
- Attached method Attached returns tmux #{session_attached} as int from this Session's materialized session-scoped fields.
- Options method Options returns a freshly decoded, caller-owned view of known options at this stable session target, including inherited values. A read failure is returned rather than answered with zero values; context errors propagate. Each returned accessor names the setter that writes it, so
SessionOptionValues.Mousepairs withSession.SetMouse. - SetOption method SetOption stores a session option at this stable session target without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.
- UnsetOption method UnsetOption unsets a session option at this stable session target without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.
- SetHook method SetHook stores a session hook at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.
- ShowEnvironment method ShowEnvironment returns an owned session-scoped non-hidden tmux environment. Completed command failures return an empty map unless strict errors are enabled. Externally injected multiline entries return ErrMalformedEnvironment because tmux's multi-entry output does not frame continuation lines. Decode errors are compatible with
ErrMalformedEnvironmentand return no partial map. - SetEnvironment method SetEnvironment stores a value in this session's tmux environment, targeted by its stable SessionID.
- UnsetEnvironment method UnsetEnvironment deletes a value from this session's tmux environment, targeted by its stable SessionID.
- RawOption method RawOption returns one exact session option value at this stable session target. A successful string is caller-owned; ok reports presence, and a completed failure is returned rather than normalized. An unindexed empty array is indistinguishable from an empty scalar; use Options for typed array presence.
- Created method Created returns tmux #{session_created} as time.Time from this Session's materialized session-scoped fields.
- DetachClients method DetachClients detaches every client attached to the session identified by this handle's stable ID. A nonnil ShellCommand is run after detaching.
- ActiveWindow method ActiveWindow returns this session's sole active winlink from the materialized snapshot. It never queries tmux; use
Session.ResolveActiveWindowfor live state. - UnsetHook method UnsetHook removes every matching session hook index at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the unset was accepted.
- ActivePane method ActivePane returns the active pane in this session's materialized active window. It never queries tmux; use
Session.ResolveActivePanefor live state. - Refresh method Refresh performs a canonical live lookup without mutating the receiver.
- NextWindow method NextWindow makes the next winlink current in the receiver session and returns that freshly materialized session-specific
Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window. - PreviousWindow method PreviousWindow makes the previous winlink current in the receiver session and returns that freshly materialized session-specific
Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window. - LastWindow method LastWindow makes the receiver session's previously selected winlink current and returns that freshly materialized session-specific
Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window because this navigation operation cannot identify the selected view reliably without refresh. - RemoveEnvironment method RemoveEnvironment marks a variable for removal from new process environments for this stable session target.
- WindowCount method WindowCount returns tmux #{session_windows} as int from this Session's materialized session-scoped fields.
- Path method Path returns tmux #{session_path} as string from this Session's materialized session-scoped fields.
- SelectWindow method SelectWindow makes one winlink current in the receiver session and returns that freshly materialized session-specific
Window. WindowID is combined with the receiver SessionID, because a WindowID alone does not distinguish linked views. The selection is session-scoped; it does not promise focus for clients attached to other sessions. - Cmd method Cmd executes a tmux subcommand targeted to the session's stable ID.
- Lock method Lock locks every client attached to the session identified by this handle's stable ID. Cancellation does not prove that tmux did not lock a client.
- GetEnvironment method GetEnvironment returns one non-hidden session environment entry for this stable session target. A missing or hidden variable reports ok false.
- SetHooks method SetHooks applies indexed session hook commands in ascending order at this handle's stable session target. With ClearExisting it confirms clearing first, stops at the first failure without rollback, and reports confirmed partial progress. Cancellation may follow accepted commands and cannot disprove their delivery.
- RunHook method RunHook asks tmux to run one session hook directly at this stable target. It intentionally performs no racy liveness preflight after validation. Completed failures are secret-safe option errors; cancellation does not prove execution did not occur.
- KillWindow method KillWindow destroys one stable window. When Target and Index are nil it selects the receiver session's current window, and Index selects a winlink in that session. A nonnil Target is forwarded as unrestricted tmux target syntax and may select a window in another session. The selected stable window is removed from every session and its panes are destroyed. Affected sessions preserve their current selection unless this window was current, in which case they select another. A session left without windows is destroyed;
Session.Killdescribes how tmux handles its clients. - SwitchClient method SwitchClient switches tmux's current client to the session identified by this handle's stable ID.
- Group method Group returns tmux #{session_group} as string from this Session's materialized session-scoped fields.
- Grouped method Grouped returns tmux #{session_grouped} as bool from this Session's materialized session-scoped fields.
- LastAttached method LastAttached returns tmux #{session_last_attached} as time.Time from this Session's materialized session-scoped fields.
- ResolveActivePane method ResolveActivePane returns the active pane in this session's active window, read live. It lists that session's panes rather than taking a whole-server snapshot, because a pane row already carries which window is active. It returns
SnapshotLookupErrorcardinality errors, which matchErrNotFoundwhen nothing was found. - OpenControl method OpenControl opens terminal control-mode transport to the receiver's daemon. The returned connection owns its lanes and must be closed. A receiver already bound to a connection cannot be rebound. Acquisition requires tmux 3.7 before any control client is started.
- OpenNotifications method OpenNotifications starts an owned notification stream attached to the receiver. It does not change the receiver's transport or expose control commands. A connection-bound receiver returns
ErrConnectionRequiresProcess. - Run method Run starts command in a new window of this session, waits for it to finish, and reports its exit status and what its terminal showed. It is [os/exec] for a program that needs a terminal: the command runs with a tty, so it sees isatty, colour, and a width, and what comes back is the screen tmux rendered rather than the bytes the program wrote. That screen holds a bounded history; see
RunResult.Lines. For a large output, have the command write it to a file, or follow it withRunning.StreamTo.
Other members85#
- Active method Active returns tmux #{session_active} as bool from this Session's materialized session-scoped fields (tmux 3.6 or later).
- ActiveWindowIndex method ActiveWindowIndex returns tmux #{active_window_index} as int from this Session's materialized session-scoped fields.
- Activity method Activity returns tmux #{session_activity} as time.Time from this Session's materialized session-scoped fields.
- ActivityFlag method ActivityFlag returns tmux #{session_activity_flag} as bool from this Session's materialized session-scoped fields (tmux 3.6 or later).
- Alert method Alert returns tmux #{session_alert} as string from this Session's materialized session-scoped fields (tmux 3.6 or later).
- Alerts method Alerts returns tmux #{session_alerts} as string from this Session's materialized session-scoped fields.
- AppendHook method AppendHook appends a session hook at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.
- AppendOption method AppendOption appends to a session option at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.
- Attach method Attach attaches the caller's terminal to this session's stable identifier and blocks until detach or context cancellation. It validates the receiver's stable SessionID, retains but never closes caller-supplied streams, and returns
CommandErrorfor a completed nonzero exit. Cancellation does not prove attachment or detachment did not occur. SeeServer.AttachSessionfor locale handling and terminal recovery after forced cancellation. - AttachedList method AttachedList returns tmux #{session_attached_list} as string from this Session's materialized session-scoped fields.
- BellFlag method BellFlag returns tmux #{session_bell_flag} as bool from this Session's materialized session-scoped fields (tmux 3.6 or later).
- Equal method Equal reports whether two session records carry the same stable ID and tmux server provenance.
- Format method Format returns tmux #{session_format} as bool from this Session's materialized session-scoped fields.
- Formats method Formats returns this Session's read-only materialized tmux format values. It does not query tmux; use
Server.Snapshotto obtain a fresh record. - GroupAttached method GroupAttached returns tmux #{session_group_attached} as int from this Session's materialized session-scoped fields.
- GroupAttachedList method GroupAttachedList returns tmux #{session_group_attached_list} as string from this Session's materialized session-scoped fields.
- GroupList method GroupList returns tmux #{session_group_list} as string from this Session's materialized session-scoped fields.
- GroupManyAttached method GroupManyAttached returns tmux #{session_group_many_attached} as bool from this Session's materialized session-scoped fields.
- GroupSize method GroupSize returns tmux #{session_group_size} as int from this Session's materialized session-scoped fields.
- KillWith method KillWith applies one kill-session mode without refreshing the materialized receiver. The zero request destroys the receiver; AllExcept destroys every other session while preserving the receiver and its current window; ClearAlerts only clears alerts in windows linked to the receiver and leaves sessions, winlinks, panes, client attachments, and current-window selections unchanged. Destroying a session handles clients as
Session.Killdescribes and removes its winlinks; windows left without links and their panes are also destroyed. Group destroys the receiver's group and requires tmux 3.7; on older versions it followsUnsupportedPolicy. - LastWindowIndex method LastWindowIndex returns tmux #{last_window_index} as int from this Session's materialized session-scoped fields.
- ManyAttached method ManyAttached returns tmux #{session_many_attached} as bool from this Session's materialized session-scoped fields.
- Marked method Marked returns tmux #{session_marked} as bool from this Session's materialized session-scoped fields.
- MarshalJSON method MarshalJSON encodes the session's identity and the format expansions tmux returned for it, under "formats". Nothing decodes: a decoded record would carry no
Server, so it could name a session it could never act on, andjson.Unmarshalinto this type reports no error and changes nothing. - RawHook method RawHook returns one exact session hook value at this stable session target. A successful string is caller-owned; ok reports presence and completed failures are returned. An unindexed empty hook array is ambiguous; use Hooks for typed presence.
- Ref method Ref returns a
Refaddressing the receiver. - ResolveActiveWindow method ResolveActiveWindow snapshots live tmux state and returns this session's sole exact active winlink. It returns
SnapshotLookupErrorcardinality errors. - SetActivityAction method SetActivityAction stores the "activity-action" session option as ActivityAction. Read it with
SessionOptionValues.ActivityActionfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetAssumePasteTime method SetAssumePasteTime stores the "assume-paste-time" session option as time.Duration. Read it with
SessionOptionValues.AssumePasteTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetBaseIndex method SetBaseIndex stores the "base-index" session option as int64. Read it with
SessionOptionValues.BaseIndexfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetBellAction method SetBellAction stores the "bell-action" session option as BellAction. Read it with
SessionOptionValues.BellActionfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDefaultCommand method SetDefaultCommand stores the "default-command" session option as string. Read it with
SessionOptionValues.DefaultCommandfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDefaultShell method SetDefaultShell stores the "default-shell" session option as string. Read it with
SessionOptionValues.DefaultShellfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDefaultSize method SetDefaultSize stores the "default-size" session option as string. Read it with
SessionOptionValues.DefaultSizefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDestroyUnattached method SetDestroyUnattached stores the "destroy-unattached" session option as DestroyUnattached. Read it with
SessionOptionValues.DestroyUnattachedfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDetachOnDestroy method SetDetachOnDestroy stores the "detach-on-destroy" session option as DetachOnDestroy. Read it with
SessionOptionValues.DetachOnDestroyfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDisplayPanesActiveColour method SetDisplayPanesActiveColour stores the "display-panes-active-colour" session option as string. Read it with
SessionOptionValues.DisplayPanesActiveColourfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDisplayPanesColour method SetDisplayPanesColour stores the "display-panes-colour" session option as string. Read it with
SessionOptionValues.DisplayPanesColourfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDisplayPanesTime method SetDisplayPanesTime stores the "display-panes-time" session option as time.Duration. Read it with
SessionOptionValues.DisplayPanesTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetDisplayTime method SetDisplayTime stores the "display-time" session option as time.Duration. Read it with
SessionOptionValues.DisplayTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetFocusFollowsMouse method SetFocusFollowsMouse stores the "focus-follows-mouse" session option as bool (tmux 3.7 or later). Read it with
SessionOptionValues.FocusFollowsMousefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetHistoryLimit method SetHistoryLimit stores the "history-limit" session option as int64. Read it with
SessionOptionValues.HistoryLimitfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetInitialRepeatTime method SetInitialRepeatTime stores the "initial-repeat-time" session option as time.Duration (tmux 3.6 or later). Read it with
SessionOptionValues.InitialRepeatTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetKeyTable method SetKeyTable stores the "key-table" session option as string. Read it with
SessionOptionValues.KeyTablefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetLockAfterTime method SetLockAfterTime stores the "lock-after-time" session option as time.Duration. Read it with
SessionOptionValues.LockAfterTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetLockCommand method SetLockCommand stores the "lock-command" session option as string. Read it with
SessionOptionValues.LockCommandfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetMessageCommandStyle method SetMessageCommandStyle stores the "message-command-style" session option as string. Read it with
SessionOptionValues.MessageCommandStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetMessageFormat method SetMessageFormat stores the "message-format" session option as string (tmux 3.7 or later). Read it with
SessionOptionValues.MessageFormatfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetMessageLine method SetMessageLine stores the "message-line" session option as MessageLine (tmux 3.4 or later). Read it with
SessionOptionValues.MessageLinefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetMessageStyle method SetMessageStyle stores the "message-style" session option as string. Read it with
SessionOptionValues.MessageStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetMouse method SetMouse stores the "mouse" session option as bool. Read it with
SessionOptionValues.MousefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetPrefix method SetPrefix stores the "prefix" session option as string. Read it with
SessionOptionValues.PrefixfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetPrefix2 method SetPrefix2 stores the "prefix2" session option as string. Read it with
SessionOptionValues.Prefix2fromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetPromptCommandCursorStyle method SetPromptCommandCursorStyle stores the "prompt-command-cursor-style" session option as PromptCommandCursorStyle (tmux 3.7 or later). Read it with
SessionOptionValues.PromptCommandCursorStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetPromptCursorColour method SetPromptCursorColour stores the "prompt-cursor-colour" session option as string (tmux 3.6 or later). Read it with
SessionOptionValues.PromptCursorColourfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetPromptCursorStyle method SetPromptCursorStyle stores the "prompt-cursor-style" session option as PromptCursorStyle (tmux 3.6 or later). Read it with
SessionOptionValues.PromptCursorStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetRenumberWindows method SetRenumberWindows stores the "renumber-windows" session option as bool. Read it with
SessionOptionValues.RenumberWindowsfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetRepeatTime method SetRepeatTime stores the "repeat-time" session option as time.Duration. Read it with
SessionOptionValues.RepeatTimefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetSilenceAction method SetSilenceAction stores the "silence-action" session option as SilenceAction. Read it with
SessionOptionValues.SilenceActionfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatus method SetStatus stores the "status" session option as Status. Read it with
SessionOptionValues.StatusfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusBG method SetStatusBG stores the "status-bg" session option as string. Read it with
SessionOptionValues.StatusBGfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusFG method SetStatusFG stores the "status-fg" session option as string. Read it with
SessionOptionValues.StatusFGfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusFormat method SetStatusFormat replaces the complete "status-format" session option array with SparseArray
string, preserving holes and empty values. Read it withSessionOptionValues.StatusFormatfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. Replacement is not atomic: the result reports confirmed writes, and failures stop without rollback. Serialize concurrent replacement of the same target and option. - SetStatusInterval method SetStatusInterval stores the "status-interval" session option as time.Duration. Read it with
SessionOptionValues.StatusIntervalfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusJustify method SetStatusJustify stores the "status-justify" session option as StatusJustify. Read it with
SessionOptionValues.StatusJustifyfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusKeys method SetStatusKeys stores the "status-keys" session option as StatusKeys. Read it with
SessionOptionValues.StatusKeysfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusLeft method SetStatusLeft stores the "status-left" session option as string. Read it with
SessionOptionValues.StatusLeftfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusLeftLength method SetStatusLeftLength stores the "status-left-length" session option as int64. Read it with
SessionOptionValues.StatusLeftLengthfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusLeftStyle method SetStatusLeftStyle stores the "status-left-style" session option as string. Read it with
SessionOptionValues.StatusLeftStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusPosition method SetStatusPosition stores the "status-position" session option as StatusPosition. Read it with
SessionOptionValues.StatusPositionfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusRight method SetStatusRight stores the "status-right" session option as string. Read it with
SessionOptionValues.StatusRightfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusRightLength method SetStatusRightLength stores the "status-right-length" session option as int64. Read it with
SessionOptionValues.StatusRightLengthfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusRightStyle method SetStatusRightStyle stores the "status-right-style" session option as string. Read it with
SessionOptionValues.StatusRightStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetStatusStyle method SetStatusStyle stores the "status-style" session option as string. Read it with
SessionOptionValues.StatusStylefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetTitles method SetTitles stores the "set-titles" session option as bool. Read it with
SessionOptionValues.SetTitlesfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetTitlesString method SetTitlesString stores the "set-titles-string" session option as string. Read it with
SessionOptionValues.SetTitlesStringfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetUpdateEnvironment method SetUpdateEnvironment replaces the complete "update-environment" session option array with SparseArray
string, preserving holes and empty values. Read it withSessionOptionValues.UpdateEnvironmentfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. Replacement is not atomic: the result reports confirmed writes, and failures stop without rollback. Serialize concurrent replacement of the same target and option. - SetVisualActivity method SetVisualActivity stores the "visual-activity" session option as VisualActivity. Read it with
SessionOptionValues.VisualActivityfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetVisualBell method SetVisualBell stores the "visual-bell" session option as VisualBell. Read it with
SessionOptionValues.VisualBellfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetVisualSilence method SetVisualSilence stores the "visual-silence" session option as VisualSilence. Read it with
SessionOptionValues.VisualSilencefromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SetWordSeparators method SetWordSeparators stores the "word-separators" session option as string. Read it with
SessionOptionValues.WordSeparatorsfromSession.Options;Session.UnsetOptionrestores inheritance or the global default. - SilenceFlag method SilenceFlag returns tmux #{session_silence_flag} as bool from this Session's materialized session-scoped fields (tmux 3.6 or later).
- Stack method Stack returns tmux #{session_stack} as string from this Session's materialized session-scoped fields.
- Start method Start runs command in a new window of this session and returns once it is under way, without waiting for it to finish. The returned
Runningreports the pane it runs in and blocks on demand:Running.Waitwaits for the exit status and screenSession.Runwould have returned, andRunning.Killstops the command. Options are exactly Run's. - String method String returns the session's stable ID and queried name.
Guides#
Pages that discuss Session.
In other ports#
A tmux session
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| PowerShell | Lib This cmdlet reads and returns shared .NET LibTmux.Session objects. Child windows and panes require further acquisition. |
| Julia | Lib SessionSnapshot holds captured session data. Actions use its SessionRef, a typed identity bound to an observed daemon generation. |
| Erlang | #tmux |
| Elixir | Lib 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 is an immutable captured entity. The same name also has a relation accessor with a distinct public identity. |
| TypeScript | session |
| Rust | session |
| Java | io |
| Clojure | libtmux Acquires a vector of captured session maps. The session value is a map, not a wrapper class. |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| F# | Lib 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:: |
| Swift | Session |
| OCaml | Libtmux |
| Perl | Lib A captured read-only entity; explicit Server operations accept its stable identity. |