Protect Ex_Mode if TTY support is not built
Use ncurses instead of hand-made functions