tmuxenv

package
v0.99.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL