| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c7b6e2 commit 2273971
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -362,6 +362,15 @@ Move cursor to the specified position in a given TTY stream. | |||
| 362 | 362 | Causes `stream` to begin emitting `'keypress'` events corresponding to its | |
| 363 | 363 | input. | |
| 364 | 364 | ||
| 365 | + Note that the stream, if it is a TTY, needs to be in raw mode: | ||
| 366 | + ```js | ||
| 367 | + readline.emitKeypressEvents(process.stdin); | ||
| 368 | + if (process.stdin.isTTY) { | ||
| 369 | + // might not be a TTY if spawned from another node process | ||
| 370 | + process.stdin.setRawMode(true); | ||
| 371 | + } | ||
| 372 | + ``` | ||
| 373 | + | ||
| 365 | 374 | ## readline.moveCursor(stream, dx, dy) | |
| 366 | 375 | ||
| 367 | 376 | Move cursor relative to it's current position in a given TTY stream. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments