executil

package
v0.0.9-beta Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package executil wraps os/exec so child processes can be hidden on Windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandContext

func CommandContext(ctx context.Context, name string, args ...string) *exec.Cmd

CommandContext builds an exec.Cmd whose cancellation kills the whole process group, not just the direct child (P1-17). Without this, a cancelled python adapter would die while the claude CLI it spawned kept running as an orphan — burning tokens and holding file locks. The child is put in its own process group (Setpgid) so Cancel can signal the group by negative pid.

Types

type Capture

type Capture struct {
	// contains filtered or unexported fields
}

Capture is an io.Writer that accumulates output up to captureCap bytes, then appends a truncation marker once and discards further writes. It always reports the full write length so the child never sees a short-write error.

func (*Capture) Bytes

func (c *Capture) Bytes() []byte

Bytes returns the captured output.

func (*Capture) String

func (c *Capture) String() string

String returns the captured output.

func (*Capture) Write

func (c *Capture) Write(p []byte) (int, error)

Write appends p to the capture buffer, truncating once it would exceed the cap. The reported n is always len(p).

Jump to

Keyboard shortcuts

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