Fix a crash when resizing the terminal window
Verified correct line length with multi-byte chars

It just worked.