X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=JWCcRxa3aWHPJA1118vX436dQyIUXf1FW5s8wn7fKhiNtYDZEmKEt fLmJfwKLKTPmmGbeCEHpBx62QDw4Sl8wR0d/cw0O6N7ryohnNtGnQA8l0qUwDAgS J+eTxhS2Wq+Fhw1Ja5bnKCWaw5B7gy1JGUZjA2jijZOPnTxZnlLSas= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=quza0KyDO7NrNq2lxnJvk+OROV8=; b=hDj/xxb5tZQTDTwb8x3uzksjuJli I6r8XIeDZRW/jTa2Ij5g0wkX21ooHqg5R1nB3zW8Z9+rOpyBqiCVSbdsx+wtkMyQ N0xSOvn8BzarXPZjmN0cxGyoNQwr1lzfAfdPMv5UP8YPMYZruRFfYUX32KCguOpG LfKgUkHtzA86n4I= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Thu, 16 Apr 2015 09:36:39 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cannot change console mode during usage of expect Message-ID: <20150416073639.GA3657@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20150415073302 DOT GU7343 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) --jI8keyz6grp/JLjh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Apr 15 17:57, Keith Proctor wrote: > Corinna Vinschen cygwin.com> writes: > > On Apr 15 01:17, Keith Proctor wrote: > > > Hello, my name is Keith Proctor. I test FileMaker Server and I have > > > written a test suite on Macintosh. > > > [...] > > > The issue is that the following phrases appear and won=E2=80=99t allow > > > my interactive expect command to continue. > > >=20 > > > GetConsoleMode // prints once > > > SetConsoleMode // prints once > > > ReadConsoleInput // spews while collecting input from the command lin= e. > >=20 > > I don't understand this. What does Cygwin expect have to do > > with these underlying OS calls?!? They only work in a console=20 > > window and they are not to be suppsoed to be used by Cygwin > > executables since all the underlying OS details are (more or less) > > hidden behind the TTY code. Also, how are they supposed to work > > in a PTY which is constituted by Named Pipes, not a console?=20=20 > > And expect certainly uses PTYs to perform its pseudo-interactive stuff. > >=20 > Corinna, Let me make this a little clearer fmsadmin application is making > the 3 calls. In this case fmsadmin is being called from expect and expect > is the cause of the issue. Well, not really. The cause of the issue is that fmsadmin uses these calls. Fmsadmin apparently expects to run in a normal Windows console. Expect on the other hand is a Cygwin POSIX application, so it's using Cygwin PTYs and offers those as stdio descriptors to the inferior application. The problem here seems to be that you're expecting Cygwin to do something it doesn't, and fmsadmin not being a Cygwin application not being able to work seamlessly with a Cygwin POSIX appication in this regard. > On a very related note I see this same question being asked for years > and the Cygwin answer has been change your code to work with > Cygwin. Unfortunately, I don't have that luxury. fmsadmin is a > DOS application. I may never be able to get a fix for this issue in > fmsadmin as our target is NOT Cygwin.=20=20 Which makes me wonder if using Cygwin is the right thing to do here. > BTW, I expect GetConsoleMode and SetConsoleMode is standard > usage by any console application. These calls work on Macintosh, > Windows and Cygwin window without expect. I have no idea what Mac you're talking about. IIUC OS X is a BSD-based system and it does not provide Windows-only calls. And GetConsoleMode, SetConsoleMode, and ReadConsoleInput are Windows calls. I have a hard time to believe that an OS X console uses the weird Windows console API. Unless, of course, you're running a Windows fmsadmin tool under some OS X Windows emulator. Does wine for OS X exist? As for Cygwin I'd like to stress that Cygwin tries to emulate POSIX in the first place. An application like expect will be compiled under Cygwin as a POSIX application. It will quite certainly not use or understand Windows calls. As a POSIX application, it will have no notion of Windows consoles and it will use PTYs as communication channels to the inferior process. PTYs are Cygwin-specific, implemented using named pipes under the hood. Named Pipes very certainly don't support the console API. The bottom line is, the fmsadmin tool, as a native Windows application, expects to perform I/O via the Windows Console. Thus it uses the Windows console API. Cygwin's expect on the other hand, is implemented as POSIX application and as such, uses POSIX means, PTYs. I don't see how the two of them can come together. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --jI8keyz6grp/JLjh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVL2aHAAoJEPU2Bp2uRE+gbgoP/jZYzGT2rkFxDpwWOG0MM/XH V2ZtLSnsX3f5xck/raRglAOqKKY5lqTC4Y0XJkatpcmXxN1UKxmVabB4OmFh8dZZ LbDhsi/ukSdDsR83jO5uQfC6ckDKAPCSb+mv/43oeeOWLyzdIvWSu/oBmriY26qC CS0dIGdLX/iErpBAU9B3QQy2fXE8nS/JWqa8pU43NZURDjTNxYabPFey/mJPxHp7 pcfvAxjVuJ+322ItP/iukf2Bwg8FkFNwF4iD1/C5ybQv1Dg8kfg//suVIBeZCUeg deKxHwh6XM2V1g/k3XqjM88+wQzgaxB2GSPRfl9OlL0dU0Wvk57VJbl7oy0UBeTP SyTHv683gwK/WPcXCVsG/YZqrR7+lxP0xfMDGGZP5JPAkWhIjMzCL77suzikFhIg AQD9OwZiVOjjRnYkA2G63YKgAPukDr1tzSynW5z/xgBWPn1Eh1HnCxeWKn+CtsCo ISiXHLisZxgLnXC5MikOabMe9wlZpd+2Qxp78ZvS7px9C2vVtO993qMv09QE4gwY jkiR7uisPuE1mZ0+Do3lNOKc6pnf9EEIKkEisvyhsQ6WjrPLSJbMqBX6YpSDHyb1 QQOz/5iD3wmpygRBKPN1pdnFZM/VPIElVa6J15SJeLrr3Y0fLJz0PKrl/8n/Jjpf qo3GhmtMN36AGi6s60bW =OpxK -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--