Cygwin doesn't handle SIGWINCH properly in Windows Terminal

L A Walsh
Tue Feb 16 21:55:49 GMT 2021

On 2021/02/16 02:26, Thomas Wolff wrote:
> I have a similar trap in my .bashrc and it's being triggered when 
> running bash from either cmd (conhost) or Windows Terminal and resizing 
> them. Did I miss something in this issue?
>>>>> What do you mean by "reset LINES/COLUMNS"? I am not sure what
>>>>> is the behaviour diffrence in Linux and cygwin you mentioned.
running "-bash.exe" from Win-R:
>  whence -- -bash
-bash is /bin/-bash
-bash is /usr/bin/-bash
# initial size:
>  showsize;printf "\n"
# shrink by 4 lines; showsize shows 26 lines, but ENV vars are unchanged
>  showsize;printf "\n$LINES/$COLUMNS\n"
>  stty size #shows:
26 80
#checkwinsize is set.
>  shopt -p checkwinsize
shopt -s checkwinsize
# same thing happens if I run 'cmd.exe' then start bash.exe

Normally, showsize displays size dynamically if I take my finger
off the mouse -- only way to see win size as I resize it.  However
in cmd.exe, it doesn't work.

AFAIK, its always been this way in Win7.  There were a bunch of bugs
in Win7 that MS refused to release, or in some cases, only upon request
(hotfix).  While there was a SP2 for the corresponding server edition
of Win7 (Win2008), they didn't want to ship a Win7SP2, because they
wanted to force people to upgrade to get fixes, so they left known bugs
in Win7 for as much as 6-7 years before they started telling users
who had known bugs they weren't going to fix, to upgrade to Win10 if
they wanted it fixed.

OTOH, if you want to fix this, that's great, but there are other
problems in cmd.exe like 'erase' not working in some ms-cmd line
programs (netsh coming to mind), but other ms-programs only work
when attached to 'cons0', like 'sc' doesn't read input
when it asks if you want to see more help when run from mintty,
but it works from cmd.exe.

Many of these were reported to MS before SP1, and weren't fixed.
Should be criminal -- if they won't support it, then source should
be released.

More information about the Cygwin mailing list