If you use the code in the synopsis as is, then there are duplicate entries, for each input, in the history, and one has to use the up arrow key twice to access the preceding history item(s).
This is because Term::ReadLine also writes to the history, by default, and then UI.pm writes to the history again in _tt_readline().
The code in the synopsis should probably include the following line(s) in order to disable the autohistory and hence the duplication.
# This disables autohistory
$term->MinLine(MAX);
As the code in the synopsis currently stands:
- If you select the default inputs, then the first up key with give "blue" and the second a blank entry.
- If you select a non-default input then that input will be shown twice, i.e. first up key gives "green" and then the second up key gives "green", or (if the index was used to select), "3" and then "3"
Which isn't desired behaviour.
If you use the code in the synopsis as is, then there are duplicate entries, for each input, in the history, and one has to use the up arrow key twice to access the preceding history item(s).
This is because
Term::ReadLinealso writes to the history, by default, and then UI.pm writes to the history again in_tt_readline().The code in the synopsis should probably include the following line(s) in order to disable the autohistory and hence the duplication.
As the code in the synopsis currently stands:
Which isn't desired behaviour.