]> err.no Git - systemd/commitdiff
util: clear scrolling region when clearing screen
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 19:17:31 +0000 (21:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 19:17:31 +0000 (21:17 +0200)
src/util.c

index 278f0184de9f86ed9bce726d6ee201dfe7431202..a0c04e3204f81b259e4f84d0884338c6c30645be 100644 (file)
@@ -4674,7 +4674,11 @@ int vt_disallocate(const char *name) {
                 if (fd < 0)
                         return fd;
 
-                loop_write(fd, "\033[H\033[2J", 7, false); /* clear screen */
+                loop_write(fd,
+                           "\033[r"    /* clear scrolling region */
+                           "\033[H"    /* move home */
+                           "\033[2J",  /* clear screen */
+                           10, false);
                 close_nointr_nofail(fd);
 
                 return 0;
@@ -4710,8 +4714,11 @@ int vt_disallocate(const char *name) {
         if (fd < 0)
                 return fd;
 
-        /* Requires Linux 2.6.40 */
-        loop_write(fd, "\033[H\033[3J", 7, false); /* clear screen including scrollback */
+        loop_write(fd,
+                   "\033[r"   /* clear scrolling region */
+                   "\033[H"   /* move home */
+                   "\033[3J", /* clear screen including scrollback, requires Linux 2.6.40 */
+                   10, false);
         close_nointr_nofail(fd);
 
         return 0;