This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Cannot change console mode during usage of expect
- From: Keith Proctor <keith_proctor at filemaker dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 15 Apr 2015 01:17:09 +0000 (UTC)
- Subject: Cannot change console mode during usage of expect
- Authentication-results: sourceware.org; auth=none
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.
Perform the actions of the script above by hand in the Cygwin CLI does NOT
cause an issue. The issue only happens when using expect. I have tried 3
shells so far (mintty, bash, rxvt). Are there more? Mintty provides access to
the terminal types. So far I have tried xterm-256, vt100, vt120.
An example of the code looks like:
fdwMode = ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT
| ENABLE_PROCESSED_INPUT;
if (! SetConsoleMode(hStdin, fdwMode) )
// print error to console
Since FileMaker Server runs on Macintosh or Windows it is doubtful that
I can get a change made in the fmsadmin application. Iâm new to CygWin
so Iâm hoping that Iâve missed a setting somewhere or maybe I need to
install another module.
Help me Obi-Wan your my only hope. ;)
Keith