session

package
v0.3.0-alpha.71 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ThemeWorkset = "workset"

Variables

This section is empty.

Functions

func ApplyTheme

func ApplyTheme(ctx context.Context, runner Runner, backend Backend, name string, theme Theme) error

func Attach

func Attach(ctx context.Context, runner Runner, backend Backend, name string) error

func DefaultShell

func DefaultShell() string

func Exists

func Exists(ctx context.Context, runner Runner, backend Backend, name string) (bool, error)

func NormalizeNameForBackend

func NormalizeNameForBackend(backend Backend, name string) (string, bool, error)

func ResolveExecCommand

func ResolveExecCommand(args []string) (string, []string)

func RunExecWithPTY

func RunExecWithPTY(ctx context.Context, dir string, command []string, env []string) error

func Running

func Running(ctx context.Context, runner Runner, backend Backend, name string) (bool, error)

func ScreenHasSession

func ScreenHasSession(output, name string) bool

func Start

func Start(ctx context.Context, runner Runner, backend Backend, root, name string, command []string, env []string, interactive bool) error

func Stop

func Stop(ctx context.Context, runner Runner, backend Backend, name string) error

func ThemeNotice

func ThemeNotice(theme Theme, backend Backend) (label string, hint string)

Types

type Backend

type Backend string
const (
	BackendAuto   Backend = "auto"
	BackendTmux   Backend = "tmux"
	BackendScreen Backend = "screen"
	BackendExec   Backend = "exec"
)

func ParseBackend

func ParseBackend(value string) (Backend, error)

func ResolveBackend

func ResolveBackend(preferred Backend, runner Runner) (Backend, error)

type CommandResult

type CommandResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
}

type CommandSpec

type CommandSpec struct {
	Name          string
	Args          []string
	Dir           string
	Env           []string
	Stdin         *os.File
	Stdout        *os.File
	Stderr        *os.File
	CaptureOutput bool
}

type ExecRunner

type ExecRunner struct{}

func (ExecRunner) LookPath

func (ExecRunner) LookPath(name string) error

func (ExecRunner) Run

type Runner

type Runner interface {
	LookPath(name string) error
	Run(ctx context.Context, spec CommandSpec) (CommandResult, error)
}

type Theme

type Theme struct {
	Name             string
	TmuxStyle        string
	TmuxLeft         string
	TmuxRight        string
	ScreenHardstatus string
	Enabled          bool
}

func ResolveTheme

func ResolveTheme(defaults config.Defaults) Theme

Jump to

Keyboard shortcuts

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