The reason I had originally used a static array for the terminal was so that one could resize the terminal without clearing it. I think. It's been a while.
Would it be good to allocate the new buffer, copy the old contents (pad it properly if enlarging), and then free the old one?
It might also be nice to be able to shrink the terminal then grow it again and get back what was off-screen. Of course, this would only be valid if no changes had occurred on the screen; if there were, we'd want to clear it anyhow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think the copy idea a better approach then the static array. That was the line in the code I was most curious about ;-)
I don't think it's useful the save the off-screen part if shrinking the terminal. It should be the responsibility of the application to handle that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason I had originally used a static array for the terminal was so that one could resize the terminal without clearing it. I think. It's been a while.
Would it be good to allocate the new buffer, copy the old contents (pad it properly if enlarging), and then free the old one?
It might also be nice to be able to shrink the terminal then grow it again and get back what was off-screen. Of course, this would only be valid if no changes had occurred on the screen; if there were, we'd want to clear it anyhow.
I think the copy idea a better approach then the static array. That was the line in the code I was most curious about ;-)
I don't think it's useful the save the off-screen part if shrinking the terminal. It should be the responsibility of the application to handle that.