Force GNU screen to reflow to current terminal width on reattach?

after you reattach a ctrl-a F runs the "fit" command to resize the current window. if you reattach using the -A option it should resize all windows when you reattach. Are there others still attached to the screen session when you are attaching? For instance, are you having to use -x to reattach instead of -r? you can detach others when you reattach with "screen -D -r" instead of "screen -x", and I'd expect this to automatically refit windows.


Note that this answer only applies to PuTTY. I too am forced to use an operating system that I would rather not, and PuTTY is the only real option due to other restrictions on the system. I was having the same issue, my screen would resize upon initiating or connecting to an existing screen session. I tried the answers here to no avail (Windows 10 with PuTTY 0.67 installed via MSI). These answeres might have worked with a standard UN*X terminal, but not with PuTTY, it's a different beastie.

I went digging in the options, and lo and behold under "Terminal -> Features" there is an option labeled "Disable remote-controlled terminal resizing". Check the box, apply the setting, and try screen again. I think you'll find the problem resolved.


Try adding this (from /etc/screenrc) to your ~/.screenrc:

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

https://superuser.com/a/217281/6593