can detect i/o redirection, now trying to get stdin working