mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fixes #23333, Fixes #13978 ### What does this PR do? ### How did you verify your code works? --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: pfg <pfg@pfg.pw> Co-authored-by: Zack Radisic <zack@theradisic.com>
16 lines
455 B
JavaScript
16 lines
455 B
JavaScript
// Child that reads from stdin
|
|
process.stdin.setRawMode(true);
|
|
let count = 0;
|
|
console.log("CHILD: reading");
|
|
console.log("%ready%");
|
|
process.stdin.on("data", chunk => {
|
|
const chunkStr = chunk.toString("utf-8");
|
|
console.log("CHILD: received " + JSON.stringify(chunkStr));
|
|
|
|
if (chunkStr.includes("\x03") || chunkStr.includes("\r") || chunkStr.includes("\n")) {
|
|
console.log("CHILD: exiting");
|
|
process.exit(0);
|
|
}
|
|
console.log("%ready%");
|
|
});
|