Repository navigation
Add process.stdin.setRawMode - #2046
ThatOneBro wants to merge 22 commits into
Conversation
77d202b to
45abcb8
Compare
|
Update on this PR: Got I'll come back to this PR to add tests after I finish the |
4d22237 to
8f66641
Compare
process.stdin.setRawModeprocess.stdin.setRawMode
4e7a511 to
2859820
Compare
|
✅ |
|
❌ @ThatOneBro 29 files with test failures on bun-darwin-x64-baseline:
|
|
needs a small rebase but looks close to mergeable nice |
| if (result < 0) { | ||
| JSC::throwException( | ||
| globalObject, throwScope, | ||
| JSC::createError(globalObject, "Failed to set tty mode. Error code: "_s + WTFMove(std::to_string(result).c_str()))); |
There was a problem hiding this comment.
Use makeString instead of + operator
| if (result < 0) { | ||
| JSC::throwException( | ||
| globalObject, throwScope, | ||
| JSC::createError(globalObject, "Failed to set tty mode. Error code: "_s + WTFMove(std::to_string(result).c_str()))); |
There was a problem hiding this comment.
Use makeString instead of + operator
|
|
||
| namespace Zig { | ||
|
|
||
| static bool tty__orig_set = false; |
There was a problem hiding this comment.
This will break when we have multiple instances of Bun's runtime
Sort of need this to be part of JSTTYHelper as an object with the relevant fields
| _ = std.c.tcgetattr(fd, &termios); | ||
| bun.C.cfmakeraw(&termios); | ||
| // var termios = std.mem.zeroes(std.os.termios); | ||
| // _ = std.c.tcgetattr(fd, &termios); |
There was a problem hiding this comment.
We need to do this for the non-readline case right?
What if you do Bun.stdin.getReader()?
|
|
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:
and also for
node:readlineinterfaces)but this is nearly ready.
Closes #2025 and closes #2239