Commit 5bda5faf authored by Danny Nemer's avatar Danny Nemer Committed by Jeremiah Senkpiel
Browse files

readline: add option to stop duplicates in history

Adds `options.deDupeHistory` for `readline.createInterface(options)`. If
`options.deDupeHistory` is `true`, when a new input line being added to
the history list duplicates an older one, removes the older line from
the list. Defaults to `false`.

Many users would appreciate this option, as it is a common setting in
shells. This option certainly should not be default behavior, as it
would be problematic in applications such as the `repl`, which inherits
from the readline `Interface`.

Extends documentation to reflect this API addition.

Adds tests for when `options.deDupeHistory` is truthy, and when
`options.deDupeHistory` is falsey.

PR-URL: https://github.com/nodejs/node/pull/2982


Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
parent df69d95b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment