Skip to content

Commit 8dfb75c

Browse files
authored
NODE_NO_READLINE support (#1090)
* 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
1 parent 436e3a8 commit 8dfb75c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ function startRepl (service: Register, state: EvalState, code?: string) {
363363
prompt: '> ',
364364
input: process.stdin,
365365
output: process.stdout,
366-
terminal: process.stdout.isTTY,
366+
// Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30
367+
terminal: process.stdout.isTTY && !parseInt(process.env.NODE_NO_READLINE!, 10),
367368
eval: replEval,
368369
useGlobal: true
369370
})

0 commit comments

Comments
 (0)