proc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 2 Imported by: ? 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 proc starts other programs from an app without flashing console windows.

An app packaged for Windows is a GUI program (built with -H=windowsgui), so it has no console. When it starts a console program, such as git, Windows opens a new console window for that program, which shows for as long as the program runs: an app that runs git every few seconds flashes a window every few seconds. Command and CommandContext return an exec.Cmd that starts the program with a console but no window. The programs it starts in turn share that hidden console, so they open no window either. On other systems they are exec.Command and exec.CommandContext.

Use them for a console program that runs in the background, whose output the app reads. A program that should show a window, such as a terminal the user asked for or an editor, needs exec.Command and creation flags of its own: a GUI program started by Command keeps its first window hidden.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, arg ...string) *exec.Cmd

Command is exec.Command for a background console program: on Windows the program starts without a console window.

func CommandContext

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

CommandContext is exec.CommandContext for a background console program: on Windows the program starts without a console window.

func Hide

func Hide(cmd *exec.Cmd)

Hide makes cmd start without a console window on Windows, and asks the program to keep its first window hidden. It keeps cmd's other SysProcAttr settings, but drops flags that would give the program a visible console or none at all. It does nothing on other systems. Call it before cmd.Start.

Types

This section is empty.

Jump to

Keyboard shortcuts

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