execx

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package execx provides explicit helpers for spawning subprocesses with a chosen TTY attachment mode, replacing env-var signalling with real OS state.

Use NonInteractive when the subprocess must not prompt (tests, automation, hooks that shouldn't block). Use Interactive when the subprocess should inherit the parent's controlling TTY (the default for exec.Command).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interactive

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

Interactive returns an *exec.Cmd that inherits the parent's controlling TTY. Equivalent to exec.CommandContext; provided for symmetry and intent clarity.

func NonInteractive

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

NonInteractive returns an *exec.Cmd detached from the parent's controlling TTY. In the child, /dev/tty cannot be opened, so interactive.CanPromptInteractively() returns false — no env var required.

On Windows the child runs with DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP so it has no inherited console.

Types

This section is empty.

Jump to

Keyboard shortcuts

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