tty: add raw-vt and io raw modes#64140
Conversation
f8d0128 to
5831aec
Compare
| raw device. If `false`, configures the `tty.ReadStream` to operate in its | ||
| default mode. The `readStream.isRaw` property will be set to the resulting | ||
| mode. | ||
| * `mode` {boolean|string} If `true` or `'raw-vt'`, configures the |
There was a problem hiding this comment.
I would not use 'raw-vt' as a name and instead just use 'raw'. UV_TTY_MODE_RAW_VT is what UV_TTY_MODE_RAW should probably have been all along – the only reason they aren't merged (yet) into a single constant is backwards compatibility expectations in libuv.
There was a problem hiding this comment.
Agreed, updated.
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
5831aec to
15fdba0
Compare
|
Related libuv hardening PR: libuv/libuv#5174 That PR makes Unix |
|
I can't see the CI failures, it says access denied. |
|
@samuel-williams-shopify The failures seem exclusively related to alpine: Not sure what's different on the Alpine runners, I guess if there's no obvious reason for this it might be fine to silence stderr for |
Adds string raw-mode selection to
tty.ReadStream#setRawMode():setRawMode(true)keeps the existing behavior.setRawMode('raw')explicitly selects the existing Node raw mode, backed by libuvUV_TTY_MODE_RAW_VT.setRawMode('io')selects libuvUV_TTY_MODE_IOfor binary-safe I/O mode on Unix.readStream.rawModeexposes the exact current mode whilereadStream.isRawremains boolean for compatibility.This is intended to address the output-processing distinction discussed in #63059 and follows libuv's existing
UV_TTY_MODE_IOsemantics. It preserves the currentsetRawMode(true)behavior instead of changing it.Related libuv hardening PR: libuv/libuv#5174
Refs: #63059
Refs: libuv/libuv#32
Local verification:
git diff --checkpasses.build-script-buildexecutables as untrusted on this machine; relying on CI for the native build and pseudo-tty test run.