Improve printout in telnet- remove non-printing characters correctly.