Bug 815790 - [RFE-privacy] clear the console
Summary: [RFE-privacy] clear the console
Alias: None
Product: Fedora
Classification: Fedora
Component: ncurses
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-04-24 14:12 UTC by Account closed by user
Modified: 2013-05-01 03:33 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-01-30 13:44:29 UTC
Type: Bug

Attachments (Terms of Use)
c code (5.28 KB, text/plain)
2012-04-24 16:39 UTC, Account closed by user
no flags Details
man page (2.74 KB, application/x-troff-man)
2012-04-24 16:40 UTC, Account closed by user
no flags Details
bash_logout (220 bytes, application/octet-stream)
2012-04-24 16:51 UTC, Account closed by user
no flags Details

Description Account closed by user 2012-04-24 14:12:50 UTC
clear_console: New helper program to clear the *console*, including the _scrollback buffer_.


clear_console  clears  your console if this is possible.  It looks in
the environment for the terminal type and then in the terminfo
database to figure out how to clear the screen. To clear the buffer,
it then changes the foreground  virtual  terminal  to another
terminal and then back to the original terminal.

src in debian_bash: http://packages.qa.debian.org/b/bash.html

Comment 1 Roman Rakus 2012-04-24 16:10:03 UTC
Thanks for informations. I don't like debian all-in-one patch style. Is clear_console somewhere alone?

Comment 2 Account closed by user 2012-04-24 16:39:57 UTC
Created attachment 579914 [details]
c code

Comment 3 Account closed by user 2012-04-24 16:40:36 UTC
Created attachment 579915 [details]
man page

Comment 4 Account closed by user 2012-04-24 16:47:25 UTC
source: http://archive.ubuntu.com/ubuntu/pool/main/b/bash/bash_4.2-2ubuntu2.diff.gz
or: http://ftp.de.debian.org/debian/pool/main/b/bash/bash_4.2-2.diff.gz

$ gzip -cd bash_xxx.diff.gz | patch -p1 -f

Comment 5 Account closed by user 2012-04-24 16:51:37 UTC
Created attachment 579920 [details]

Comment 6 Account closed by user 2012-04-24 17:21:11 UTC
I think util-linux is a much better place for clear_console.

Comment 7 Roman Rakus 2012-04-24 17:48:33 UTC
I don't think changing bash logout is good idea. There is clear binary and it is in ncurses package, so ncurses seems to be the most suitable to contain clear_console for me. Let's see what is the opinion of ncurses maintainer.

Comment 8 Miroslav Lichvar 2012-04-25 13:25:07 UTC
Recent kernels support a command to clear the scrollbuffer directly, without need to switch to another console and back. You can do that by 'tput E3' in shell.

I'm not sure this is worth creating a new binary just for that. Let's ask the upstream maintainer.

Comment 9 Thomas E. Dickey 2012-04-25 21:11:58 UTC
There was some discussion of clear_console before, see
I don't know why there was no followup, but that's a place
to start.

Comment 10 Miroslav Lichvar 2012-10-15 13:51:45 UTC
Thomas, do you think it would be acceptable to include in ncurses a script which simply calls "tput E3; clear" or do you prefer a C implementation?

Comment 11 Account closed by user 2013-01-04 14:19:44 UTC

Comment 12 Thomas E. Dickey 2013-01-06 22:54:17 UTC
hmm - I replied via email 2012/10/15, but the reply didn't get here.

What I said then:

I'm not sure what's needed: it's a one-liner if E3 exists and a regular
"clear" if not.

My point then that was that for a one-liner, and relatively small use,
I'm not sure why it's especially useful in ncurses (perhaps starting
by a patch to the package in Fedora would be the best way to proceed).

Comment 13 Miroslav Lichvar 2013-01-30 13:44:29 UTC
Instead of adding a new program, I've modified the clear(1) program to clear also the scrollback buffer if the E3 capability is present.

This is in ncurses-5.9-8.20130126.fc19.

Comment 14 Fedora Update System 2013-04-15 12:46:21 UTC
ncurses-5.9-10.20130413.fc18 has been submitted as an update for Fedora 18.

Comment 15 Fedora Update System 2013-04-15 13:03:44 UTC
ncurses-5.9-10.20130413.fc17 has been submitted as an update for Fedora 17.

Comment 16 Fedora Update System 2013-05-01 03:27:15 UTC
ncurses-5.9-10.20130413.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2013-05-01 03:33:57 UTC
ncurses-5.9-10.20130413.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.