delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/27/09:25:14

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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" <cygwin AT cygwin DOT com>
From: Mike Gingell <mgingell AT accesswave DOT ca>
Subject: Cannot change console mode when set CYGWIN=tty
Mime-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019