Documentation
¶
Index ¶
- Constants
- Variables
- func Command(ctx context.Context, shell, command string) (*exec.Cmd, error)
- func DefaultShell() string
- func KeyBytes(name string) string
- func KillAll()
- func ResolveShell(ctx context.Context, shell string) string
- func SetMarkers(sessionID, model string)
- func ShellName(shell string) string
- func Spill(output string) string
- func WithShell(ctx context.Context, shell string) context.Context
- func WithWorkingDir(ctx context.Context, dir string) context.Context
- func WorkingDir(ctx context.Context) string
- type Options
- type Result
Constants ¶
View Source
const ( KeyEnter = "\r" KeyEsc = "\x1b" KeyTab = "\t" KeyBS = "\x7f" KeyUp = "\x1b[A" KeyDown = "\x1b[B" KeyRight = "\x1b[C" KeyLeft = "\x1b[D" )
Variables ¶
View Source
var ChildMarkers = []string{"K_BRAIN=1", "K_BRAIN=1"}
Functions ¶
func Command ¶ added in v0.107.6
Command shares quoting, encoding and exit status handling across process tools.
func DefaultShell ¶
func DefaultShell() string
func ResolveShell ¶ added in v0.107.6
ResolveShell keeps explicit per-tool selection ahead of the session and platform default.
func SetMarkers ¶
func SetMarkers(sessionID, model string)
func WithWorkingDir ¶ added in v0.103.0
func WorkingDir ¶ added in v0.103.0
Types ¶
type Options ¶
type Options struct {
Command string
Dir string
Shell string
Timeout time.Duration
Interactive bool
InactivityTimeout time.Duration
OnOutput func(chunk string)
// OnUpdate receives a bounded tail snapshot when output changes.
OnUpdate func(outputTail string)
OnAwaitInput func(secLeft int)
Keys <-chan []byte
Env []string
Sandbox *sandbox.Policy
}
Click to show internal directories.
Click to hide internal directories.