I resolved the issue, but cannot use PumpStreamHandler - had to write my own.
PumpStreamHandler implementation looks wrong to me now. 1) InputStreamPumper, what is used in case of System.in input waits for available() to return grater than 0, but it is not guarantied, and looks like in Windows it returns such only after <Enter> is pressed - that cased my original issue; 2) StreamPumper, what is used in other cases (for example if I wrap System.in in my own implementation) will read into buffer and therefore might wait until the whole buffer is filled in. Regards, AlexP On Mon, Apr 28, 2014 at 4:15 AM, Siegfried Goeschl <[email protected]> wrote: > Hi Alexander, > > no idea but the OS behave a bit differently especially with Windows stream > re-direction does not work perfectly > > Cheers, > > Siegfried Goeschl > > On 24.04.14 22:26, Alexander Prishchepov wrote: > >> Hello, All. >> >> I am starting new process with DefaultExecutor like that: >> ---------------------------------------------------------------------- >> DefaultExecutor executor = new DefaultExecutor(); >> executor.setStreamHandler(new PumpStreamHandler(System.out, >> System.err, System.in)); >> executor.execute(<some command line>); >> ---------------------------------------------------------------------- >> >> Everything works great, but somehow in windows command prompt input is >> not visible right away - only after <Enter> is pressed. >> Any idea, why that might happen? >> >> Tested it on unix (Solaris), and it does not happen - input is visible as >> I type. >> >> Regards, >> AlexP >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
