The terminal attached to this subprocess, if spawned with the terminal option. Returns undefined if no terminal was attached.
When a terminal is attached, stdin, stdout, and stderr return null. Use terminal.write() and the data callback instead.
Search the reference...
/
property
The terminal attached to this subprocess, if spawned with the terminal option. Returns undefined if no terminal was attached.
When a terminal is attached, stdin, stdout, and stderr return null. Use terminal.write() and the data callback instead.
const proc = Bun.spawn(["bash"], {
terminal: { data: (term, data) => console.log(data.toString()) },
});
proc.terminal?.write("echo hello\n");
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →