X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A1A383857C73
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=tlinx.org
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cygwin@tlinx.org
Message-ID: <602C3F65.9050505@tlinx.org>
Date: Tue, 16 Feb 2021 13:55:49 -0800
From: L A Walsh <cygwin@tlinx.org>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
References: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw@mail.gmail.com>
 <20210214174358.f828f285a566846254c3c54a@nifty.ne.jp>
 <60298BB0.1070301@tlinx.org>
 <20210215090543.afa8fac6ebec42faa471a5c6@nifty.ne.jp>
 <602B2B20.1030003@tlinx.org> <1d266c7d-4915-8ff9-069a-04c1f5226eab@gmail.com>
 <e51eecff-2831-9934-a702-ff604fcf3409@SystematicSw.ab.ca>
 <92a91e86-780f-e0de-8db2-04e89af3f7d7@towo.net>
In-Reply-To: <92a91e86-780f-e0de-8db2-04e89af3f7d7@towo.net>
X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

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:
>  echo $LINES/$COLUMNS
30/80
>  showsize;printf "\n"
(30x80)
# shrink by 4 lines; showsize shows 26 lines, but ENV vars are unchanged
>  showsize;printf "\n$LINES/$COLUMNS\n"
(26x80)
30/80
>  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.
-l

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