From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by sourceware.org (Postfix) with ESMTPS id 1FE1D3861024 for ; Tue, 16 Feb 2021 11:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1FE1D3861024 Received: from Express5800-S70 (y085178.dynamic.ppp.asahi-net.or.jp [118.243.85.178]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 11GBVWMj009785 for ; Tue, 16 Feb 2021 20:31:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 11GBVWMj009785 X-Nifty-SrcIP: [118.243.85.178] Date: Tue, 16 Feb 2021 20:31:34 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal Message-Id: <20210216203134.fd2dcfe17124a907d4be9eee@nifty.ne.jp> In-Reply-To: <20210216193154.fd8d6268ce749983f565b058@nifty.ne.jp> References: <20210214174358.f828f285a566846254c3c54a@nifty.ne.jp> <20210216193154.fd8d6268ce749983f565b058@nifty.ne.jp> 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.2 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: Tue, 16 Feb 2021 11:32:00 -0000 On Tue, 16 Feb 2021 19:31:54 +0900 Takashi Yano wrote: > On Sun, 14 Feb 2021 17:43:58 +0900 > Takashi Yano wrote: > > On Sat, 13 Feb 2021 20:39:39 +1000 > > Alvin Seville wrote: > > > Windows build number: Win32NT 10.0.19042.0 Microsoft Windows NT 10.0.19042.0 > > > Windows Terminal version (if applicable): 1.5.10271.0 > > > > > > Script to reproduce this issue: > > > > > > #!/usr/bin/env bashfunction outputText() > > > { > > > local text=$1 > > > local -i textLength=${#text} > > > > > > local -i line="$(tput lines) / 2" > > > local -i col="$(tput cols) / 2 - $textLength / 2" > > > > > > clear > > > echo -en "\e[$line;${col}H$text" > > > } > > > trap "outputText 'Hello world!'" SIGWINCH > > > > > > outputText 'Hello world!'while truedo > > > :done > > > > 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. > > I came up with a solution for this issue and implemented that. > It seems working as expected as far as I tested while I did not > have to change the code much contrary to my concern. > > The point of the idea is to keep the basic structure of the > console code unchanged and introduce a new thread which handle > the only signals derived from input records. Handling of Ctrl-S > and Ctrl-Q also added. > > I would like to submit the patch to cygwin-patches mailing list. > > Corinna, could you please have a look? v2: Problems when input echo is stopped by Ctrl-S is fixed. -- Takashi Yano