proc

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HideWindow

func HideWindow(*exec.Cmd)

HideWindow is a no-op off Windows.

func KillTracked

func KillTracked(cmd *exec.Cmd, _ uintptr)

KillTracked terminates cmd's process tree; the handle is unused off Windows.

func KillTree

func KillTree(cmd *exec.Cmd)

KillTree kills cmd's whole process group. StartTracked (and SetProcessGroupKill for children started outside it) put the child in its own group via Setpgid, so the negative-pid signal reaches every descendant — a launcher whose sub-daemon survives the parent (e.g. codegraph's bundled node runtime) included, where a plain Process.Kill would only hit the direct child and orphan the grandchild.

func LowPriority

func LowPriority(*exec.Cmd)

LowPriority is a no-op off Windows; unix sets niceness after start.

func LowPriorityStarted

func LowPriorityStarted(cmd *exec.Cmd)

LowPriorityStarted renices a started command to below-normal priority, for background helpers (indexers) that must not starve the user's machine.

func ResolvePowerShell

func ResolvePowerShell() string

ResolvePowerShell is a no-op on non-Windows platforms. It exists so that shared code can call proc.ResolvePowerShell() without build-tag guards; the callers are themselves Windows-only at runtime.

func SetProcessGroupKill

func SetProcessGroupKill(cmd *exec.Cmd)

SetProcessGroupKill makes cmd start in its own process group so KillTree can reap its whole tree. Use it for children started outside StartTracked (e.g. a one-shot CombinedOutput). It is a no-op on Windows, where the Job Object that TrackTree/StartTracked assigns handles the tree instead.

func StartTracked

func StartTracked(cmd *exec.Cmd) (uintptr, error)

StartTracked starts cmd in its own process group so KillTracked / KillTree can reap its whole tree. Off Windows the process group is the equivalent of the Windows Job Object; it returns a 0 handle, and KillTracked falls back to KillTree.

Types

This section is empty.

Jump to

Keyboard shortcuts

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