summaryrefslogtreecommitdiff
path: root/doc/api/repl.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-08 12:21:35 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-25 16:28:07 +0100
commit97737fd5fb4a6b36c2e65905b8cf3518499a8a5e (patch)
tree0028cc7ca3c42d3474097f86d8b0c026a34d633d /doc/api/repl.md
parent96204c3c71f6cc571be56269ba9d584d615f0a06 (diff)
downloadandroid-node-v8-97737fd5fb4a6b36c2e65905b8cf3518499a8a5e.tar.gz
android-node-v8-97737fd5fb4a6b36c2e65905b8cf3518499a8a5e.tar.bz2
android-node-v8-97737fd5fb4a6b36c2e65905b8cf3518499a8a5e.zip
repl: fix terminal default setting
This makes sure that the described default behavior for the `terminal` option is actually always used and not only when running the REPL as standalone program. The options code is now logically combined instead of being spread out in the big REPL constructor. PR-URL: https://github.com/nodejs/node/pull/26518 Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/repl.md')
-rw-r--r--doc/api/repl.md11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/api/repl.md b/doc/api/repl.md
index 4ea2e8c906..cc7f3f96da 100644
--- a/doc/api/repl.md
+++ b/doc/api/repl.md
@@ -479,6 +479,10 @@ with REPL instances programmatically.
<!-- YAML
added: v0.1.91
changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/REPLACEME
+ description: The `terminal` option now follows the default description in
+ all cases and `useColors` checks `hasColors()` if available.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/19187
description: The `REPL_MAGIC_MODE` `replMode` was removed.
@@ -495,7 +499,7 @@ changes:
* `output` {stream.Writable} The `Writable` stream to which REPL output will
be written. **Default:** `process.stdout`.
* `terminal` {boolean} If `true`, specifies that the `output` should be
- treated as a TTY terminal, and have ANSI/VT100 escape codes written to it.
+ treated as a TTY terminal.
**Default:** checking the value of the `isTTY` property on the `output`
stream upon instantiation.
* `eval` {Function} The function to be used when evaluating each given line
@@ -504,8 +508,9 @@ changes:
the input was incomplete and prompt for additional lines.
* `useColors` {boolean} If `true`, specifies that the default `writer`
function should include ANSI color styling to REPL output. If a custom
- `writer` function is provided then this has no effect. **Default:** the
- REPL instances `terminal` value.
+ `writer` function is provided then this has no effect. **Default:** checking
+ color support on the `output` stream if the REPL instance's `terminal` value
+ is `true`.
* `useGlobal` {boolean} If `true`, specifies that the default evaluation
function will use the JavaScript `global` as the context as opposed to
creating a new separate context for the REPL instance. The node CLI REPL