add support for end and home keys
fix escape key
exclude the first 32 non-printing characters