Selaa lähdekoodia

[cmdline] Always clear screen after reconfiguring console

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 vuotta sitten
vanhempi
commit
290a43efda
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5
    0
      src/hci/commands/console_cmd.c

+ 5
- 0
src/hci/commands/console_cmd.c Näytä tiedosto

@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
32 32
 #include <ipxe/console.h>
33 33
 #include <ipxe/image.h>
34 34
 #include <ipxe/pixbuf.h>
35
+#include <ipxe/ansiesc.h>
35 36
 #include <ipxe/ansicol.h>
36 37
 #include <usr/imgmgmt.h>
37 38
 
@@ -114,6 +115,10 @@ static int console_exec ( int argc, char **argv ) {
114 115
 		goto err_configure;
115 116
 	}
116 117
 
118
+	/* Reapply default colour pair and clear screen */
119
+	ansicol_set_pair ( CPAIR_DEFAULT );
120
+	printf ( CSI "2J" CSI "H" );
121
+
117 122
  err_configure:
118 123
 	pixbuf_put ( opts.config.pixbuf );
119 124
  err_pixbuf:

Loading…
Peruuta
Tallenna