added init_terminal, get_win_size