Add support for putty terminals to fix problems with escaping insert mode