From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: Cygwin doesn't handle SIGWINCH properly in Windows Terminal
Date: Tue, 16 Feb 2021 11:38:47 +0100 [thread overview]
Message-ID: <87e0eca8-718d-f551-cc6c-464392e5dc5f@towo.net> (raw)
In-Reply-To: <92a91e86-780f-e0de-8db2-04e89af3f7d7@towo.net>
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
next prev parent reply other threads:[~2021-02-16 10:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-13 10:39 Alvin Seville
2021-02-13 17:38 ` Brian Inglis
2021-02-14 8:43 ` Takashi Yano
2021-02-14 20:44 ` L A Walsh
2021-02-15 0:05 ` Takashi Yano
2021-02-16 2:17 ` L A Walsh
2021-02-16 5:48 ` Marco Atzeri
2021-02-16 6:20 ` Brian Inglis
2021-02-16 10:26 ` Thomas Wolff
2021-02-16 10:38 ` Thomas Wolff [this message]
2021-02-16 21:55 ` L A Walsh
2021-02-15 0:21 ` Takashi Yano
2021-02-16 10:31 ` Takashi Yano
2021-02-16 11:31 ` Takashi Yano
2021-02-16 16:26 ` Brian Inglis
2021-02-16 20:37 ` Takashi Yano
2021-02-16 20:50 ` Thomas Wolff
2021-02-16 22:11 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87e0eca8-718d-f551-cc6c-464392e5dc5f@towo.net \
--to=towo@towo.net \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).