proc

package
v0.1.4623 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 28 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 proc makes the commands magpie runs: agents' CLIs, the probes that ask them what they have, the system's own tools. Every one is made here rather than with os/exec, so that on Windows none of them opens a window.

The desktop app on Windows is linked as a GUI program and has no console. A console program it starts (devin, claude, codex, cursor-agent, grok, the probes behind them) is given a new console by Windows, and with it a window, one for every run; so a child of a magpie with no console is started with CREATE_NO_WINDOW, which gives it a console without one. A magpie run in a terminal, or the desktop app started from one with a command, lets its children share that console as before, so Ctrl+C there reaches them too. Nothing magpie starts reads or writes the terminal itself: its output is piped back, which a hidden console doesn't change.

Index

Constants

This section is empty.

Variables

View Source
var ErrDenied = errors.New("not allowed to end it")

ErrDenied is a process this user may not end: another user's, or one run as administrator.

View Source
var ErrNoEnv = errors.New("this system doesn't tell another process's environment")

ErrNoEnv is a system that doesn't tell another process's environment (Windows here).

View Source
var ErrNoStart = errors.New("this system doesn't tell when a process started")

ErrNoStart is a system that doesn't tell when a process started.

View Source
var ErrNoWSLDistro = errors.New("not run: WSL has no distribution installed")

ErrNoWSLDistro is what a wsl.exe start ends with, unrun, while Windows has no WSL distro registered for this user: there is nothing it could list or run, and on a computer without WSL's package Windows' own wsl.exe answers each run with a console window of its own asking to install it (TraderX219 on X: one every 20 to 30 seconds).

View Source
var ErrWSLNeedsUpdate = errors.New("not run: wsl.exe said lately that WSL must be updated (wsl.exe --update)")

ErrWSLNeedsUpdate is what a wsl.exe start ends with, unrun, for a while after wsl.exe said WSL must be installed or updated (WSLSaid): each run would put the same window up again.

View Source
var ErrWSLOff = errors.New("not run: Detect agents in WSL is off in Settings")

ErrWSLOff is what a wsl.exe start ends with, unrun, while Settings' Detect agents in WSL is off.

View Source
var GeminiKeyVars = []string{"GEMINI_API_KEY", "GOOGLE_GEMINI_BASE_URL"}

GeminiKeyVars are the Gemini API variables the login shell is asked for beside them: Antigravity's CLI on a key of the user's own ("modelProvider": "gemini") reads its key and endpoint from the environment a terminal gives it, which magpie opened from the Dock doesn't have, and the Providers page offers that key (provider's readAgySettings). Only read (LoginEnv), never set in magpie's environment: the programs magpie starts don't get them.

View Source
var OrphanEvery = 5 * time.Second

OrphanEvery is how often the zombies adopted by magpie are looked for. One that was already a zombie at the previous look is nobody's to wait for: every command magpie starts is waited for the moment it ends.

View Source
var OutputGrace = 2 * time.Second

OutputGrace is how long the readers of a command that has ended have to read what it wrote last, before its Output is closed under them.

View Source
var ProxyVars = []string{"HTTP_PROXY", "http_proxy", "HTTPS_PROXY", "https_proxy", "ALL_PROXY", "all_proxy", "NO_PROXY", "no_proxy"}

