delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/02/13/12:39:00

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 971D83858004
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=Yq/K+6UX c=1 sm=1 tr=0 ts=60280eae
a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17
a=IkcTkHD0fZMA:10 a=GcyzOjIWAAAA:8 a=p5XVOwWNAAAA:20 a=94nOnFI1EgyDtX4ev68A:9
a=QEXdDO2ut3YA:10 a=u6TuYKdOgz4A:10 a=hQL3dl6oAZ8NdCsdz28n:22
To: cygwin AT cygwin DOT com
References: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw AT mail DOT gmail DOT com>
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: <b0d9d898-f46d-8055-30a2-aa28452dac6a@SystematicSw.ab.ca>
Date: Sat, 13 Feb 2021 10:38:53 -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: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw@mail.gmail.com>
X-CMAE-Envelope: MS4xfLrSlYH8iG/8lPq73DMK5mCbAAqANGIR9PN6EsLx7Vjn1wGwHjX/YdIpB6CiSP3Qn8tq+dGNyUUjmjnqcSomvTjdKzFoP6YdWS8xVSwSgOoX5Z8cy5xj
chfknFbEFpGSQ35X2WPHTJ9PyxW0b6+rYQxxmqicV+eh+mtTCJNfXWxjn2TSMpF8J8RIqMgWZX01GxyyocMd1xuA311nUXX91CQ=
X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW,
RCVD_IN_MSPIKE_H3, 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>

On 2021-02-13 03:39, Alvin Seville via Cygwin 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
> 
> As you see Windows Terminal doesn't handle SIGWINCH
> <https://man7.org/linux/man-pages/man7/signal.7.html> properly. However
> everything works fine when I execute my script directly from Cygwin
> Terminal without Windows Terminal which users told
> <https://github.com/microsoft/terminal/issues/9113#issuecomment-777703560>
> me that it seems to be a Cygwin bug.

Don't really see that given that the signal and size info should come from the 
terminal.

Running bash trap -l shows Cygwin has SIGWINCH as 28.
Does this script work when run using > ...\bash script under the cmd shell?
What does Windows terminal do to report window size change, is that available to 
the Cygwin console code, and how does it handle that?
It is possible that the interface and/or signal number is different.

Perhaps repost with a readably reformatted or attached script, and start a 
terminal log on a run with bash -vx to see whether and what signal is received 
and whether the changed size is reported, and attach that.

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

- Raw text -


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