Lines in the history never change, each input line is added to the end (unless it is a duplicate of the last item). A new history_index member keeps track of where the up/down arrows have moved in the history. Preserved the previous down-arrow behavior of going to the item after the one that was copied, this is useful in Python for re-entering a multi-line block. Ref !119356