pyte icon indicating copy to clipboard operation
pyte copied to clipboard

History preservation on resize

Open thomasballinger opened this issue 11 years ago • 5 comments

I'm subclassing HistoryScreen to have history added when the terminal gets smaller - is this something that might belong in pyte?

thomasballinger avatar Sep 20 '14 23:09 thomasballinger

Can you show a demo of how this works? Do you plan to support the complementary transformation, i.e. when the terminal gets larger.

superbobry avatar Sep 21 '14 15:09 superbobry

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.

jonathanslenders avatar Sep 21 '14 15:09 jonathanslenders

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.

jonathanslenders avatar Sep 21 '14 15:09 jonathanslenders

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.

thomasballinger avatar Sep 21 '14 23:09 thomasballinger

Text reflow would be very cool to have.

devxpy avatar Nov 08 '18 12:11 devxpy