<table><tr><td style="">mglb created this revision.<br />mglb added a reviewer: Konsole.<br />mglb added a project: Konsole.<br />Herald added a subscriber: konsole-devel.<br />mglb requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21282">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This behavior is present in e.g. xterm and linux console.</p>

<p>Currently when using CSI 2J escape sequence, screen contents are<br />
appended to scrollback (including bottom empty lines). This is breaking<br />
<tt style="background: #ebebeb; font-size: 13px;">clear</tt> command, which replaces scrollback with current screen contents.</p>

<p>BUG: 384218</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Start Konsole with a shell</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">clear</tt></li>
</ul>

<p><strong>Expected result:</strong><br />
Cleared display, empty scrollback.<br />
<strong>Actual result:</strong><br />
Cleared display, but scrollback contains previous display contents.</p>

<hr class="remarkup-hr" />

<ul class="remarkup-list">
<li class="remarkup-list-item">Start Konsole with a shell</li>
<li class="remarkup-list-item">seq 1000</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">echo -ne '\033[2J</tt></li>
</ul>

<p><strong>Expected result:</strong><br />
Cleared display, numbers in last scrollback lines.<br />
<strong>Actual result:</strong><br />
Cleared display, but scrollback contains previous display contents<br />
(i.e. shell prompt in last lines)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>BRANCH</strong><div><div>fix-clear (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21282">https://phabricator.kde.org/D21282</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/Screen.cpp</div></div></div><br /><div><strong>To: </strong>mglb, Konsole<br /><strong>Cc: </strong>konsole-devel, Konsole, gennad, thsurrel, ngraham, maximilianocuria, hindenburg<br /></div>