ProxyVars are the proxy variables the login shell is asked for beside agentenv.Vars. An agent run in a terminal has the ones its profile sets, and so does one the ChatGPT app starts (it takes the login shell's environment as it opens), while magpie opened from the Dock doesn't: a NO_PROXY=127.0.0.1 in .zshrc keeps Codex's requests for magpie off a proxy that magpie, reading its own environment, thought they went through (liu_dyj on X). They are only read (LoginEnv), never set in magpie's environment: magpie's own requests take their proxy from netproxy.

View Source
var RegistryVars = []string{"BUN_CONFIG_REGISTRY", "NPM_CONFIG_REGISTRY", "npm_config_registry"}

RegistryVars are the npm registry variables the login shell is asked for beside them: a registry set in .zshrc is the user's for bun's installs of plugins and magpie's asks of npm, which magpie opened from the Dock didn't see (timwangdev on X). Only read (LoginEnvKnown).

Functions

func CombinedOutputOwn added in v0.1.1682

func CombinedOutputOwn(ctx context.Context, cmd *exec.Cmd) ([]byte, error)

CombinedOutputOwn runs cmd, as made by Command or CommandContext with ctx, to its end and returns its output, stdout and stderr together, as cmd.CombinedOutput does; stdin is the null device. On macOS (built with cgo) the command, and what it starts, answer for themselves to macOS's privacy prompts rather than to magpie. Elsewhere it is cmd.CombinedOutput.

func Command

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

Command is exec.Command, with no window of its own on Windows.

func CommandContext

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

CommandContext is exec.CommandContext, with no window of its own on Windows.

func End added in v0.1.1704

func End(pid int) error

End ends process pid as its own clean exit would look to its parent: SIGTERM where there are signals, on Windows TerminateProcess with exit code 0. The Codex app starts its app-server again after an exit 0 and shows an error for any other (its AppServerConnection: code === 0 is classifiedAsExpected). On Windows what pid started is ended with it, as a program ending on SIGTERM ends its own children (endTree). ErrDenied when this user may not; nil when pid is gone already.

func EndProbes added in v0.1.599

func EndProbes()

EndProbes kills every probe still running, with what it started, and waits until none of that is left: magpie is exiting or putting a new version in its place, and nothing would end them after. A kill that missed a process being forked signals the group again until it is empty, and an exit before that left the missed one running, adopted by init (#1278); the wait is bounded by how long a kill goes on (killFor on Unix).

func EndTrees added in v0.1.1756

func EndTrees(ctx context.Context, match func(args string) bool) (int, error)

EndTrees ends the processes match picks from every process this user can see, each with all it started, and says how many match picked. A process under one already picked goes with that one; magpie and what it runs under are never picked. It is how a turned-off MCP server's processes go when the agent that started them keeps running (#3885).

func EnvOf added in v0.1.1704

func EnvOf(ctx context.Context, pid int, names ...string) (map[string]string, error)

EnvOf is the value of each of names that process pid's environment has (a name it lacks is left out): on macOS as `ps -E` prints it, on Linux from /proc/<pid>/environ. ErrNoEnv elsewhere; an error too for another user's process, whose environment ps leaves out.

func Executable added in v0.1.977

func Executable(pid int) (string, error)

Executable is the path of the program process pid runs, as the system says it: the one it was started from, also when that file has been replaced since (an update).

func FakeWSLRegistry added in v0.1.3238

func FakeWSLRegistry(names []string, ok bool, pkg string) func()

FakeWSLRegistry, for tests, has the registry read as listing names for the WSL distros registered (ok false: it can't be read) and pkg as WSL's package version; the returned func puts the real reads back.

func FindShell added in v0.1.1166

func FindShell(name string) string

FindShell is the program of the shell name (zsh, bash, fish, nu) installed here, "" when there is none. A desktop app's PATH is launchd's, so the folders shells are installed in are looked in first, then the shells /etc/shells lists, then PATH.

func FindTool added in v0.1.929

func FindTool(name string) string

FindTool is the command-line tool name as a terminal would run it: on PATH, else in one of the folders a user's tools are installed in (UserBinDirs), else, on Windows, on the PATH the registry has now, which a magpie started before the tool was installed doesn't have (#839: the Claude sign-in said Claude Code wasn't installed, its installer having put claude.exe in ~/.local/bin after magpie started). A version manager's wrapper script found there is given as the program it runs (Unwrap). "" when none. Where it is on PATH is kept while those folders are unchanged (LookPath); Unwrap keeps its own answer by the script's size and time.

func FindTools

func FindTools(name string) []string

FindTools is every program for the command-line tool name this machine has, in the order FindTool ranks them: each of PATH's folders, then the folders a user's tools are installed in. One program found twice (a link to it in two folders) is given once, where it comes first; a version manager's wrapper script is given as the program it runs (Unwrap). A machine can have two: a Claude Code installed with npm in two Node versions, the first on PATH an old one `claude update` no longer reaches (zi_xiang5806 on X). Kept as FindTool's answer is.

func Forget added in v0.1.1214

func Forget()

Forget drops every answer kept by LookPath and FindTool, so the next asks again: the reader asked to look for agents again.

func IsForwarder added in v0.1.1035

func IsForwarder(path string) bool

IsForwarder says whether the program at path holds a port for a container or a VM, which serves on it from inside: OrbStack's helper, Docker Desktop's backend and vpnkit, docker-proxy, Podman's gvproxy, Lima's (Colima's, Rancher Desktop's) host agent, WSL's relay. A magpie answering there runs in that container (leslie_luo on Discord: magpie v0.1.552 in OrbStack held 3425, and its helper was named as the program to quit), which only the container's own tools stop.

func IsMagpie added in v0.1.977

func IsMagpie(path string) bool

IsMagpie says whether the program at path is a magpie: magpie, its magpie-* builds or dial, its name before; with .exe, and Windows' .old for one replaced by an update while it ran, or .old-2 when that one was still held; and magpie.real, the program a wrapper script named magpie runs (acezan on Discord).

func Isolated added in v0.1.1258

func Isolated() bool

Isolated reports whether this is a test binary testenv isolated, where nothing of the machine's own (its folders, its registry) is read.

func KeepReaping

func KeepReaping(ctx context.Context)

KeepReaping reaps the zombies magpie has adopted, until ctx ends. It does nothing where magpie adopts none.

func Kill added in v0.1.977

func Kill(pid int) error

Kill ends process pid at once. ErrDenied when this user may not.

func ListeningOn added in v0.1.977

func ListeningOn(ctx context.Context, port int) ([]int, error)

ListeningOn is the ids of the processes listening on TCP port, that this user can see: lsof on a Mac, /proc on Linux, Get-NetTCPConnection on Windows. Another user's process may be missing.

func LoginEnv added in v0.1.1214

func LoginEnv(k string) string

LoginEnv is the value a terminal opened now has for k, one of agentenv.Vars, ProxyVars, agentenv.ClaudeProviders, RegistryVars or GeminiKeyVars: the login shell's, asked as LoginPath asks and with it; "" when the shell has none for it or doesn't say.

func LoginEnvKnown added in v0.1.2274

func LoginEnvKnown(k string) string

LoginEnvKnown is what the login shell last said of k (UserPath or LoginPath asked it), "" when it hasn't been asked or had none; it never asks the shell itself, so a path every page takes doesn't wait on one.

func LoginEnvSaid

func LoginEnvSaid(k string) string

LoginEnvSaid is LoginEnvKnown without the lock: LoginPath holds it while the shell answers, which may take seconds, and netproxy reads the shell's proxy on every request magpie makes.

func LoginPath added in v0.1.681

func LoginPath() []string

LoginPath is the PATH a terminal opened now has — the login shell's — for telling whether a command an agent runs by name is found there, which the app's own PATH can't: UserPath adds folders the shell may not have. nil when the shell doesn't say; asked again after a minute.

func LoginVars added in v0.1.2672

func LoginVars(names []string) map[string]string

LoginVars are the values a terminal opened now has for names, the ones set there (empty ones too): what the login shell exports, or fish's or nushell's when a terminal opens those (shellEnv's shells, the login shell's answer first). A ${NAME} in an MCP server's headers or environment is read so where magpie's own environment hasn't it: a magpie opened from the Finder or the Dock has none of the profile's variables, so a server whose token is in .zshrc showed no tools (Cyrus on Discord). Each answer, unset too, is kept a minute; the values are only returned, never set in magpie's environment or logged. A name that isn't a variable's is never asked.

func Look added in v0.1.1214

func Look(name string) (string, error)

Look is exec.LookPath as it is, a wrapper script given as itself, the answer kept while the PATH folders are unchanged.

func LookPath added in v0.1.1210

func LookPath(name string) (string, error)

LookPath is exec.LookPath, with a version manager's wrapper script found there given as the program it runs (Unwrap). Where it is on PATH is kept while the PATH folders are unchanged (Look); Unwrap keeps its own answer by the script's size and time.

func MemTotal added in v0.1.1519

func MemTotal() int64

MemTotal is this computer's physical memory, in bytes; 0 when not known.

func OpenBrowser added in v0.1.1231

func OpenBrowser(url string) error

OpenBrowser opens url in the user's default browser. The error is the launcher's failing to start, for the caller to show with the link to open by hand: a sign-in that waits on a page that never opened only times out (#2043).

func OpenFolder added in v0.1.2879

func OpenFolder(path string) error

OpenFolder shows path in the desktop's file manager and returns once the opener is started, not when the file manager is done. Wails' own way runs the opener to its end under a ten-second context: a file manager that isn't running yet stays in the foreground of what xdg-open starts, so the click hung for ten seconds and then killed the window that had just opened (pkh1585 on Discord). The opener gets a session of its own and no stdio, so it outlives the request and the click.

func PackageVersion

func PackageVersion(bin string) string

PackageVersion is the version of the npm package the CLI at bin is a file of, or that the npm shim at bin starts, read from its package.json without running anything; "" when bin is in no package.

func PeakRSS added in v0.1.1519

func PeakRSS(cmd *exec.Cmd) int64

PeakRSS is the most the command held resident, in bytes, once it was waited for; 0 where the system doesn't say (Windows).

func ProbeContext added in v0.1.599

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

ProbeContext is CommandContext for a command magpie only asks something of and waits on for the answer: who a CLI says is signed in, its version. The CLI is often a script (a version manager's wrapper, a shim), and killing it on the timeout left what it had started running; a probe still asking when magpie quit or updated itself was left whole, adopted by init with nothing to end it, and one stuck in a loop held a core for hours. A probe leads a group of its own on Unix, the context ending kills the whole group, and EndProbes does the same for those still asking when magpie exits. ctx must end (a timeout): the probe is forgotten when it does.

func RealPath added in v0.1.1136

func RealPath(p string) (string, error)

RealPath is where the file at p really is, its links followed.

func Responsible added in v0.1.1682

func Responsible(pid int) int

Responsible is the process macOS holds responsible for pid, 0 when that can't be told (here, always).

func RunsMagpie added in v0.1.2977

func RunsMagpie(pid int, path string) bool

RunsMagpie says whether process pid, running the program at path (as Executable says), is a magpie: by the program's name (IsMagpie), or else by what the program is, magpie's own main package, read from the build information Go writes into it. A magpie under a name of the user's (acezan on Discord: magpie.real, behind a wrapper script installed as magpie) is still one, and on Linux this holds for one whose file an update has since replaced, read through /proc/<pid>/exe: the panel had called that magpie "not magpie" and left it holding the gateway's port.

func ShellPath added in v0.1.1003

func ShellPath(sh string) []string

ShellPath is the PATH the shell sh (zsh, bash, fish) has in a terminal opened now, whether or not it is the login shell; nil when it doesn't say within a few seconds.

func StartReaped added in v0.1.2840

func StartReaped(cmd *exec.Cmd) error

StartReaped starts cmd, which magpie leaves running (it outlives magpie or ends on its own), and waits for it in the background, so it is reaped whenever it ends. Process.Release doesn't reap on Unix: a child released and ended stays <defunct> until magpie quits.

func Started added in v0.1.2092

func Started(pid int) (time.Time, error)

Started is when process pid started, as the system recorded it. An error says it couldn't be read (gone, another user's, ErrNoStart), not that it started at any time.

func SystemDirs added in v0.1.1169

func SystemDirs(paths ...string) []string

SystemDirs are paths of the machine's own, outside any home (Homebrew's /opt/homebrew/bin, /usr/local/bin, an app in /Applications, the registry's PATH), as discovery looks in them: as they are, except in a test binary testenv isolated, where each lies under the test's home instead. A test that empties PATH means a machine without the tool; the host's /opt/homebrew/bin/claude was found anyway, so the tests of the downloaded Claude Code failed on a Mac with Homebrew's (#1525). A test that wants one there writes it under its home at that path.

func TailscaleServes

func TailscaleServes(ctx context.Context, port int) bool

TailscaleServes says whether Tailscale's serve or funnel is set to answer on port, as `tailscale serve status --json` says it. The daemon runs as root, so its sockets are often out of this user's sight and PortHolder finds nobody; Tailscale itself still tells. Read only, within ctx: false for no Tailscale, no answer or output that doesn't parse.

func Terminate added in v0.1.977

func Terminate(pid int) error

Terminate asks process pid to end: SIGTERM on Unix, which a magpie quits on; on Windows it is ended at once (nothing else reaches a tray app). ErrDenied when this user may not.

func ToolIn added in v0.1.3369

func ToolIn(name string, dirs []string) string

ToolIn is name's program in the first of dirs that has one, as toolIn finds it on this system.

func Unwrap added in v0.1.1210

func Unwrap(name, path string) string

Unwrap is the program path stands for when it is a small script that runs name through mise (`mise x … -- name`, `mise exec`, rtx's old name): what `mise which name` says. path itself otherwise, and when mise isn't here or doesn't say within a few seconds.

func UserBinDirs added in v0.1.441

func UserBinDirs() []string

UserBinDirs are the folders a user's command-line tools are installed in that exist here — npm's prefixes, each Node version of nvm, fnm and mise, bun, volta, pnpm, asdf, the standalone installers' ~/.local/bin, Homebrew — for finding one PATH doesn't reach. A manager's Node versions come in the order a terminal would reach them: its default first, then the highest version (v22 before v9).

func UserPath added in v0.1.67

func UserPath()

UserPath gives the desktop app the PATH a terminal of the user's has. One opened from the Finder, the Dock or a login item gets launchd's /usr/bin:/bin:/usr/sbin:/sbin and nothing a shell profile adds, so a claude or codex installed with a custom npm prefix (~/.npm-global/bin), nvm, bun, volta or asdf wasn't found: the agent wasn't seen and its subscription couldn't be used. The folders those tools use are added at once, when they exist; the login shell's own PATH is asked for after. Of nvm's Nodes only the one a terminal gets is added: its default alias's, not the folder whose name sorts last (nvmBins).

The same call brings the agents' own variables (agentenv.Vars: PI_CODING_AGENT_DIR, CODEX_HOME, CLAUDE_CONFIG_DIR, ...) the profile sets and the app wasn't started with, so that magpie writes an agent's config into the folder the agent reads, not its default one in the home (atie on Discord: Pi's models.json went to ~/.pi/agent with PI_CODING_AGENT_DIR set in the shell). One already in magpie's environment is kept. One holding a relative path is lent to the programs magpie starts all the same, but magpie itself reads them through appdir.LookupEnv, which passes such a value over, as it does the ones magpie started with. Those are read as magpie starts (the library is synced into the agents at once), so the answer is waited for, but no more than shellWait: a slow profile mustn't hold the window up, and what it says later is still taken.

func Version added in v0.1.961

func Version(bin string) string

Version is what the CLI at bin says its version is: the version in the package.json of the npm package it is a file of, read rather than run, else what bin --version prints (stdout and stderr, ANSI and all), "" when it says nothing. A run that fails other than by taking too long isn't made again until the binary changes (#864): macOS stops a program XProtect flags with a "contains malware" alert on each start, and a CLI asked its version every few minutes put one up every time magpie's window opened. An npm CLI isn't run at all: its package says the version its --version would.

func WSLSaid added in v0.1.3238

func WSLSaid(out []byte, err error)

WSLSaid is told what a wsl.exe run printed and how it ended. When that says WSL must be installed or updated, wsl.exe isn't run again for wslUpdateAge (wslOff), by any magpie process, unless WSL changes. Every runner of magpie's that reads wsl.exe's output tells it.

func WaitFollowingStops added in v0.1.3147

func WaitFollowingStops(cmd *exec.Cmd) (int, error)

WaitFollowingStops waits for a started command in the foreground and reaps it, as cmd.Wait would, but follows its stops: when the terminal stops it (Ctrl+Z), magpie stops itself too, so the shell has the terminal back, and fg continues both. cmd.Wait can't see a stop. It answers the command's exit code, 128 plus the signal's number for one a signal ended. (`magpie claude run`: claude in front, magpie waiting.)

Types

type Holder

type Holder struct {
	PID  int
	Name string // the program's name, without a folder or .exe
	Path string // where it runs from, "" when the system won't say
}

Holder is a process listening on a port.

func PortHolder

func PortHolder(ctx context.Context, port int) (Holder, bool)

PortHolder is the first process other than this one that this user can see listening on TCP port. false when none is seen, or the read failed: an unreadable holder is unknown, never "none".

func (Holder) IsTailscale

func (h Holder) IsTailscale() bool

IsTailscale says whether the holder is Tailscale's: tailscaled, the tailscale CLI, the Mac app (Tailscale.app, whose network extension is io.tailscale.ipn.macsys.network-extension) or the Windows service.

type Kin added in v0.1.1756

type Kin struct {
	PID, PPID int
	Args      string
}

A Kin is a running process with its parent's id, as a listing of every process saw it.

type Output added in v0.1.2840

type Output struct {
	// Out and Err are the ends magpie reads.
	Out, Err *os.File
	// contains filtered or unexported fields
}

Output is a command's stdout and stderr, as pipes read apart from its Wait. cmd.StdoutPipe's end is closed by Wait, so a command whose output is read through it can only be waited for once that output has been read to the end, and the end is not the command's own: whatever it started kept a copy of its stdout (a program a plugin started, a daemon it left behind), so the reader never reached EOF after the command ended, the command was never waited for, and it stayed a <defunct> child of magpie until magpie quit (acezan on Discord: 57 magpie-bun after 47 hours). Output's command is waited for the moment it ends; its readers then have OutputGrace to read what it wrote last, and the pipes are closed, which ends their reads.

func NewOutput added in v0.1.2840

func NewOutput(cmd *exec.Cmd) (*Output, error)

NewOutput gives cmd's stdout and stderr each a pipe of an Output.

func (*Output) Close added in v0.1.2840

func (o *Output) Close()

Close closes the ends magpie reads, for an Output whose command isn't started.

func (*Output) ErrRead added in v0.1.2840

func (o *Output) ErrRead()

ErrRead says Err's reader has read to its end.

func (*Output) OutRead added in v0.1.2840

func (o *Output) OutRead()

OutRead says Out's reader has read to its end.

func (*Output) Start added in v0.1.2840

func (o *Output) Start(cmd *exec.Cmd) (wait func() error, err error)

Start starts cmd, whose output o is, and waits for it the moment it ends. wait gives what Wait said once the command has ended and its output has been read or closed; any number of goroutines can call it, any number of times. When cmd doesn't start, o is closed.

func (*Output) StartTree added in v0.1.3063

func (o *Output) StartTree(cmd *exec.Cmd) (*Tree, func() error, error)

StartTree is Start for a command started as a Tree (StartTree): what it starts in turn is ended with it by the Tree's Kill, and, once it has ended on its own, by the wait. A plugin host ended alone left the headless browser its plugin had started running with no parent, one more for every host ended (620 msedge.exe on one Windows machine, #5402).

type Process added in v0.1.368

type Process struct {
	PID  int
	Args string
}

A Process is one running on this computer, as the system lists it: its id and its command line, arguments joined by spaces.

func List added in v0.1.368

func List(ctx context.Context, prefix string) ([]Process, error)

List lists the running processes (Windows: only those named prefix*; elsewhere prefix is ignored). An error says the system couldn't be asked, not that nothing runs.

type Tree added in v0.1.183

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

A Tree is a started command and the processes it starts in turn: an agent's CLI with the MCP servers, shells and helpers it runs. Killing the CLI alone leaves those running, so they are ended with it.

func StartTree added in v0.1.183

func StartTree(cmd *exec.Cmd) (*Tree, error)

StartTree starts cmd in a group of its own: a session on Unix, a job on Windows. It has no terminal then, and a Ctrl+C there doesn't reach it.

func (*Tree) Kill added in v0.1.183

func (t *Tree) Kill()

Kill ends the command and every process of its tree.

func (*Tree) RSS added in v0.1.1519

func (t *Tree) RSS() (int64, bool)

RSS is the memory the tree holds resident, in bytes: its command's on Unix, every process of its job on Windows, where an npm install's claude.cmd is a cmd.exe with the node under it. False when it can't be read, or the command was waited for: its pid may be another process's by then.

func (*Tree) Stop added in v0.1.1241

func (t *Tree) Stop(grace time.Duration) <-chan struct{}

Stop asks the command to end, so it can clean up first, and ends its tree once it has (Wait sweeps what it left) or grace has passed (Kill). Claude Code holding its OAuth refresh lock removes it as it exits on SIGTERM, and a SIGKILL left ~/.claude/.oauth_refresh.lock behind for every later request to wait on (#2195). Windows has no such signal: the tree is killed at once there. It returns at once; the channel closes once the tree is ended. A tree no one Waits for is killed after grace.

func (*Tree) Wait added in v0.1.183

func (t *Tree) Wait() error

Wait waits for the command, then ends what it left running.

Jump to

Keyboard shortcuts

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