capture input from stdin transparently