delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/12/18:24:29

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: stdin broken for windows console app under rxvt
Date: Mon, 13 Mar 2006 10:21:03 +1100
Message-ID: <A521CED2010C244BBDC949DEDF00DCE23645F0@sydexchange2.vignette.com>
From: "Robinson, Mark" <Mark DOT Robinson AT vignette DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k2CNORlj026368

Greetings

A simple console app compiled with MingW (-mno-cygwin) (or VC++) cannot
read from stdin when executed in an rxvt or xterm terminal:

#include <stdio.h>
main() {
  int c;
  fputc(isatty(stdin), stdout);
  while ((c = getc(stdin)) != EOF) fputc(c, stdout);
}

Furthermore, isatty(stdin) returns 0.

Both examples behave under cmd, or cmd/bash with CYGWIN=notty set, or if
they're compiled without the mingw flag.

Any clues gratefully accepted.

cheers
mark

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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