portable console

Set scrolling region:

printf "\033[1;24r"

Reset scrolling region:

printf "\033[r"

However, it is easier/better to do:

stty rows 24 cols 80