Add working terminal nonblocking stdin read and initial select() code.