View Single Post
  #1   (View Single Post)  
Old 5th May 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default HOWTO: Clear console screen after logout

I have tried to put clear at shells logout scripts: /etc/{zlogout,csh.logout} etc, also changing /etc/gettytab from:

Code:
P|Pc|Pc console:\
        :ht:np:sp#115200:
to:

Code:
P|Pc|Pc console:\
        :ht:np:sp#115200:\
        :cl=\E[H\E[2J:
does not prevent user from hitting Scroll Lock key and scrolling terminal history with Page {Up,Down}.

At this moment the only trully working sollution to this I have found is to put:

Code:
vidcontrol -C && clear
to all logout scripts of shells.

REPLIES:

vidcontrol -C && clear does this very well, but like I said I am looking for some PURE/PROPER sollution for this.

Quote:
Originally Posted by ephemera
I don't think there's any other solution but ofcourse you could modify the getty source code to empty the sc scroll back buffer every time its run and recompile it

Cheers!
Thank You for another sollution, but I think that I will stay with vidcontrol -C && clear for one reason: why touch two files while I can touch only one.

Regards

EDIT0: I think that I will use Your method because sh and ksh shells does not support any *logout files.

EDIT1: sollution to not use /etc/gettytab:
sh and ksh both use /etc/profile as a main startup file but as I mentioned before they does not support *logout files, the sollution is to put this command into /etc/profile:
Code:
trap "vidcontrol -C && clear" 0
so vidcontrol -C && clear will be executed at logout.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd

Last edited by Carpetsmoker; 7th May 2008 at 05:47 AM. Reason: Fix title
Reply With Quote