Fixing an issue with the terminal where dodgy characters corrupt the history leading to trouble