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.