Skip to content

Commit 20fdf3a

Browse files
committed
doc: add some info on tty#setRawMode()
Partially taken from https://linux.die.net/man/3/cfmakeraw A very simple test script: ``` if (process.argv[2] === 'raw') process.stdin.setRawMode(true) process.stdin.on('data', (chunk) => { console.log(chunk) console.log(chunk.toString()) }) ``` Refs: #10037 PR-URL: #10147 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent ca38f70 commit 20fdf3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/tty.md

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ raw device. Defaults to `false`.
5050
added: v0.7.7
5151
-->
5252

53+
Allows configuration of `tty.ReadStream` so that it operates as a raw device.
54+
55+
When in raw mode, input is always available character-by-character, not
56+
including modifiers. Additionally, all special processing of characters by the
57+
terminal is disabled, including echoing input characters.
58+
Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode.
59+
5360
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
5461
raw device. If `false`, configures the `tty.ReadStream` to operate in its
5562
default mode. The `readStream.isRaw` property will be set to the resulting

0 commit comments

Comments
 (0)