An ncurses menu for selecting a subset of given lines