procattr

package
v0.206.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 1 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 procattr holds the one platform-specific tweak every NON-interactive child process needs: on Windows a process without a console (a `gofer worker -d` / `serve -d` daemon runs detached) that starts a console program (git, claude.cmd, npx ...) makes Windows open a fresh console window for EVERY such child. Background suppresses that.

It is the only supported way to start a background helper process (G022: a leaf package, imported by everyone, importing nothing of ours). A guard test (TestExecCallsUseBackground) fails the build of any new exec.Command call site that neither calls Background nor is on its allow-list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background(cmd *exec.Cmd)

Background configures cmd to run without opening a console window on Windows. It MERGES into an existing SysProcAttr / CreationFlags instead of replacing them and is a no-op on every other platform. Call it before cmd.Start/Run/Output.

Do NOT use it on a detached daemon start: CREATE_NO_WINDOW and DETACHED_PROCESS are mutually exclusive (daemon_windows.go owns that path). Interactive children that should share the user's console (an editor) also must not use it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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