Another try at fixing echo'ing of ANSI chars