You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically i guess how this would work is,
each line has a flag for whether it ended in a wrap or a newline (and where the newline was, since there could be trailing whitespace)
when the window is resized, we take the array of lines, and combine all the consecutive lines which ended in a wrap (i.e. undoing the wrapping which happened when they were printed). then take these L O N G lines and split them based on the new terminal width
(this can be optimized to be done in one pass without extra memory usage, but that's the basic idea)
There may be other considerations to consider, but generally this seems to work fine across the terminals that support it so I doubt it's very complicated.
Of course this will only work for simple text output (and not graphical TUI programs etc.), but this will only apply to the main screen so that doesn't matter.
The main trouble seems to come from the shell prompt fighting with the re-wrapper, but I'm pretty sure I've seen terminals which don't have this issue so it's probably possible to fix.
The text was updated successfully, but these errors were encountered:
this is a pretty important feature imo. i tend to snap windows around depending on the references i have open next to them.
wrap/newline tracking is also important for copying rectangular text selections and not getting like a bunch of spaces or other Bad Characters..
(it only has to apply to the main screen because the alt buffer programs self-repaint on resize anyway)
Basically i guess how this would work is,
each line has a flag for whether it ended in a wrap or a newline (and where the newline was, since there could be trailing whitespace)
when the window is resized, we take the array of lines, and combine all the consecutive lines which ended in a wrap (i.e. undoing the wrapping which happened when they were printed). then take these L O N G lines and split them based on the new terminal width
(this can be optimized to be done in one pass without extra memory usage, but that's the basic idea)
There may be other considerations to consider, but generally this seems to work fine across the terminals that support it so I doubt it's very complicated.
Of course this will only work for simple text output (and not graphical TUI programs etc.), but this will only apply to the main screen so that doesn't matter.
The main trouble seems to come from the shell prompt fighting with the re-wrapper, but I'm pretty sure I've seen terminals which don't have this issue so it's probably possible to fix.
The text was updated successfully, but these errors were encountered: