delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/02/16/05:38:48

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F286B3971838
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=towo.net
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo AT towo DOT net
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
To: cygwin AT cygwin DOT com
References: <CABPP8W9h=LzUGf=JP-2x3SjrBPh8NJuoRbXzRU94b-WfBt94yw AT mail DOT gmail DOT com>
<20210214174358 DOT f828f285a566846254c3c54a AT nifty DOT ne DOT jp>
<60298BB0 DOT 1070301 AT tlinx DOT org>
<20210215090543 DOT afa8fac6ebec42faa471a5c6 AT nifty DOT ne DOT jp>
<602B2B20 DOT 1030003 AT tlinx DOT org> <1d266c7d-4915-8ff9-069a-04c1f5226eab AT gmail DOT com>
<e51eecff-2831-9934-a702-ff604fcf3409 AT SystematicSw DOT ab DOT ca>
<92a91e86-780f-e0de-8db2-04e89af3f7d7 AT towo DOT net>
From: Thomas Wolff <towo AT towo DOT net>
Message-ID: <87e0eca8-718d-f551-cc6c-464392e5dc5f@towo.net>
Date: Tue, 16 Feb 2021 11:38:47 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.7.1
MIME-Version: 1.0
In-Reply-To: <92a91e86-780f-e0de-8db2-04e89af3f7d7@towo.net>
X-Provags-ID: V03:K1:Gk42gw1pkLBL/I/J1b6qC1t33Z8DBekq7jw+cAkcnn/mEMwzLe3
KpjYgWroorO77PzDWFsNXd6n1gSD6hDwxof+Pmvnt8msJzn3UPBFBVU5Dz2pKFNz8l7KEHW
xa7KNnTc5W/S1uwvCVdItW68Uy8KuNk4LcY/JTCAlzj1UiDz+CiynyJ9bQTFLBdUZ69MDkK
01ZuMgBMQXMIdmrBuBl3Q==
X-UI-Out-Filterresults: notjunk:1;V03:K0:soGdgbcaoN8=:ocRfug1MfK4bxkauecMVhh
/PV/CKnoz6celOwq8+4B0ammbTDEOkFRkmKcQ2LBgn/1KhoEzX/g+wZ5HsVeqHKbNOMZRJyCL
eVjQox03dCuesYAkZN1UHWbVLoYTwYwcyDs4xUgg5mU3jKSs61NLKu0Tg53G+qmC6LTcNd9A3
7lS3ztuYmXBHmsHYLRPOwuu/OpPYNiKDHDnKN9QhiNnz/s/QZsu8PCsVXxPwyoOBPK+xWvMkS
KQQEdxKPWuQhlfqTu4i6w/cKFtlbokjQ8gYLsU8GRTZAPrdBbHsQF3vjEvYGe5q74jSfJ4MNe
1ogwCEHTI24RgkIcY6/aEzYgw+c/q4uSARMF0XArHPzID501+B42hDeeh9cGi+5cY212PcCjx
3ma/voC+RBJxVlVgUkvMhzBiQHQqjKve0q1XDNXsO6Rcre6eV6DsXuEt3iQ5/
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, BODY_8BITS,
KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no 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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 11GAcmqR015842

Am 16.02.2021 um 11:26 schrieb Thomas Wolff:
>
> Am 16.02.2021 um 07:20 schrieb Brian Inglis:
>> On 2021-02-15 22:48, Marco Atzeri via Cygwin wrote:
>>> On 16.02.2021 03:17, L A Walsh wrote:
>>>> On 2021/02/14 16:05, Takashi Yano wrote:
>>>>> On Sun, 14 Feb 2021 12:44:32 -0800
>>>>> L A Walsh wrote:
>>>>>> showsize () {\
>>>>>>   declare s=$(stty size); s="(${s// /x})"  ;\
>>>>>>   printf "%s" "$s${s//?/$'\b'}"       ;\
>>>>>> }; export -f showsize
>>>>>>
>>>>>> trap showsize SIGWINCH
> 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?
Yes I did. Sorry for the fuss.
>
>>
>>>>> What do you mean by "reset LINES/COLUMNS"? I am not sure what
>>>>> is the behaviour diffrence in Linux and cygwin you mentioned.
>>
>>>>      Actually not sure I can reproduce this now.  The only
>>>> thing I am noticing is that if bash is attached to /dev/pts3
>>>> (as in mintty), it works, but if attached to /dev/cons0 (as in
>>>> cmd.exe), nothing works as no signal is propagated from
>>>> the window resize to running program.
>>>>
>>>>      AFAIK, though, that's always been one of multiple probs in 
>>>> using windows cmd with a bash shell.
>>
>>> maybe this is waht you are looking for:
>>>
>>> # This causes bash to check the terminal size after every command
>>> # and adjusts $LINES and $COLUMNS to the correct values.
>>> shopt -s checkwinsize
>>
>> Newer bash man pages say this is the default; set in my .bashrc so I 
>> can't tell; bash man pages also say COLUNS and LINES are set on 
>> SIGWINCH if interactive:
>>
>> $ man bash | egrep -A1 'COLUMNS|LINES|checkwinsize'
>> COLUMNS
>>     Used by the select compound command to determine the terminal 
>> width when
>>     printing selection lists. Automatically set if the checkwinsize 
>> option
>>     is enabled or in an interactive shell upon receipt of a SIGWINCH.
>> -- 
>> LINES    Used by the select compound command to determine the column 
>> length for
>>     printing selection lists. Automatically set if the checkwinsize 
>> option
>>     is enabled or in an interactive shell upon receipt of a SIGWINCH.
>> -- 
>> checkwinsize
>>     If set, bash checks the window size after each command and, if
>>     necessary, updates the values of LINES and COLUMNS.
>>
>
> -- 
> 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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019