bun
bun copied to clipboard
[WIP] Add `process.stdin.setRawMode`
Still need to finish wiring things and make sure the mode is set properly for a few different cases (namely, async iteration of console, ie:
for await (const line of console)...
and also for node:readline interfaces)
but this is nearly ready.
Closes #2025
Update on this PR: Got process.stdin.isRaw and process.stdin.setRawMode working now, though I do need to add some tests to verify that it's working in all cases (such as when we try to do read from async iter on console). I don't think this will currently work, as I probably still have to set raw mode for the duration of that iter maybe... We'll see.
I'll come back to this PR to add tests after I finish the undici polyfills, which should be tonight.
❌ @ThatOneBro 29 files with test failures on bun-darwin-x64-baseline:
test/bundler/transpiler.test.jstest/js/bun/console/console-iterator.test.jstest/js/bun/http/serve.test.tstest/js/bun/net/socket.test.tstest/js/bun/resolve/png/test-png-import.test.jstest/js/bun/resolve/resolve.test.jstest/js/bun/spawn/spawn.test.tstest/js/bun/sqlite/sqlite.test.jstest/js/bun/util/escapeHTML.test.jstest/js/bun/util/sleepSync.test.tstest/js/deno/crypto/webcrypto.test.tstest/js/deno/encoding/encoding.test.tstest/js/deno/fetch/headers.test.tstest/js/deno/fetch/request.test.tstest/js/deno/fetch/response.test.tstest/js/deno/url/url.test.tstest/js/deno/v8/error.test.tstest/js/node/child_process/child_process-node.test.jstest/js/node/disabled-module.test.jstest/js/node/fs/fs.test.tstest/js/node/process/process-stdio.test.tstest/js/node/process/process.test.jstest/js/node/util/util-promisify.test.jstest/js/node/util/util.test.jstest/js/third_party/napi_create_external/napi-create-external.test.tstest/js/web/abort/abort.test.tstest/js/web/fetch/body.test.tstest/regression/issue/00631.test.tstest/regression/issue/02368.test.ts
needs a small rebase but looks close to mergeable
nice
setRawMode was implemented in Bun v0.8.0.