From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by sourceware.org (Postfix) with ESMTPS id 6D60F3857812 for ; Mon, 15 Feb 2021 00:22:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D60F3857812 Received: from Express5800-S70 (y085178.dynamic.ppp.asahi-net.or.jp [118.243.85.178]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 11F0Lg6B005475 for ; Mon, 15 Feb 2021 09:21:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 11F0Lg6B005475 X-Nifty-SrcIP: [118.243.85.178] Date: Mon, 15 Feb 2021 09:21:51 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal Message-Id: <20210215092151.fca0260dfd3dea0a353575b7@nifty.ne.jp> In-Reply-To: <60298BB0.1070301@tlinx.org> References: <20210214174358.f828f285a566846254c3c54a@nifty.ne.jp> <60298BB0.1070301@tlinx.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2021 00:22:06 -0000 On Sun, 14 Feb 2021 12:44:32 -0800 L A Walsh wrote: > On 2021/02/14 00:43, Takashi Yano via Cygwin wrote: > > This is because cygwin console handles SIGWINCH when the input > > messages is processed. If the process does not call either read() > > or select(), SIGWINCH will not be sent. This is the long standing > > problem of the implementation and hard to fix. > > > > .... > > > > This seems to be a bug of console code. I will submit a patch > > for this issue. > > > --- > I'd be careful 'fixing' this, as it seems to work the same > way on linux / bash. > > I have this func setup on bash_profile & bashrc on > both cygwin and linux: > > # display new size of terminal when resized > : > showsize () {\ > declare s=$(stty size); s="(${s// /x})" ;\ > printf "%s" "$s${s//?/$'\b'}" ;\ > }; export -f showsize > > trap showsize SIGWINCH > ----- This has been working as expected without 'fix' because bash calls select() rather than read() when it waits for user input. The problem is in console read() and select() has been working. Moreover, the problem is only in console read() while pty does not have. > Of note, on linux, I didn't have to reset LINES/COLUMNS, > however, on cygwin, I note that I should. > > Oh well -- hmmm....is that a bug? What do you mean by "reset LINES/COLUMNS"? I am not sure what is the behaviour diffrence in Linux and cygwin you mentioned. -- Takashi Yano