reading input for next and interrupt. Added terminal controller class to handle the input via curses.