Cygwin doesn't handle SIGWINCH properly in Windows Terminal

L A Walsh cygwin@tlinx.org
Sun Feb 14 20:44:32 GMT 2021


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





More information about the Cygwin mailing list