Found while trying to figure out how to be sure the console is always
cleared at logout (and the resulting login prompt seemed like a pretty
guaranteed-to-always-work place). If you have a cleaner way, perhaps
one that is actually at logout and doesn't involve missing all the
startup messages due to clearing right after them (and is just as
reliable, and preferably just requires changing config files, not
source), then by all means, please let me know.

For now I've just added cl=\033[2J\033[;H to my gettytab's default entry,
and it does more or less what I want.

For the archives: I'm doing this in conjuction with ksh's TMOUT option.
See ksh(1). Also note that I'm doing this for consoles (Ctrl+Meta+<number>)
(not X11) which I find myself frequently forgetting I am logged into when I
suspend my laptop (which auto-locks X, among other things).

Relevant: http://marc.info/?t=119039386500002


Index: gettytab.5
===================================================================
RCS file: /cvs/src/libexec/getty/gettytab.5,v
retrieving revision 1.22
diff -u -p -r1.22 gettytab.5
--- gettytab.5  10 Dec 2013 20:56:59 -0000      1.22
+++ gettytab.5  23 May 2014 10:15:22 -0000
@@ -79,7 +79,7 @@ table.
 .It c2 Ta num Ta unused Ta "TTY control flags to leave terminal as."
 .It ce Ta bool Ta false Ta "Use CRT erase algorithm."
 .It ck Ta bool Ta false Ta "Use CRT kill algorithm."
-.It cl Ta str" Ta Dv NULL Ta "Screen clear sequence."
+.It cl Ta str Ta Dv NULL Ta "Screen clear sequence."
 .It co Ta bool Ta false Ta "Console; add"
 .Ql \en
 after login prompt.

Reply via email to