Normally, resizing CMD works normally for me, where the directory prompt (is that what it's called?) stays on the left side of the screen no matter the size of the terminal. However, if I open vim (or man via my msys2), and close it again, resizing the window acts as every line includes spaces at the end, up to the length of the buffer. Resizing in this state wraps everything as if it was a single piece of text, so I end up with a very messy terminal. This still happens if I run bash within CMD, or even an emulator like Cmder/ConEmu. Here's some pictures of what I'm talking about.
Then, I return the terminal to the original size, open and close vim, then resize back down to the smaller size. Everything is now messed up. I can redraw the screen to fix it temporarily, but all future resizes will wrap text incorrectly. This requires closing the terminal and opening it again to fix.
What is the root cause of this? I don't think it has to do with line endings, because changing the fileformat setting to
ff=dos doesn't help. It's as if each line is treated as having spaces at the end of it, instead of a newline character.