Documentation
¶
Index ¶
- Constants
- func ApplyCleanEnvironment()
- func ApplyDaemonEnvironment()
- func ApplyTerminalEnvironment()
- func BundledTerminfoDir() string
- func CleanEnvironment(source []string) []string
- func DaemonEnvironment(source []string) []string
- func LoginShellArgs() []string
- func LoginShellPath() string
- func ReplaceEnvironment(environment []string)
- func SanitizeEnvironment()
- func ShellCommandWithUnsets(shell string, keys []string) (string, error)
- func StablePath(home string) string
- func TerminalEnvironment(source []string) []string
- type RuntimeMetadata
- type RuntimeMetadataProvider
Constants ¶
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
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
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
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
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
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 ¶
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.