Add support for putty terminals to fix problems with escaping

To fix issues with escaping when using of some characters in insert mode for putty terminals.