On Thu, May 22, 2014 at 4:02 PM, Linda Walsh <b...@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.