DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #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,051
Thanked 118 Times in 93 Posts
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
Reply

Tags
clear, logout, vidcontrol

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: system load status in screen(1) vermaden Guides 9 29th March 2010 08:07 PM
log in to console and startx in os x questionguy Other BSD and UNIX/UNIX-like 11 25th August 2009 05:27 AM
Console Resolution Problem kienjakenobi FreeBSD General 19 12th September 2008 12:20 PM
Console Fonts JMJ_coder General software and network 6 10th September 2008 09:57 PM


All times are GMT. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick