[Top][All Lists]

[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 <address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]