I think that you have confused STDIN with the keyboard that it is usually connected to. In your script, STDIN is open to the pipe. The end-of-file does not change that. You probably have to reopen STDIN to the keyboard yourself. I have not been able to do this in windows. I cannot make a reasonable guess for how to do it on any other system.