Problem: Changing terminal height immediately after outputting lines may lead to wrong scrollback. Solution: Insert pending scrollback lines before the old window height.