Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: Brendan Allan <git@brendonovich.dev>
28 lines
599 B
TypeScript
28 lines
599 B
TypeScript
/** @ts-expect-error */
|
|
import * as pty from "@lydell/node-pty"
|
|
import type { Opts, Proc } from "./pty"
|
|
|
|
export type { Disp, Exit, Opts, Proc } from "./pty"
|
|
|
|
export function spawn(file: string, args: string[], opts: Opts): Proc {
|
|
const proc = pty.spawn(file, args, opts)
|
|
return {
|
|
pid: proc.pid,
|
|
onData(listener) {
|
|
return proc.onData(listener)
|
|
},
|
|
onExit(listener) {
|
|
return proc.onExit(listener)
|
|
},
|
|
write(data) {
|
|
proc.write(data)
|
|
},
|
|
resize(cols, rows) {
|
|
proc.resize(cols, rows)
|
|
},
|
|
kill(signal) {
|
|
proc.kill(signal)
|
|
},
|
|
}
|
|
}
|