<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - weston-terminal: artifacts (lingering character glyphs) when scrolling in vim (ncurses)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=71935#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - weston-terminal: artifacts (lingering character glyphs) when scrolling in vim (ncurses)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=71935">bug 71935</a>
              from <span class="vcard"><a class="email" href="mailto:emiettin@edu.lahti.fi" title="emiettin@edu.lahti.fi">emiettin@edu.lahti.fi</a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=89708" name="attach_89708" title="patch to fix the 'clear entire screen' escape sequence handler">attachment 89708</a> <a href="attachment.cgi?id=89708&action=edit" title="patch to fix the 'clear entire screen' escape sequence handler">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=71935&attachment=89708'>[review]</a>
patch to fix the 'clear entire screen' escape sequence handler

--- weston_a/clients/terminal.c 2013-11-24 13:18:57.020992332 +0200
+++ weston_b/clients/terminal.c 2013-11-24 13:19:28.517658360 +0200
@@ -1415,8 +1415,12 @@
                        }
                } else if (args[0] == 2) {
                        /* Clear screen by scrolling contents out */
-                       terminal_scroll_buffer(terminal,
-                                              terminal->end -
terminal->start);
+                       for (i = 0; i < terminal->height; i++) {
+                               memset(terminal_get_row(terminal, i),
+                                   0, terminal->data_pitch);
+                               attr_init(terminal_get_attr_row(terminal, i),
+                                   terminal->curr_attr, terminal->width);
+                       }
                }
                break;
        case 'K':    /* EL */</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>