make terminal search generic through in/out expr