Cross-platform PTY (pseudo-terminal) spawning for MoonBit native targets, integrated with moonbitlang/async.
Dependencies
@async.with_task_group(group => {
let pty = @pty.spawn(
group,
"sh", ["-c", "echo hello"],
rows=24, cols=80,
cwd="/workspace",
)
let text = pty.read_all().text() // Pty implements @io.Reader
pty.write(b"ls\n") // ... and @io.Writer
pty.resize(rows=40, cols=120)
let pid : Int = pty.pid()
let exit_code : Int = pty.wait()
})type PtyCross-platform PTY (pseudo-terminal) spawning for MoonBit native targets, integrated with moonbitlang/async.
Dependencies