public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
Date: Sat, 13 Feb 2021 10:38:53 -0700	[thread overview]
Message-ID: <b0d9d898-f46d-8055-30a2-aa28452dac6a@SystematicSw.ab.ca> (raw)
In-Reply-To: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw@mail.gmail.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.]

  reply	other threads:[~2021-02-13 17:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-13 10:39 Alvin Seville
2021-02-13 17:38 ` Brian Inglis [this message]
2021-02-14  8:43 ` Takashi Yano
2021-02-14 20:44   ` L A Walsh
2021-02-15  0:05     ` Takashi Yano
2021-02-16  2:17       ` L A Walsh
2021-02-16  5:48         ` Marco Atzeri
2021-02-16  6:20           ` Brian Inglis
2021-02-16 10:26             ` Thomas Wolff
2021-02-16 10:38               ` Thomas Wolff
2021-02-16 21:55               ` L A Walsh
2021-02-15  0:21     ` Takashi Yano
2021-02-16 10:31   ` Takashi Yano
2021-02-16 11:31     ` Takashi Yano
2021-02-16 16:26       ` Brian Inglis
2021-02-16 20:37         ` Takashi Yano
2021-02-16 20:50           ` Thomas Wolff
2021-02-16 22:11             ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0d9d898-f46d-8055-30a2-aa28452dac6a@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).