Description
We should improve how the statusline handles terminal resizing. Conceptually the following needs to happen when the terminal dimensions change:
- We needs to clear the old version of the statusline
- We need to update the scroll window for the new terminal height
- We need to draw the statusline in the new position
Clearing the old statusline is tricky because the statusline will have moved. Although it will still be at the bottom of the screen, it may have wrapped and pushed itself up multiple rows. To complicate things furthers, signals (including SIWGINCH
) are subject to coalescing, so there's no guarantee that we see all the dimensions of the terminal.
To sidestep the issue, #146578 takes a rather blunt approach and clears the screen when resizing the terminal. That's obviously undesirable, since you might be changing the terminal dimensions to see more of your history. We should find a way to make this work reliably without clearing the screen.