Open thomasballinger opened 10 years ago
Can you show a demo of how this works? Do you plan to support the complementary transformation, i.e. when the terminal gets larger.
Have a look at how tmux reflows text when the size changes. Actually, it doesn't change anything to the screen data structure (in order to revert), but the renderer can split a line of the screen over several lines, if at some point the window gets smaller.
I think the scrolling logic at that point gets complicated, especially with support for double-width characters.
If reflow (autowrap) is too complicated, you can also just hide what doesn't fit in the amount of columns, and show it again when the window is enlarged.
Since I'm trying to imitate xterm, I was planning to support the opposite, but not do any linewrap. I'm also looking into how to test linewrap because I'm working on a tool that needs to be tested with various terminal resizing behaviors, but for now was planning to use pyte only for testing xterm-like behavior. I have a feeling I'm going to end up scraping the output of real terminal emulators via an accessibility protocol or similar eventually.
If the window got taller, lines would be take out of history and placed at the top of the screen.
Text reflow would be very cool to have.
I'm subclassing HistoryScreen to have history added when the terminal gets smaller - is this something that might belong in pyte?