runtime

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTerm = "xterm-ghostty"

DefaultTerm is the terminal type Warren uses when the daemon is launched without a usable TERM (agent/CI shells often inherit TERM=dumb). xterm-ghostty carries Tc (truecolor) and is bundled in Support/terminfo so no external Ghostty install is required.

Variables

This section is empty.

Functions

func ApplyCleanEnvironment added in v0.12.0

func ApplyCleanEnvironment()

ApplyCleanEnvironment replaces the current process environment with the terminal baseline. Call ApplyDaemonEnvironment for a Warren control-plane process and ApplyTerminalEnvironment for a Ghostline serve process.

func ApplyDaemonEnvironment added in v0.12.0

func ApplyDaemonEnvironment()

ApplyDaemonEnvironment installs the clean daemon environment while retaining explicit Warren/provider configuration used by control-plane code.

func ApplyTerminalEnvironment added in v0.12.0

func ApplyTerminalEnvironment()

ApplyTerminalEnvironment removes daemon-only configuration from the current process before it constructs a Ghostline server. Ghostline v1 merges its own os.Environ() with per-session overrides, so this boundary is required even when the parent supplied an explicit terminal environment to Spawn.

func BundledTerminfoDir added in v0.11.0

func BundledTerminfoDir() string

BundledTerminfoDir returns the directory that contains the bundled xterm-ghostty terminfo for ghostline children. Empty if not found or not needed (host already has it).

func CleanEnvironment added in v0.12.0

func CleanEnvironment(source []string) []string

CleanEnvironment builds the terminal baseline inherited by Ghostline and new PTYs. It intentionally starts from an allowlist: project/task state and Warren/provider control variables are supplied by the daemon or session boundary instead of leaking from the launching terminal.

func DaemonEnvironment added in v0.12.0

func DaemonEnvironment(source []string) []string

DaemonEnvironment builds the environment for Warren's control-plane processes. It retains Warren/provider configuration needed by the daemon, while keeping the terminal baseline itself deterministic.

func LoginShellArgs added in v0.12.0

func LoginShellArgs() []string

LoginShellArgs are passed directly to the shell so its startup files load mise/direnv and other user project tooling inside the new session.

func LoginShellPath added in v0.12.0

func LoginShellPath() string

LoginShellPath returns a validated interactive shell path for new PTYs. The caller's SHELL is only accepted when it points at a known shell binary; otherwise Warren falls back to the platform's standard shells.

func ReplaceEnvironment added in v0.12.0

func ReplaceEnvironment(environment []string)

ReplaceEnvironment installs an explicit environment without logging any values. It is kept small so tests and subprocess entry points can share the same boundary behavior.

func SanitizeEnvironment

func SanitizeEnvironment()

SanitizeEnvironment removes launcher-only environment semantics that would make Warren terminal sessions behave like non-interactive pipelines: PAGER/GIT_PAGER/GH_PAGER set to cat or empty suppress pagers, a dumb TERM makes TUIs and pagers degrade, and an ambient NO_COLOR disables interactive TUI colors. It mutates the current process environment so ghostline children inherit a real terminal environment; user-specified values are applied afterwards by settings.

func ShellCommandWithUnsets added in v0.12.0

func ShellCommandWithUnsets(shell string, keys []string) (string, error)

ShellCommandWithUnsets returns a safe bootstrap command for the rare case where a session explicitly requests variables to be unset. Ghostline's v1 environment API can override values but cannot remove keys from its own process environment, so the login shell performs the final unsets.

func StablePath added in v0.12.0

func StablePath(home string) string

StablePath returns a host-level PATH. Project-specific shims (mise, direnv, virtualenv and similar) are intentionally absent; a login shell in the session rebuilds those paths in the selected workspace.

func TerminalEnvironment added in v0.12.0

func TerminalEnvironment(source []string) []string

TerminalEnvironment is the explicit name for CleanEnvironment at process boundaries that own a terminal. Keep CleanEnvironment as the short, backwards-compatible API used by existing callers and tests.

Types

type RuntimeMetadata

type RuntimeMetadata struct {
	Process     string
	CommandLine string
	Directory   string
}

RuntimeMetadata is the live OS-level foreground process snapshot for one session, rendered into roster snapshots when the runtime adapter supports it.

type RuntimeMetadataProvider

type RuntimeMetadataProvider interface {
	Metadata(context.Context, string) (RuntimeMetadata, error)
}

RuntimeMetadataProvider is implemented by runtime adapters that can report foreground process metadata for a session.

Jump to

Keyboard shortcuts

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