All commands are added to the history rather than just commands typed by users
Every command that is run is being added to the history, not just commands that are executed via the [ALT]+! and [ALT]+| sequences. It would be better to just store the commands that the user types, and not store commands since they are often more complex.
An easy solution might be to add a flag along the lines of add_to_history or some such and just set it to true for the keyboard commands.
Whilst working on my GitMode extension I realise that it would be nice to have different histories for different configurations. So perhaps setting add_to_history to true should result in a history being used that is keyed on the title.
Alternatively, the add_to_history parameter could take the name of a history list to add to, so that many different commands could share the same history.