Append to history after every command