Download packages/core/src/pty/pty.node.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 658 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/pty/pty.node.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/src/pty/pty.node.ts
-
curl -L -o pty.node.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/pty/pty.node.ts
658 Bytes
| 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, | |
| ...(process.platform === "win32" ? { useConptyDll: true } : {}), | |
| }) | |
| 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) | |
| }, | |
| } | |
| } | |