Documentation
¶
Overview ¶
Package tmuxenv identifies the tmux server this process talks to.
Sidecar never passes -L or -S to tmux, and cmd/sidecar/main.go unsets TMUX before anything runs, so every tmux child resolves the *default* socket for the current user under TMUX_TMPDIR (falling back to /tmp). That makes TMUX_TMPDIR the only lever that separates one Sidecar's tmux namespace from another's, and it makes the resolved socket path a faithful identity for "the server whose sessions this process can see".
The identity is computed from the environment rather than from a `tmux display-message` subprocess on purpose: no startup latency, no dependency on tmux being installed, and no flakiness when it is not running.
Values are recomputed on every call (no sync.Once) so tests can move the namespace with t.Setenv.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Namespace ¶
func Namespace() string
Namespace returns a stable identity for the tmux server this process talks to: the resolved socket path. Two Sidecar instances share a namespace exactly when they can see each other's sessions.
The hostname is deliberately NOT part of the identity. shells.json is per-machine state, the socket path already distinguishes every server on that machine, and macOS rewrites the host name when networks change ("aerie" -> "aerie-2"). Including it would make every existing manifest entry unrecognizable — and therefore unprunable — after a DHCP rename.
func SocketPath ¶
func SocketPath() string
SocketPath returns the path of the default tmux socket this process would use.
Types ¶
This section is empty.