delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/03/04:14:09

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20100903075312.GA18543@gaston.couberia.bzh>
References: <20100902074703 DOT GA11464 AT gaston DOT couberia DOT bzh> <4C7FC3B4 DOT 1060606 AT cygwin DOT com> <20100903075312 DOT GA18543 AT gaston DOT couberia DOT bzh>
Date: Fri, 3 Sep 2010 09:13:51 +0100
Message-ID: <AANLkTimqKgNBqQH9dc5ceQevTr7qPC_=odn7DOQd52k4@mail.gmail.com>
Subject: Re: simulating console input
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 3 September 2010 08:53, Peter M=C3=BCnster wrote:
>> Read <http://cygwin.com/cygwin-ug-net/using-effectively.html#using-conso=
le>.
>> Then add this fact - the SSH server uses ptys. =C2=A0So your program wil=
l not
>> work with a single character put in the input buffer. =C2=A0One could
>> envision using 'yes' to fill the buffer of the pipe that the Windows pro=
gram
>> interprets the pty to be. =C2=A0Perhaps 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 op=
tion
> 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 se=
conds
> 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/1f9cf480=
117b8a0b

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019