libtmux Reference MCP Search
On this page

session.Session.fromEnv

View as Markdown

Module
session
Declared in
Session
Package
@libtmux/libtmux
Source
packages/libtmux/src/session.ts
fromEnv ( environment : : Readonly<Record<string, string | undefined>> = process.env ) Promise<Session>
methodstaticasync [source]
methodstaticasync [source]
fromEnv

Resolve the session this process is running inside.

The pane is authoritative: $TMUX's exported session id goes stale when a pane is moved, so the session is looked up through $TMUX_PANE instead.

Examples

const current = await Session.fromEnv();
current.name;

Discussed in Environment

0 declared, 0 inherited

Esc

Type to search.