[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: winch trap delayed until keypress
From: |
Pierre Gaston |
Subject: |
Re: winch trap delayed until keypress |
Date: |
Thu, 22 May 2014 16:12:24 +0300 |
On Thu, May 22, 2014 at 4:02 PM, Linda Walsh <bash@tlinx.org> wrote:
>
>
> Pierre Gaston wrote:
>
>>
>> As I understand it, this is now broken in 4.3?:
>> ----
>> # display new size of terminal when resized
>> function showsize () {\
>> local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\
>> echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \
>> }
>>
>> trap showsize SIGWINCH
>> ----
>>
>> As I understand it, it only affects the interactive behaviour of bash,
>> and doesn't change anything for your use case, the trap will be executed
>> when the foreground command exits.
>>
>
> ---
> If I wanted to "see" the size interactively, I wouldn't resize it unless
> I'm at the command prompt. I.e. it will be waiting for input.
> Each time I move the corner of a tty window it displays the size
> at the point of the cursor (where the command prompt is).
>
> This allows me to dynamically see what I'm doing when I resize a window
> if I am going for a specific size (which happens usually after I've
> expanded it for some reason, and am now trying to size it back down
I don't really understand what you are saying, but if you use this trap in
a script it will work as before, if you use it in your interactive shell
and your shell is at the prompt, it will on only be called if you press a
key.
- winch trap delayed until keypress, Egmont Koblinger, 2014/05/20
- Re: winch trap delayed until keypress, Chet Ramey, 2014/05/20
- Re: winch trap delayed until keypress, Linda Walsh, 2014/05/22
- Re: winch trap delayed until keypress, Pierre Gaston, 2014/05/22
- Re: winch trap delayed until keypress, Linda Walsh, 2014/05/22
- Re: winch trap delayed until keypress,
Pierre Gaston <=
- Re: winch trap delayed until keypress, Greg Wooledge, 2014/05/22
- Re: terminal emulators and size displays used when running bash (OB-tie-in) ; -) (was: Re: winch trap delayed until keypress), Linda Walsh, 2014/05/22
- Re: terminal emulators and size displays used when running bash (OB-tie-in) ; -), Chet Ramey, 2014/05/23
- Re: terminal emulators and size displays used when running bash (OB-tie-in) ; -), Linda Walsh, 2014/05/23
- Re: winch trap delayed until keypress, Chet Ramey, 2014/05/22
- Re: winch trap delayed until keypress, Linda Walsh, 2014/05/22
- Re: winch trap delayed until keypress, Egmont Koblinger, 2014/05/22
- Re: winch trap delayed until keypress, Linda Walsh, 2014/05/22
- Re: winch trap delayed until keypress, Andreas Schwab, 2014/05/23
- Re: winch trap delayed until keypress, Linda Walsh, 2014/05/23