Added ANSI terminal control functionality