www.delorie.com/archives/browse.cgi | search |
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:to:from:subject:date:message-id:references | |
:mime-version:content-type:content-transfer-encoding; q=dns; s= | |
default; b=k4Diatx08RnK0P5va9a6Wu/APYkyseGzBV9YA6YRuRfQDsHiIcq3I | |
ZVkY+QKWP9MOmh+icP5F9RxDaq+SWJ6AWTIrmN01qaXH1W88xik6q1FxFSI2RcvG | |
0iQ4x9cPwhH8IAAeCnQekar0lH6AyyRbRQvQwG0A52lRH/ifg4hB2Q= | |
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:to:from:subject:date:message-id:references | |
:mime-version:content-type:content-transfer-encoding; s=default; | |
bh=ZRNnaUwYZWkvoK/L1ZSNI1rZRKQ=; b=flWKKWQJQ/6ouVqUJnJrJ5IemfZm | |
j67GdkvQpCbSKRyHL0aJY09PIBudp62b7gI8XyTa7U8XMviz2m+UKfkcCshsvjci | |
Fmr2mgStUcnJBrOAerDF+u9Ak6oUXr6BOb+ulXKLs5rGH3CuLMQK/zQcSVlWnn8L | |
/uEzOIhZl06gFWM= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.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 |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=1.8 required=5.0 tests=AWL,BASE64_LENGTH_79_INF,BAYES_50,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 |
X-HELO: | plane.gmane.org |
To: | cygwin AT cygwin DOT com |
From: | Keith Proctor <keith_proctor AT filemaker DOT com> |
Subject: | Re: Cannot change console mode during usage of expect |
Date: | Wed, 15 Apr 2015 17:57:19 +0000 (UTC) |
Lines: | 1 |
Message-ID: | <loom.20150415T192545-607@post.gmane.org> |
References: | <loom DOT 20150415T025305-586 AT post DOT gmane DOT org> <20150415073302 DOT GU7343 AT calimero DOT vinschen DOT de> |
Mime-Version: | 1.0 |
User-Agent: | Loom/3.14 (http://gmane.org/) |
X-IsSubscribed: | yes |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id t3FHvkfm026834 |
Corinna Vinschen <corinna-cygwin <at> 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 tests work beautifully on > > Macintosh. I’m trying to Use Cygwin on Windows to reduce the > > amount of rewriting that I must do on the Windows side. The > > test includes a dynamically created interactive call that uses > > expect to spawn fmsadmin and then interact with fmsadmin by > > providing a user name or a password. An example is below: > > > > expect -c "spawn fmsadmin open -y -u userName > > expect -r .+: > > send myPassword\r > > interact" > > > > The issue is that the following phrases appear and won’t allow > > my interactive expect command to continue. > > > > GetConsoleMode // prints once > > SetConsoleMode // prints once > > ReadConsoleInput // spews while collecting input from the command line. > > I don't understand this. What does Cygwin expect have to do > with these underlying OS calls?!? They only work in a console > 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? > And expect certainly uses PTYs to perform its pseudo-interactive stuff. > > Corinna > 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. If I don't use expect fmsadmin works without the spam of the ReadConsoleInput strings. IOW the calls to the Getter and Setter methods work correctly. The output looks something like this when I do it by hand. >fmsadmin open -y -u userName >password:myPassword Opening file: someFile.fmp12 Opening file: someOtherFile.fmp12 Opened file: someFile.fmp12 Opened file: someOtherFile.fmp12 So this works as expected in the Cygwin Window when doing the command by hand. It is somehow an interaction between Cygwin and the expect command not allowing the Setter/Getter methods for Console Mode to be accepted. I have NO understanding WHY this would be the case. All I did was localize down the behavior and the failure to work correctly. I am still hoping that the default settings are somehow wrong and I need to make some small change to Cygwin to allow GetConsoleMode and SetConsoleMode calls to correctly work. 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. BTW, I expect GetConsoleMode and SetConsoleMode is standard usage by any console application. These calls work on Macintosh, Windows and Cygwin window without expect. HTH and many thanks, Keith
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |