From 1b0a3a3b484148ccf9746722f55fc28327ad2e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 10 Jun 2011 13:46:15 +0200
Subject: [PATCH] Clear scroll-back buffer on clear screen

This is implemented in Linux since 3.0 version.
---
 mingetty.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mingetty.c b/mingetty.c
index 327e630..d2ad0fc 100644
--- a/mingetty.c
+++ b/mingetty.c
@@ -192,8 +192,11 @@ static void open_tty (void)
 
 	/* Write a reset string to the terminal. This is very linux-specific
 	   and should be checked for other systems. */
-	if (noclear == 0)
-		write (0, "\033c", 2);
+	if (noclear == 0) {
+		write (0, "\033[3;J", 5);   /* Clear scroll-back buffer,
+					       since Linux 3.0 */
+		write (0, "\033c", 2);      /* Reset */
+	}
 
 	sigaction (SIGHUP, &sa_old, NULL);
 }
-- 
1.7.5.2

