doc: readline.emitKeypressEvents and raw mode
`readline.emitKeypressEvents` needs `stream` to be in raw mode. PR-URL: https://github.com/nodejs/node/pull/6628 Fixes: https://github.com/nodejs/node/issues/6626 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
This commit is contained in:
parent
9c33e0ebe7
commit
1ba5a56f49
@ -364,6 +364,15 @@ input.
|
|||||||
Optionally, `interface` specifies a `readline.Interface` instance for which
|
Optionally, `interface` specifies a `readline.Interface` instance for which
|
||||||
autocompletion is disabled when copy-pasted input is detected.
|
autocompletion is disabled when copy-pasted input is detected.
|
||||||
|
|
||||||
|
Note that the stream, if it is a TTY, needs to be in raw mode:
|
||||||
|
```js
|
||||||
|
readline.emitKeypressEvents(process.stdin);
|
||||||
|
if (process.stdin.isTTY) {
|
||||||
|
// might not be a TTY if spawned from another node process
|
||||||
|
process.stdin.setRawMode(true);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## readline.moveCursor(stream, dx, dy)
|
## readline.moveCursor(stream, dx, dy)
|
||||||
|
|
||||||
Move cursor relative to it's current position in a given TTY stream.
|
Move cursor relative to it's current position in a given TTY stream.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user