浏览代码

[cmdline] Always clear screen after reconfiguring console

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 年前
父节点
当前提交
290a43efda
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      src/hci/commands/console_cmd.c

+ 5
- 0
src/hci/commands/console_cmd.c 查看文件

@@ -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:

正在加载...
取消
保存