handle some terminal characters