Bug 714684

Summary: RFE: command to clear scrollback buffer in linux terminal
Product: Red Hat Enterprise Linux 6 Reporter: Petr Pisar <ppisar>
Component: kernelAssignee: Frantisek Hrbata <fhrbata>
Status: CLOSED ERRATA QA Contact: WANG Chao <chaowang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: chaowang, czhang, gansalmon, itamar, jonathan, kernel-maint, kzhang, madhu.chinakonda, mlichvar, ppisar, psabata, ruyang, sgrubb
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://thread.gmane.org/gmane.linux.kernel/1117336
Whiteboard:
Fixed In Version: kernel-2.6.32-165.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 684261
: 806803 (view as bug list) Environment:
Last Closed: 2011-12-06 13:42:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 714687, 714693, 806803, 807369    

Description Petr Pisar 2011-06-20 12:47:53 UTC
+++ This bug was initially created as a clone of Bug #684261 +++

Description of problem:
In some situations it would be good to clear the terminal's scrollback buffer, for example on new login or when the terminal is locked so someone else won't be able to see the previous content with shift-pgup. (bug #683733)

There are hacks can be used to force clearing the buffer, like switching to another console and back, or changing the size of the terminal, but all seem to have some drawbacks.

This is a request to add a new command like \E[3J which would reset the scrollback buffer and which could be added to the linux terminfo entry, either to the clear sequence or as a new string capability.

--- Additional comment from ppisar on 2011-03-23 15:47:52 GMT ---

Created attachment 487076 [details]
Proposed fix

This patch introduce new \E[J parameter 3 that allows to scramble
scroll-back buffer explicitly. Session locking programs (screen,
vlock) can use it to prevent attacker to browse locked console
history.

Tested on VGA and FB_VGA16 console in qemu.

--- Additional comment from davej on 2011-03-24 03:38:16 GMT ---

post it to linux-kernel.org

We'll pick it up when we rebase if it gets merged.

--- Additional comment from ppisar on 2011-05-24 06:57:58 GMT ---

Merged to Linus' linux-2.6:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8df13e0a901fe55631fed66562369b4dba40f8b
----

This is in Fedora Rahwide now and it will be part of Linux-3.0. Based on discussion with Steve Grubb, I propose this feature for RHEL-6.2 as an alternative to disabled scroll-back buffer. Depending utilization by user space (mingetty and screen) will be request too.

Comment 2 Aristeu Rozanski 2011-07-08 21:58:14 UTC
Patch(es) available on kernel-2.6.32-165.el6

Comment 6 errata-xmlrpc 2011-12-06 13:42:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1530.html