Skip to content

Commit

Permalink
NODE_NO_READLINE support (#1090)
Browse files Browse the repository at this point in the history
* NODE_NO_READLINE support

https://nodejs.org/api/repl.html#repl_using_the_node_js_repl_with_advanced_line_editors

* Update bin.ts

* Update bin.ts

* Update bin.ts

* Update bin.ts
  • Loading branch information
cspotcode committed Aug 4, 2020
1 parent 436e3a8 commit 8dfb75c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin.ts
Expand Up @@ -363,7 +363,8 @@ function startRepl (service: Register, state: EvalState, code?: string) {
prompt: '> ',
input: process.stdin,
output: process.stdout,
terminal: process.stdout.isTTY,
// Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30
terminal: process.stdout.isTTY && !parseInt(process.env.NODE_NO_READLINE!, 10),
eval: replEval,
useGlobal: true
})
Expand Down

0 comments on commit 8dfb75c

Please sign in to comment.