From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id E4AC23851C27 for ; Tue, 16 Feb 2021 05:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E4AC23851C27 Received: by mail-wm1-x32a.google.com with SMTP id x4so13056666wmi.3 for ; Mon, 15 Feb 2021 21:48:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HcWx5Bj09jipdejF4L1i/7AJLMGVJEnUYShtY9OMGwk=; b=PKb5I+njTyiBSjKO4ayUMCVWSe949OrzvUKCxeiqrJyx0ATwyN5ALwU76lvGASyjNO qNunEe7oKLkVqram7Tyvlva1g06ZSpd0+QQD6AmXtA5jwt4z6Ay3rpHyiep1skQvwAa+ /08RvS7lsl5Nn4xsCFhWwRxB6n1FuRyiGobSo2NAKfVGkX/E2C/tsHvV8XCyaqg8vtDb kkIdHkadOuSpsnLvfJ+hq24UbqkpB6+AivQG/o8DaAg7dVQCGLfg7ApOiZgae/qhqWxQ R2zhoLceY8KrYDzEgRICW7+yhEcF1s7LPx4M191bfFUllaczyQuwXxw7XzIVUDaMomLi bIVQ== X-Gm-Message-State: AOAM531QriLif/+wHv13fbIymtfENel9SYNhMw804QqKEgslPVTK8TWC dckYhIyNxSQQtL4X8/EFbOlLrDdSZz4VEg== X-Google-Smtp-Source: ABdhPJyKeXcwzsqgMen6+tOiACYiWs82tWXDyjaAsLYYDg9ApmzlaamFTwRx58oYcm2WBQAZeWn5HA== X-Received: by 2002:a7b:c206:: with SMTP id x6mr1782983wmi.48.1613454532057; Mon, 15 Feb 2021 21:48:52 -0800 (PST) Received: from ?IPv6:2003:cc:9f2b:2fca:fdef:e014:1687:6178? (p200300cc9f2b2fcafdefe01416876178.dip0.t-ipconnect.de. [2003:cc:9f2b:2fca:fdef:e014:1687:6178]) by smtp.gmail.com with ESMTPSA id t198sm1883071wmt.7.2021.02.15.21.48.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 21:48:51 -0800 (PST) Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal To: cygwin@cygwin.com References: <20210214174358.f828f285a566846254c3c54a@nifty.ne.jp> <60298BB0.1070301@tlinx.org> <20210215090543.afa8fac6ebec42faa471a5c6@nifty.ne.jp> <602B2B20.1030003@tlinx.org> From: Marco Atzeri Message-ID: <1d266c7d-4915-8ff9-069a-04c1f5226eab@gmail.com> Date: Tue, 16 Feb 2021 06:48:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <602B2B20.1030003@tlinx.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2021 05:48:57 -0000 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 >>> ----- >> > >> >> 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