Skip to content

Commit

Permalink
doc: extra clarification of historySize option
Browse files Browse the repository at this point in the history
History caching in the `readline` io is active only for terminal
interaction. Appropriate variables are initialized and relevant
`_addHistory()` function is called only if exposed `terminal` option
of `readline.createInterface()` is set `true` by user or internal
output check.

This clarification is useful to assure users there will be now wasted
overhead connected with history caching if `readline` is used not
for terminal interaction (e.g. for reading files line by line).

Particularly this fix is helpful after nodejs#6352 landing.

PR-URL: nodejs#6397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Alexander Makarenko <estliberitas@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
vsemozhetbyt authored and joelostrowski committed May 4, 2016
1 parent 4fb8d4d commit bde4d24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ the following values:
Defaults to checking `isTTY` on the `output` stream upon instantiation.

- `historySize` - maximum number of history lines retained. To disable the
history set this value to `0`. Defaults to `30`.
history set this value to `0`. Defaults to `30`. This option makes sense
only if `terminal` is set to `true` by the user or by an internal `output`
check, otherwise the history caching mechanism is not initialized at all.

The `completer` function is given the current line entered by the user, and
is supposed to return an Array with 2 entries:
Expand Down

0 comments on commit bde4d24

Please sign in to comment.