runtime

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Tmux is a fully supported alternative runtime. ghostline is the default and recommended runtime (server-side PTY sessions with libghostty-vt snapshots); --runtime tmux keeps the classic tmux adapter available for environments that prefer or require it.

Index

Constants

View Source
const DefaultTerm = "xterm-256color"

DefaultTerm is the terminal type Warren uses when the daemon is launched without a usable TERM (agent/CI shells often inherit TERM=dumb).

Variables

This section is empty.

Functions

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/tmux children inherit a real terminal environment; user-specified values are applied afterwards by settings.

Types

type RuntimeMetadata

type RuntimeMetadata struct {
	Process   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.

type Tmux

type Tmux struct {
	Binary    string
	Socket    string
	OutputDir string
	// contains filtered or unexported fields
}

func (*Tmux) ArchiveSpool

func (t *Tmux) ArchiveSpool(ctx context.Context, runtimeName string) error

ArchiveSpool compresses the current spool to a timestamped .gz file and prunes old archives. Best-effort diagnostics; truncation must not depend on archive success.

func (*Tmux) Capture

func (t *Tmux) Capture(ctx context.Context, runtimeName string) ([]byte, error)

func (*Tmux) Check

func (t *Tmux) Check(ctx context.Context) error

func (*Tmux) ClosePipe

func (t *Tmux) ClosePipe(ctx context.Context, runtimeName string) error

func (*Tmux) Create

func (t *Tmux) Create(ctx context.Context, runtimeName, directory, command string, env []string) error

func (*Tmux) EnsurePipe

func (t *Tmux) EnsurePipe(ctx context.Context, runtimeName string) error

EnsurePipe installs the raw PTY byte pipe for a session. tmux supports one pipe per pane, so the install is guarded by `#{pane_pipe}` instead of the `-o` toggle flag: `pipe-pane -o` closes an existing pipe on tmux 3.5a, which would silently stop every adopted session's output after a daemon restart. With the guard, repeated attach/adopt never stack a pipe and never tear down an already-correct one.

func (*Tmux) Exists

func (t *Tmux) Exists(ctx context.Context, runtimeName string) bool

func (*Tmux) Input

func (t *Tmux) Input(ctx context.Context, runtimeName string, data []byte) error

func (*Tmux) Kill

func (t *Tmux) Kill(ctx context.Context, runtimeName string) error

func (*Tmux) List

func (t *Tmux) List(ctx context.Context) (map[string]bool, error)

func (*Tmux) ListCreated

func (t *Tmux) ListCreated(ctx context.Context) (map[string]time.Time, error)

ListCreated returns the sessions on this socket with their tmux creation timestamps. The service uses it to reclaim orphaned sessions that outlived their state record, e.g. after a state reset or daemon crash.

func (*Tmux) Metadata

func (t *Tmux) Metadata(ctx context.Context, runtimeName string) (RuntimeMetadata, error)

Metadata reports the pane's current foreground command and working directory, the tmux equivalent of the ghostline foreground probe.

func (*Tmux) PaneTarget

func (t *Tmux) PaneTarget(ctx context.Context, runtimeName string) (string, error)

func (*Tmux) RemoveSpool

func (t *Tmux) RemoveSpool(runtimeName string)

func (*Tmux) Resize

func (t *Tmux) Resize(ctx context.Context, runtimeName string, columns, rows int) error

func (*Tmux) SpoolPath

func (t *Tmux) SpoolPath(runtimeName string) string

func (*Tmux) SpoolSize

func (t *Tmux) SpoolSize(ctx context.Context, runtimeName string) (int64, error)

func (*Tmux) TruncateSpool

func (t *Tmux) TruncateSpool(ctx context.Context, runtimeName string) error

TruncateSpool compacts the live spool in place. The pipe command keeps its O_APPEND file descriptor, so tmux output continues into the same inode from byte zero; Host bumps the epoch and reanchors clients.

Jump to

Keyboard shortcuts

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