delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.3.2 sourceware.org 1F2AD3860C37 |
Authentication-Results: | sourceware.org; dmarc=none (p=none dis=none) |
header.from=SystematicSw.ab.ca | |
Authentication-Results: | sourceware.org; |
spf=none smtp.mailfrom=brian DOT inglis AT systematicsw DOT ab DOT ca | |
X-Authority-Analysis: | v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=602c432e |
a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 | |
a=IkcTkHD0fZMA:10 a=TImcKGuyeGIbufSLrCcA:9 a=QEXdDO2ut3YA:10 | |
To: | cygwin AT cygwin DOT com |
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> | |
<20210217053758 DOT 787d1316e900fe914a4e29a8 AT nifty DOT ne DOT jp> | |
<d2ef5af4-e976-dd25-39b3-b8acdc118922 AT towo DOT net> | |
From: | Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca> |
Organization: | Systematic Software |
Subject: | Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal |
Message-ID: | <cb471098-8052-32aa-6943-1cb115b67059@SystematicSw.ab.ca> |
Date: | Tue, 16 Feb 2021 15:11:56 -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: | <d2ef5af4-e976-dd25-39b3-b8acdc118922@towo.net> |
X-CMAE-Envelope: | MS4xfM8FfW8sumkjYWQGc2A4gRQ90EGlftay4nOaN1/tREqJtIEdJOjmhDFxajXIKv9yAdPVyaKuA8Z6s70v+luEDFYjEPD2Mr3AkbLoSNpyZDNsL9MYU3VE |
qao2h+8ftsW65iaQyp4MBG6WLTLZy1uIjhAXA/wF29/IrtXR7bGvxbX1lN67HFyp1qH/dKKPGqKJsOTTk31YBhniMBaNWEGs3zo= | |
X-Spam-Status: | No, score=-3.9 required=5.0 tests=BAYES_00, BODY_8BITS, |
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 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> | |
Reply-To: | cygwin AT cygwin DOT com |
Errors-To: | cygwin-bounces AT cygwin DOT com |
Sender: | "Cygwin" <cygwin-bounces AT cygwin DOT com> |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id 11GMC3db018663 |
On 2021-02-16 13:50, Thomas Wolff wrote: > Am 16.02.2021 um 21:37 schrieb Takashi Yano via Cygwin: >> 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. > Output flushing doesn't work in the pty either, and neither in Linux. The > setting seems to be a relic from Unix systems. It was an interactive shortcut to send excessive output to the bit bucket *after* a command was run, which saved dialup I/O charges, and time, when dialup was slow and expensive, and terminals were slow TTYs. It's still useful if you finger fumble and get too many unexpected hits on a recursive find or grep. Predates Unix by a decade - was standard on all DEC(/Digital) OSes and their offshoots like Tenex and Unix, the function was available in Multics tty DIM (whatever that stood for) - can't find any details by searching (many scanned docs predate useful OCR and are hundreds of pages) - may have come from MIT CTSS (which had many of the features and functions of Unix), the development system for Project MAC (the development project with many spinoffs, one of those Multics, another the CTSS and Multics AI Lab competitor ITS), or the predecessors on which they were based. -- 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.] -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |