Skip to content

Commit

Permalink
doc: add some info on tty#setRawMode()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Fishrock123 authored and MylesBorins committed Jan 24, 2017
1 parent 29e7de9 commit 3d3263c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ raw device. Defaults to `false`.
added: v0.7.7
-->

Allows configuration of `tty.ReadStream` so that it operates as a raw device.

When in raw mode, input is always available character-by-character, not
including modifiers. Additionally, all special processing of characters by the
terminal is disabled, including echoing input characters.
Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode.

* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
Expand Down

0 comments on commit 3d3263c

Please sign in to comment.