move virtual terminal switching into cmd_input. (dm)