passthrough

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package passthrough executes a command in a target directory with stdio inherited from the calling process. Used by exec, diff, and from-spec verbs to hand off interactive subprocesses (agents, git-diff pagers, etc.).

Index

Constants

This section is empty.

Variables

View Source
var OpenTTY = tty.Open

OpenTTY is the function used to acquire a controlling terminal for interactive subprocesses. Overridable in tests.

View Source
var StdioIsTTY = func() bool {
	return term.IsTerminal(0) && term.IsTerminal(1) && term.IsTerminal(2)
}

StdioIsTTY reports whether all three standard streams are interactive terminals. When true, the child inherits them directly — required for Bun-compiled agents (e.g. Claude Code) which reject /dev/tty-opened fds when constructing node:tty WriteStreams on macOS (kqueue EINVAL), but work fine with directly-inherited terminal fds. Overridable in tests.

Functions

This section is empty.

Types

type OSRunner

type OSRunner struct{}

OSRunner is the production implementation of Runner using os/exec.

func (OSRunner) Run

func (OSRunner) Run(ctx context.Context, dir, name string, args ...string) (int, error)

type Runner

type Runner interface {
	Run(ctx context.Context, dir, name string, args ...string) (int, error)
}

Runner executes a command in dir with stdio inherited from the calling process. Returns the child's exit code (non-zero does not produce an error; a non-nil error indicates a launch failure such as binary not found).

Jump to

Keyboard shortcuts

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