Versions in this module Expand all Collapse all v0 v0.1.0 Jun 17, 2026 Changes in this version + type Line struct + Stream string + Text string + type Option func(*Options) + func WithDir(dir string) Option + func WithEnv(env []string) Option + func WithGracefulTimeout(d time.Duration) Option + func WithIdleTimeout(d time.Duration) Option + func WithLineBuffer(n int) Option + func WithOverflowPolicy(p OverflowPolicy) Option + func WithPTY() Option + func WithTimeout(d time.Duration) Option + type Options struct + Dir string + Env []string + GracefulTimeout time.Duration + IdleTimeout time.Duration + LineBuffer int + Overflow OverflowPolicy + PTY bool + Timeout time.Duration + type OverflowPolicy int + const PolicyBlock + const PolicyDropNewest + const PolicyDropOldest + type Result struct + Duration time.Duration + Err error + ExitCode int + Stderr string + Stdout string + func Run(ctx context.Context, command string, opts ...Option) (*Result, error) + type Session struct + func Start(ctx context.Context, command string, opts ...Option) (*Session, error) + func (s *Session) Done() <-chan struct{} + func (s *Session) Drops() uint64 + func (s *Session) Lines() <-chan Line + func (s *Session) PID() int + func (s *Session) Resize(rows, cols int) error + func (s *Session) Stop() error + func (s *Session) Wait() (*Result, error) + func (s *Session) Write(p []byte) (int, error)