MCPcopy Create free account
hub / github.com/anomalyco/opencode / spawn

Function spawn

packages/core/src/pty/pty.node.ts:6–26  ·  view source on GitHub ↗
(file: string, args: string[], opts: Opts)

Source from the content-addressed store, hash-verified

4export type { Disp, Exit, Opts, Proc } from "./pty"
5
6export function spawn(file: string, args: string[], opts: Opts): Proc {
7 const proc = pty.spawn(file, args, opts)
8 return {
9 pid: proc.pid,
10 onData(listener) {
11 return proc.onData(listener)
12 },
13 onExit(listener) {
14 return proc.onExit(listener)
15 },
16 write(data) {
17 proc.write(data)
18 },
19 resize(cols, rows) {
20 proc.resize(cols, rows)
21 },
22 kill(signal) {
23 proc.kill(signal)
24 },
25 }
26}

Callers

nothing calls this directly

Calls 1

spawnMethod · 0.80

Tested by

no test coverage detected