Thanks to you and the other comment under mine, I revised my snippet. I use to just copy/paste it into screen or tio, but now that I have this tool[1] I don't need to. You're absolutely right I could get the terminal size with tools like resize locally and I probably should set TERM to match.
[1] the tool if anyone is interested: https://gist.github.com/adedomin/7e615405a2275b01dbae3552116...
It might also help to export the local TERM value remotely because it's not otherwise passed through a serial port.