Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <5.1.0.14.0.20010727092409.00aeefc0@mail.accesswave.ca> X-Sender: mgingell AT mail DOT accesswave DOT ca X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 27 Jul 2001 10:24:05 -0300 To: "cygwin-cygwin.com" From: Mike Gingell Subject: Cannot change console mode when set CYGWIN=tty Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Hi all! In order to fix a minor problem caused by ^C being intercepted by bash, I set CYGWIN=tty before launching bash. This solves the problem of cmd asking the user to terminate the batch job. This is great, however, it breaks some of my other existing code, specifically the ability to change the Console mode. i.e. with CYGWIN=tty: Error getting console mode (Error 6): The handle is invalid. exception....GetConsoleMode [436]:[darkfriend:/d/rfr/mtQACE]: without CYGWIN=tty, all works fine..... This is the code that I use: // Turn off the line input mode, and echo the input mode. if (! GetConsoleMode(hStdin, &fdwOldMode)) { printErr("Error getting console mode", GetLastError()); throw runtime_error("GetConsoleMode"); } fdwMode = fdwOldMode & ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT ); if (! SetConsoleMode(hStdin, fdwMode)) { printErr("Error setting console mode", GetLastError()); throw runtime_error("SetConsoleMode"); } Is there a work around for this? If not, I will have to run without CYGWIN=tty until I get a chance to dig into the source and find out what CYGWIN=tty really does. Cheers! --------------------------- [436]:[darkfriend:~]: bash --version GNU bash, version 2.05.0(6)-release (i686-pc-cygwin) Copyright 2000 Free Software Foundation, Inc. [437]:[darkfriend:~]: Cygwin DLL version info: dll major: 1003 dll minor: 2 dll epoch: 19 dll bad signal mask: 19005 dll old termios: 5 dll malloc env: 28 api major: 0 api minor: 39 shared data: 3 dll identifier: cygwin1 mount registry: 2 cygnus registry name: Cygnus Solutions cygwin registry name: Cygwin program options name: Program Options cygwin mount registry name: mounts v2 cygdrive flags: cygdrive flags cygdrive prefix: cygdrive prefix cygdrive default prefix: build date: Sun May 20 23:28:17 EDT 2001 shared id: cygwin1S3 - Mike Mike Gingell, P.Eng. Senior Systems Engineer, Maritime Systems Computing Devices Canada -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/