X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17A393851C0C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1605410055;
	bh=Usg1IuZGX/8XyNZD6T/J6Gr1i+znaaieSU+5OStHlKw=;
	h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
	 List-Help:List-Subscribe:From:Reply-To:From;
	b=Bs4xIAjm68SRUIq6IeC9u8yXBIP7VQEeuXcW8s6ulVS5d5LE4mtFZBTT/yxWI5sdl
	 1cIU/+9LK+Bse//aoSFbjWFSKt1ZyTsOrtHvGLS7OBia+XRIS+4sPKZY/YWFm7Ppfz
	 cYw/YBHoDqcea+Qcn6jLTJ3pAAWTz6ovTIRgKOmw=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B2E93851C0C
To: cygwin@cygwin.com
Subject: bug report: tty/termios flags weirdness
Message-ID: <d5493d27-ba72-7394-6d3a-5d164de41da4@glup.org>
Date: Sat, 14 Nov 2020 22:14:10 -0500
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
 Gecko/20100101 Thunderbird/78.4.3
MIME-Version: 1.0
Content-Language: en-US
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS,
 SPF_PASS autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: john hood via Cygwin <cygwin@cygwin.com>
Reply-To: john hood <cgull@glup.org>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 0AF3Ehl1020617

After thrashing with my own bugs for a while, I think I've found a minor
bug in Cygwin's tty/termios handling-- seen in 3.1.7 on Windows 10
20H2.  Among other things, this causes tmux to fail on non-pty sessions.

STC:

Start Cygwin in conhost or Windows Terminal.

Execute 'stty -isig'

You will probably get an error message 

stty: 'standard input': unable to perform all requested operations

Repeat this test in mintty (or other pty-using sessions, probably)

You will probably not get this error message.

The stty error arises because stty does tcgetattr() after doing
tcsetattr(), and expects the termios struct it reads to be the same as
the one it wrote.  I haven't looked at tmux.

This isn't a big issue for me-- I was doing 'stty raw' which unsets this
flag, but I only needed raw output, so 'stty -opost' was the workaround.

regards,

  --jh



--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

