Updated to work if ncurses and terminfo are split