fix a bug of getting term info and don't use libcurses