React to a change of the terminal window size

suggest change

WINCH (window change) is sent when the terminal window is resized.

declare -x rows cols
 
update_size(){
  rows=$(tput lines) # get actual lines of term
  cols=$(tput cols)  # get actual columns of term
  echo "DEBUG terminal window has $rows lines and is $cols characters wide"
}

trap update_size WINCH

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents