delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/02/14/19:20:12

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF9D4383F84D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1613348410;
bh=dzX0ZxNZynCt1qlsJ4QPpO/WSgzQsZBjfMQ2ljX98DU=;
h=Date:To:In-Reply-To:References:Resent-Date:Resent-From:Resent-To:
Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:
List-Subscribe:From:Reply-To:From;
b=daEdSykyYS7Z8zoRidpaTc96eBauOIDj47URWqgCLpxRcPgYaE1B9SNNZZe98I5Vm
YKzHg035gAUViFC+h9FIHHPOOHUB6lZe25CEO/tVLbRIuin1ROUkM/TTy/lJ56oUiH
W2BlsieBmb4cik3jOG1+K+glsckELlRkE6PRSpgo=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 30FE53857812
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 11F0JdPj004075
X-Nifty-SrcIP: [118.243.85.178]
Date: Mon, 15 Feb 2021 09:05:43 +0900
To: L A Walsh <cygwin AT tlinx DOT org>
Message-Id: <20210215090543.afa8fac6ebec42faa471a5c6@nifty.ne.jp>
In-Reply-To: <60298BB0.1070301@tlinx.org>
References: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw AT mail DOT gmail DOT com>
<20210214174358 DOT f828f285a566846254c3c54a AT nifty DOT ne DOT jp>
<60298BB0 DOT 1070301 AT tlinx DOT org>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
Resent-Date: Mon, 15 Feb 2021 09:19:47 +0900
Resent-From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Resent-To: cygwin AT cygwin DOT com
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
Resent-Message-Id: <20210215091947 DOT 881a6e461c2709ee2b7354d2 AT nifty DOT ne DOT jp>
X-Spam-Status: No, score=-4.5 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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

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 <takashi DOT yano AT nifty DOT ne DOT jp>
--
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

- Raw text -


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