Fixed TextWriter to ignore a command you type if you had just typed it.
This way it doesn't get confused when there are two of the same command
in a row in the history. This probably still needs fixing