Documentation
¶
Overview ¶
Package loginenv learns the environment of the user's login shell, which the sessions stagent starts begin from: the bridge's (session.spawn, task.create) and the daemon's (schedule runs).
Index ¶
Constants ¶
const TryTimeout = 5 * time.Second
TryTimeout bounds one try of Capture; rc files that hang (waiting for input, network) must not block session.spawn or a schedule run.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture returns the environment of the user's login shell, exe being the stagent binary that prints it (`stagent __env`), taking within at most in all.
An SSH exec channel runs the command through a non-login, non-interactive shell, and the daemon runs wherever it was started from, so PATH entries set in ~/.bash_profile, ~/.zprofile or ~/.zshrc (bun, nvm, Homebrew, …) are missing and programs installed there fail with "executable file not found in $PATH". The shell is run as a login, interactive shell first (zsh users keep PATH in .zshrc), then as a login shell only, without a controlling terminal, each try for TryTimeout at most and what is left of within.
func Dump ¶
func Dump() int
Dump is `stagent __env`: print the process environment after envMarker, NUL separated. Capture runs it through the user's login shell to learn the environment their terminal sessions get.
Types ¶
This section is empty.