clear cmd at each pass in ncurses patch