delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/02/16/15:38:25

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D7DA3836C1C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1613507901;
bh=ECih6vEDkuPhJfK28wEWT/Z0zJgocOe/nUW9B7qSEo4=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=bqODUr78xJ9jWDuOrq8C/yjV9BCXC5lhIODsk6m8v9VhtgW3yVjeRPK6jdHy0vC28
r6/zQEt5Egk6andPMxx4ZWZSdwLYm+JXqwWc9IXBOgygWgJNuT2kXICbsP0S/60xUn
WfXn3g3yEUAwNy7DI4CvOI7kEeEhoHeGc1kp4ew8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0114F385783A
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 11GKbpNw027750
X-Nifty-SrcIP: [118.243.85.178]
Date: Wed, 17 Feb 2021 05:37:58 +0900
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
Message-Id: <20210217053758.787d1316e900fe914a4e29a8@nifty.ne.jp>
In-Reply-To: <73b76a73-2243-0e9b-aac3-004fbed0133a@SystematicSw.ab.ca>
References: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw AT mail DOT gmail DOT com>
<20210214174358 DOT f828f285a566846254c3c54a AT nifty DOT ne DOT jp>
<20210216193154 DOT fd8d6268ce749983f565b058 AT nifty DOT ne DOT jp>
<20210216203134 DOT fd2dcfe17124a907d4be9eee AT nifty DOT ne DOT jp>
<73b76a73-2243-0e9b-aac3-004fbed0133a AT SystematicSw DOT ab DOT ca>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
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 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 Tue, 16 Feb 2021 09:26:52 -0700
Brian Inglis wrote:
> On 2021-02-16 04:31, Takashi Yano via Cygwin wrote:
> > 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.
> 
> Do these changes (still?) honour stty flags like isig, ixany, noflsh and handle 
> interrupt character settings for e.g.:
> 	intr = ^C; quit = ^\; swtch = ^Z; start = ^Q; stop = ^S; susp = ^Z;
> 	discard = ^O;
> ?

Basically yes. However, stty noflsh, flusho and Ctrl-O
does not take effect in the current code with/without
the patch.

-- 
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