add: setenv("TTY", name, true);
context: start_console(struct console *con){	DIR *dir;	memset(con, 0, sizeof(struct console));	con->wait_sem = create_sem(0, "console wait sem");	if (con->wait_sem < 0)		return -1;	con->console_fd = open("/dev/console", 0);	if (con->console_fd < 0)		return -2;	con->keyboard_fd = open("/dev/keyboard", 0);	if (con->keyboard_fd < 0)		return -3;	dir = opendir("/dev/pt");	if (dir != NULL) {		struct dirent *entry;		char name[64];			while ((entry = readdir(dir)) != NULL) {			if (entry->d_name[0] == '.')				continue;				sprintf(name, "/dev/pt/%s", entry->d_name);			puts(name);				con->tty_master_fd = open(name, O_RDWR);			if (con->tty_master_fd >= 0) {				sprintf(name, "/dev/tt/%s", entry->d_name);					con->tty_slave_fd = open(name, O_RDWR);				if (con->tty_slave_fd < 0) {					fprintf(stderr, "Could not open tty!\n");					close(con->tty_master_fd);				} else {					// set default mode					struct termios termios;					if (tcgetattr(con->tty_slave_fd, &termios) == 0) {						termios.c_iflag = ICRNL;						termios.c_oflag = OPOST | ONLCR;						termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHONL;						tcsetattr(con->tty_slave_fd, TCSETA, &termios);					}				}				break;			}		}	}	if (con->tty_master_fd < 0 || con->tty_slave_fd < 0)		return -4;	con->keyboard_reader = spawn_thread(&console_reader, "console reader", B_URGENT_DISPLAY_PRIORITY, con);	if (con->keyboard_reader < 0)		return -7;	con->console_writer = spawn_thread(&console_writer, "console writer", B_URGENT_DISPLAY_PRIORITY, con);	if (con->console_writer < 0)		return -8;	resume_thread(con->keyboard_reader);	resume_thread(con->console_writer);	return 0;}