Closed nkh closed 2 years ago
--history-no-dupes 2
only influences what is put in the history file for the current session. It does not rewrite history
I agree that the manual suggests otherwise:
n = 2 will make
rlwrap
drop all previous occurrences of the current input from the list.
I prefer the current behaviour as less intrusive (and it wouldn't be difficult to write a script to sanitise your duplicate-ridden history file)
I'll mark this as a "manpage bug"
Clarified this in manpage (see 9d6d5f1d3bdccc3144cc076ad7335e06326da4b9)
command: order=$(rlwrap --history-no-dupes 2 -pYellow -S 'Your pizza? ' -H past_orders -P Margherita -o ./silent)
past_orders file contents: Margheritarlökmefref Margherita Margheritaxxx Margherita Margheritaxxx Margherita
I expected the history to be like listing below when n is 2 Margheritarlökmefref Margheritaxxx Margherita