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
- func SanitizeEnvironment()
- type RuntimeMetadata
- type RuntimeMetadataProvider
- type Tmux
- func (t *Tmux) ArchiveSpool(ctx context.Context, runtimeName string) error
- func (t *Tmux) Capture(ctx context.Context, runtimeName string) ([]byte, error)
- func (t *Tmux) Check(ctx context.Context) error
- func (t *Tmux) ClosePipe(ctx context.Context, runtimeName string) error
- func (t *Tmux) Create(ctx context.Context, runtimeName, directory, command string, env []string) error
- func (t *Tmux) EnsurePipe(ctx context.Context, runtimeName string) error
- func (t *Tmux) Exists(ctx context.Context, runtimeName string) bool
- func (t *Tmux) Input(ctx context.Context, runtimeName string, data []byte) error
- func (t *Tmux) Kill(ctx context.Context, runtimeName string) error
- func (t *Tmux) List(ctx context.Context) (map[string]bool, error)
- func (t *Tmux) ListCreated(ctx context.Context) (map[string]time.Time, error)
- func (t *Tmux) Metadata(ctx context.Context, runtimeName string) (RuntimeMetadata, error)
- func (t *Tmux) PaneTarget(ctx context.Context, runtimeName string) (string, error)
- func (t *Tmux) RemoveSpool(runtimeName string)
- func (t *Tmux) Resize(ctx context.Context, runtimeName string, columns, rows int) error
- func (t *Tmux) SpoolPath(runtimeName string) string
- func (t *Tmux) SpoolSize(ctx context.Context, runtimeName string) (int64, error)
- func (t *Tmux) TruncateSpool(ctx context.Context, runtimeName string) error
Constants ¶
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 ¶
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 ¶
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) EnsurePipe ¶
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) ListCreated ¶
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 ¶
Metadata reports the pane's current foreground command and working directory, the tmux equivalent of the ghostline foreground probe.
func (*Tmux) PaneTarget ¶
func (*Tmux) RemoveSpool ¶
func (*Tmux) TruncateSpool ¶
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.