harrah/xsbt — Issue #375: !: and !! does not work because history does not preserve order
Author: Blaisorblade
Created: 2012-02-19 13:44:03+00:00
State: open

With sbt 0.11.2, whenever I use '!:', the order of entries is unpredictable; therefore !! repeats the last command of an list with unspecified order, i.e. is unusable.

I'd have guessed history entries to be unordered because they were stored in a Set, but it does not seem to be the case (I can see duplicate entries).
If the entries are to be stored in a Set to avoid duplicates, might I suggest a variation of a LinkedHashSet? A variation is needed because when retyping an old command, it must be moved to the end of the Set. That seems implementable on the client side, rather than on the LinkedHashSet itself.