Download packages/core/src/pty/pty.bun.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 567 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/pty/pty.bun.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/src/pty/pty.bun.ts
-
curl -L -o pty.bun.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/pty/pty.bun.ts
567 Bytes
| import { spawn as create } from "bun-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 pty = create(file, args, opts) | |
| return { | |
| pid: pty.pid, | |
| onData(listener) { | |
| return pty.onData(listener) | |
| }, | |
| onExit(listener) { | |
| return pty.onExit(listener) | |
| }, | |
| write(data) { | |
| pty.write(data) | |
| }, | |
| resize(cols, rows) { | |
| pty.resize(cols, rows) | |
| }, | |
| kill(signal) { | |
| pty.kill(signal) | |
| }, | |
| } | |
| } | |