On 3 September 2010 08:53, Peter Münster wrote: >> Read <http://cygwin.com/cygwin-ug-net/using-effectively.html#using-console>. >> Then add this fact - the SSH server uses ptys. So your program will not >> work with a single character put in the input buffer. One could >> envision using 'yes' to fill the buffer of the pipe that the Windows program >> interprets the pty to be. Perhaps a nicer alternative is to build the >> problematic program with Cygwin, if that's an option, so that it will >> understand the pty. > > Unfortunately, I don't have the source code of the program, so it's no option > to patch it. > > I tested mintty: it does not work. > > I understand, that there is nothing to do with a pipe to the pty or stdin. > > I'm thinking of something like this: > > ConsoleKeypressSimulator.exe --delay 10 --key y & > DosProgram.exe > > And for proper operation, the DosProgram needs a "y" keypress about 10 seconds > after begin of execution. > > So my questions are: > - Is it possible to write such a program: ConsoleKeypressSimulator.exe ? > - If yes, what is the degree of difficulty to write that?
I've written a utility called 'conin' that translates pty input to console events. Perhaps that'll do the job. See here: http://groups.google.com/group/mintty-discuss/browse_thread/thread/1f9cf480117b8a0b In any case, it should demonstrate how to generatate console input events. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple