tmuxcmd

package
v0.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tmuxcmd contains the private tmux process boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBackslashReplace

func DecodeBackslashReplace(output []byte) string

DecodeBackslashReplace decodes UTF-8 and escapes each invalid byte as \xNN.

func SplitStderr

func SplitStderr(output []byte) []string

SplitStderr decodes captured standard error into its nonempty lines.

func SplitStdout

func SplitStdout(output []byte) []string

SplitStdout decodes captured standard output into lines and drops the trailing blanks tmux's final delimiter produces. Transports other than this runner call it so one command reports the same decoded lines through any of them.

Types

type Request

type Request struct {
	Binary      string
	Arguments   []string
	Environment []string
	Directory   string
	// Stdio selects direct streaming when non-nil. Nil fields inherit the
	// corresponding process standard stream. A nil Stdio preserves captured
	// output behavior.
	Stdio *Stdio
}

Request describes one subprocess invocation.

type Result

type Result struct {
	Command   []string
	Stdout    []string
	Stderr    []string
	RawStdout []byte
	ExitCode  int
}

Result contains a completed subprocess invocation.

type Runner

type Runner struct {
	WaitDelay time.Duration
}

Runner executes tmux subprocess requests.

func (Runner) Run

func (r Runner) Run(ctx context.Context, request Request) (Result, error)

Run executes one request. Nonzero process exits are returned as Result data.

type Stdio

type Stdio struct {
	Stdin  *os.File
	Stdout *os.File
	Stderr *os.File
}

Stdio supplies concrete files for a streaming subprocess invocation.

Jump to

Keyboard shortcuts

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