Skip to content

Commit 51cf9a9

Browse files
committed
fix(console): 清除控制台缓冲区避免显示问题
1 parent 9a463b6 commit 51cf9a9

File tree

1 file changed

+3
-0
lines changed
  • kernel/src/output/console

1 file changed

+3
-0
lines changed

kernel/src/output/console/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ pub enum ConsoleType {
9898

9999
pub fn select_console(t: ConsoleType) {
100100
let mut console = CONSOLE.lock();
101+
// Must do clear before switching console, in order to
102+
// avoid 2 console displaying problem.
103+
console.clear();
101104
*console = match t {
102105
#[cfg(ENABLE_BITFONT_CONSOLE)]
103106
ConsoleType::Bitfont => alloc::boxed::Box::new(BitfontConsole::init()),

0 commit comments

Comments
 (0)