Cannot change console mode during usage of expect

Keith Proctor keith_proctor@filemaker.com
Wed Apr 15 01:20:00 GMT 2015


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


More information about the Cygwin mailing list