I'm currently trying to do pretty cli apps, my goal is to make a box that makes the whole outline of the terminal.
What I currently do:
- Grab the size of the terminal
- Draw the top line : top-left corner + (width - 2) * top edge + top-right corner
- Draw left and right borders : "\r\n|" + (width - 2) * " " + "|"
- Draw the bottom line : bottom-left corner + (width - 2) * top edge + bottom-left corner
And I put all this in a loop and refresh it 30 times per second. The problem is that when the terminal is resized, some edges are offset and displayed in the middle of the screen for a small amount of time.
How can you avoid these small glitches ? Is it possible to tell the terminal to not display anything while the user is resizing or something like that ?
Thanks in advance