From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) by sourceware.org (Postfix) with ESMTPS id 83451385802A for ; Tue, 16 Feb 2021 16:26:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 83451385802A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([24.64.172.44]) by shaw.ca with ESMTP id C3BclaPyenRGtC3BdlwhiX; Tue, 16 Feb 2021 09:26:53 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=602bf24d a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 a=IkcTkHD0fZMA:10 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10 Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com References: <20210214174358.f828f285a566846254c3c54a@nifty.ne.jp> <20210216193154.fd8d6268ce749983f565b058@nifty.ne.jp> <20210216203134.fd2dcfe17124a907d4be9eee@nifty.ne.jp> From: Brian Inglis Organization: Systematic Software Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal Message-ID: <73b76a73-2243-0e9b-aac3-004fbed0133a@SystematicSw.ab.ca> Date: Tue, 16 Feb 2021 09:26:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210216203134.fd2dcfe17124a907d4be9eee@nifty.ne.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfA2vQXOFBjyUNfkROUSAIT2gzuKh8LeoUTpstT64b9Osue7AdZiD/KSHrtB0bS2s2gTBP5CU4vvUO41Ns3up2d3QHILl4YWbm7r3eur+YZmXC+xB98E0 CFCi2rNQpA4hnZR9v789ffv+HxaJEGjeugOMB2FdOnGaAq7kBik6GwTGrt+9xYTFqjyFlITXHUslz4w93iZovFzQGlEFBrSmQP4= X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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 16:26:56 -0000 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; ? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]