Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: extra clarification of historySize option
doc: extra clarification of historySize option

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 #6352 landing.
  • Loading branch information
vsemozhetbyt committed Apr 26, 2016
commit ea3c6942c95c9ea31604afbb826a0a8adfa5b5c1
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 `true` by user or by internal `output` check,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is set to `true`

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