Skip to content

Commit

Permalink
Reset color attributes and clear screen when starting up
Browse files Browse the repository at this point in the history
Some boot loaders, like GRUB, leave background color artifacts from
their boot menu.  This patch resets the foreground and background
color attributes, and then clears the screen, without clearing the
scrollback buffer.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Oct 28, 2024
1 parent 46ffa81 commit 119e66a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ void console_init(void)
/* Enable line wrap, if disabled previously, e.g., qemu */
dprint(STDOUT_FILENO, "\033[?7h", 5);

/* Reset atttributes, background and foreground color */
dprint(STDOUT_FILENO, "\033[49m\033[39m\e[2J", 14);

log_init();
}

Expand Down

0 comments on commit 119e66a

Please sign in to comment.