For sh/.profile, run "resizewin -z" at login which will set the terminal type only when empty, which is kind to remote and local logins and has the intended behavior.
Also for tcsh, if the user logs in from the serial console, use postcmd to resize the window after each command in case the user resizes the window.
Related issues
Bug #9569: Fix serial console terminal size issues
Terminal size detection. Fixes #9569
For sh/.profile, run "resizewin -z" at login which will set the terminal
type only when empty, which is kind to remote and local logins and has
the intended behavior.
Also for tcsh, if the user logs in from the serial console, use postcmd
to resize the window after each command in case the user resizes the
window.