[mingetty] Clear scroll-back buffer

Petr Pisar ppisar at fedoraproject.org
Fri Jun 10 12:43:04 UTC 2011


commit c46ef303adcaa2ba8c487d57f1ee94381f919be0
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Jun 10 14:09:25 2011 +0200

    Clear scroll-back buffer

 ...-Clear-scroll-back-buffer-on-clear-screen.patch |   30 ++++++++++++++++++++
 mingetty.spec                                      |    8 ++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/mingetty-1.08-Clear-scroll-back-buffer-on-clear-screen.patch b/mingetty-1.08-Clear-scroll-back-buffer-on-clear-screen.patch
new file mode 100644
index 0000000..a9e05c6
--- /dev/null
+++ b/mingetty-1.08-Clear-scroll-back-buffer-on-clear-screen.patch
@@ -0,0 +1,30 @@
+From a0d04e0d1ccbde0e080f8586adfb7c0392fdf9d3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at 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 |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/mingetty.c b/mingetty.c
+index 327e630..ead355c 100644
+--- a/mingetty.c
++++ b/mingetty.c
+@@ -192,8 +192,10 @@ 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", 2);   /* Clear scroll buffer, since Linux 3.0 */
++		write (0, "\033c", 2);      /* Reset */
++    }
+ 
+ 	sigaction (SIGHUP, &sa_old, NULL);
+ }
+-- 
+1.7.5.2
+
diff --git a/mingetty.spec b/mingetty.spec
index ffd6a61..a10ffb2 100644
--- a/mingetty.spec
+++ b/mingetty.spec
@@ -2,7 +2,7 @@ Summary: A compact getty program for virtual consoles only
 Name: mingetty
 Version: 1.08
 License: GPLv2+
-Release: 7%{?dist}
+Release: 8%{?dist}
 Group: System Environment/Base
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://sourceforge.net/projects/mingetty/
@@ -15,6 +15,8 @@ Patch2: mingetty-1.08-openlog_authpriv.patch
 Patch3: mingetty-1.08-limit_tty_length.patch
 # Bug #647143
 Patch4: mingetty-1.08-Allow-login-name-up-to-LOGIN_NAME_MAX-length.patch
+# Bug #691406
+Patch5: mingetty-1.08-Clear-scroll-back-buffer-on-clear-screen.patch
 
 %description
 The mingetty program is a lightweight, minimalist getty program for
@@ -28,6 +30,7 @@ lines (you should use the mgetty program in that case).
 %patch2 -p1 -b .openlog
 %patch3 -p1 -b .tty_length
 %patch4 -p1 -b .loginname_length
+%patch5 -p1 -b .clear_buffer
 
 %build
 make "RPM_OPTS=$RPM_OPT_FLAGS"
@@ -49,6 +52,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/mingetty.*
 
 %changelog
+* Fri Jun 10 2011 Petr Pisar <ppisar at redhat.com> - 1.08-8
+- Clear scroll-back buffer (bug #691406)
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.08-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list