bashrun

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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 DefaultShell

func DefaultShell() string

func KeyBytes

func KeyBytes(name string) string

func KillAll

func KillAll()

func SetMarkers

func SetMarkers(sessionID, model string)

func Spill

func Spill(output string) string

func WithShell

func WithShell(ctx context.Context, shell string) context.Context

Types

type Options

type Options struct {
	Command string

	Shell string

	Timeout time.Duration

	Interactive bool

	InactivityTimeout time.Duration

	OnOutput func(chunk string)

	OnUpdate func(outputSoFar string)

	OnAwaitInput func(secLeft int)

	Keys <-chan []byte
}

type Result

type Result struct {
	Output string

	Exit string

	TimedOut bool

	Killed bool

	Interactive bool
}

func Run

func Run(ctx context.Context, opts Options) Result

Jump to

Keyboard shortcuts

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