diff --git a/doc/api/repl.md b/doc/api/repl.md index 70f77af48490a3..b526096692a0a0 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -597,8 +597,9 @@ changes: `SIGINT` is received, such as when `Ctrl+C` is pressed. This cannot be used together with a custom `eval` function. **Default:** `false`. * `preview` {boolean} Defines if the repl prints autocomplete and output - previews or not. **Default:** `true`. If `terminal` is falsy, then there are - no previews and the value of `preview` has no effect. + previews or not. **Default:** `true` with the default eval function and + `false` in case a custom eval function is used. If `terminal` is falsy, then + there are no previews and the value of `preview` has no effect. * Returns: {repl.REPLServer} The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance. diff --git a/lib/repl.js b/lib/repl.js index a86cba0624b6dc..e4a7e9474ee054 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -214,8 +214,9 @@ function REPLServer(prompt, } } + // TODO(devsnek): Add a test case for custom eval functions. const preview = options.terminal && - (options.preview !== undefined ? !!options.preview : true); + (options.preview !== undefined ? !!options.preview : !eval_); this.inputStream = options.input; this.outputStream = options.output;