No announcement yet.

GNOME Terminal Gets Text Rewrap On Resizing

  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by rohcQaH View Post
    rxvt has had this feature for years. It's one of those features you only miss when it's gone, and it's the primary reason I've been sticking with rxvt ever since.
    I really do hope gnome-terminal's implementation is much better than urxvt's. For example, rxvt doesn't rewrap until you reach the bottom of the screen - this makes no sense to me. Rxvt cuts double wide (CJK) characters in half, Gnome-terminal wraps them correctly. When the alternate screen is present (such as when "less" or "mc" is running) the content underneath (the one you get back when you quit the app) is not rewrapped in rxvt, only in Gnome-terminal. When you resize the window the scrollbar jumps back to the bottom in Rxvt, while it does its best to keep it around the currently visible content in Gnome-terminal. I tried to take care to get all the minor details as perfect as possible, I encourage you to give it a try and I hope you'll like it more than rxvt's rewrapping


    • #32
      Originally posted by mark45 View Post
      I thought no rewrap is a deliberate design decision. And wow, why does even a lousy text editor have rewrap but gnome/kde consoles don't? They use a different/archaic toolkit to draw text or what?
      It's not the drawing toolkit, it's the general concept. Text editors work on relatively small files (couple of megabytes maybe), files are linear stream of data with explicit newlines, and are fairly easy to handle. Terminals provide support for linearly printed text as well as absolute cursor positioning within the main canvas area (jumping anywhere, printing a few characters there, jumping again etc.), plus millions of other hairy tricks, it's not easy to reasonably define how this content needs to be rewrapped on a resize. Also, the amount of data (including the scrollback buffer) can easily be magnitudes larger than average text files.


      • #33
        Originally posted by Akka View Post
        If the clean up of the code base resulted in the rewrap functionality the loss of transparency was a good sacrifice.
        These two have nothing to do with each other.

        As a matter of fact, it's not Gnome-terminal itself, but the underlying VTE component that added rewrapping, and the very same version of VTE (0.35) still supports transparency (although unfortunately marked as deprecated, and the corresponding checkbox was indeed removed from Gnome-terminal).

        Pair up VTE 0.35 with Gnome-terminal 3.6 and you'll get both rewrapping and transparent background


        • #34
          Originally posted by Azpegath View Post
          This is fantastic! But I guess it has a performance impact, the terminal has to keep all the output in a buffer of some sort, and reprint it to the new size of the terminal. Before, the terminal could just render the output, and then throw the text strings away, right? Or have they always kept the actual strings in memory?
          The terminal remembers a configurable number of lines, this is the scrollback buffer that you can access by Shift+PageUp or with the scrollbar. This has not changed (well, strictly speaking the implementation has changed a little but you shouldn't be able to notice it) and rewrapping doesn't have an impact at all as long as you don't resize the window.

          Rewrapping occurs and has a performance impact the moment you resize. On my average laptop, rewrapping takes around 0.2 seconds with a scrollback buffer of 1 million lines. Most people use a scrollback buffer somewhere between 1000 and 10000 lines, hence the performance penalty is negligible. Gnome-terminal allows you to have infinite scrollback, if it grows beyond a few million lines and then you resize the terminal then it's going to be really slow. For this reason, we plan to make rewrapping configurable so you can turn it off if you prefer giant scrollback and want to resize quickly.