public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: L A Walsh <cygwin@tlinx.org>
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
Date: Mon, 15 Feb 2021 09:05:43 +0900	[thread overview]
Message-ID: <20210215090543.afa8fac6ebec42faa471a5c6@nifty.ne.jp> (raw)
In-Reply-To: <60298BB0.1070301@tlinx.org>

On Sun, 14 Feb 2021 12:44:32 -0800
L A Walsh wrote:
> On 2021/02/14 00:43, Takashi Yano via Cygwin wrote:
> > 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.
> >
> > ....
> >
> > This seems to be a bug of console code. I will submit a patch
> > for this issue.
> >   
> ---
> I'd be careful 'fixing' this, as it seems to work the same
> way on linux / bash.
> 
> I have this func setup on bash_profile & bashrc on
> both cygwin and linux:
> 
> # display new size of terminal when resized
> :                                                         
> showsize () {\
>   declare s=$(stty size); s="(${s// /x})"  ;\
>   printf "%s" "$s${s//?/$'\b'}"       ;\
> }; export -f showsize
> 
> trap showsize SIGWINCH
> -----

This has been working as expected without 'fix' because bash
calls select() rather than read() when it waits for user input.
The problem is in console read() and select() has been working.

Moreover, the problem is only in console read() while pty does
not have.

> Of note, on linux, I didn't have to reset LINES/COLUMNS,
> however, on cygwin, I note that I should.
> 
> Oh well -- hmmm....is that a bug?

What do you mean by "reset LINES/COLUMNS"? I am not sure what
is the behaviour diffrence in Linux and cygwin you mentioned.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  reply	other threads:[~2021-02-15  0:20 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
2021-02-14  8:43 ` Takashi Yano
2021-02-14 20:44   ` L A Walsh
2021-02-15  0:05     ` Takashi Yano [this message]
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=20210215090543.afa8fac6ebec42faa471a5c6@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@tlinx.org \
    /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).