File: rh-clearscrollback.patch

package info (click to toggle)
mingetty 1.08-2
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 212 kB
  • ctags: 202
  • sloc: ansic: 2,552; makefile: 16
file content (26 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Clear scroll-back buffer on clear screen
 This is implemented in Linux since 3.0 version.
Author: Petr Pisar <ppisar@redhat.com>
Origin: vendor
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=691406
Reviewed-By: Paul Martin <pm@debian.org>
Last-Update: 2012-05-01

Index: mingetty-1.08/mingetty.c
===================================================================
--- mingetty-1.08.orig/mingetty.c	2012-05-01 12:40:01.629647425 +0100
+++ mingetty-1.08/mingetty.c	2012-05-01 12:46:14.828486093 +0100
@@ -207,8 +207,11 @@
 
 	/* 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);
 }