Documentation
¶
Overview ¶
Package holder implements `stagent run`: it starts a program on a PTY and owns everything derived from its output — the VT screen, the on-disk scrollback and the output-based state — while serving attach/input requests from the bridge on its own local IPC endpoint and reporting state changes (never output) to the daemon.
Passthrough mode (default) mirrors the program on the local terminal like script(1); detached mode has no local terminal and the app owns the size.
Index ¶
Constants ¶
const ( ExitUsage = 2 ExitNotFound = 127 ExitFailure = 1 )
Exit codes of Run for failures before the program ran.
const EnvHandoff = "STAGENT_HANDOFF"
EnvHandoff decides --handoff=auto when it is exactly "0" (no handoff) or "1" (handoff); other values are ignored.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Holder ¶
type Holder struct {
// contains filtered or unexported fields
}
Holder is one running session.
type Options ¶
type Options struct {
Command []string
Detached bool
// Handoff keeps a passthrough session running when its local terminal
// hangs up: the session becomes detached instead of the program being
// hung up (stagent run --handoff).
Handoff bool
// ID is the session id (16 lowercase hex chars); empty = random.
ID string
// Cols/Rows size a detached session; passthrough follows the local
// terminal.
Cols, Rows int
// Dir is the program's working directory; empty = current directory.
Dir string
// Env is the program's environment before STAGENT_SESSION_ID (and, when
// detached, TERM/COLORTERM defaults) are added; nil = os.Environ().
Env []string
Layout *paths.Layout
// DialDaemon connects to the daemon; nil = daemonclient.DialOrStart.
DialDaemon func() (net.Conn, error)
// Logf receives diagnostics; nil = stderr when detached, the holder log
// file in passthrough (stderr is the user's terminal there).
Logf func(format string, args ...any)
}
Options configures one session.