terminfo(): cache results