From 81c8217ee0932babc249bf7acdfb9404252f90bd Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 20 Dec 2025 22:29:44 -0800 Subject: [PATCH] fix(boot): on boot handoff, clear the screen using clear rather than reset (#52) On some Dell firmware, the reset operation doesn't actually clear the screen. This change uses clear instead of reset to ensure the screen is properly cleared. --- crates/boot/src/phases.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/boot/src/phases.rs b/crates/boot/src/phases.rs index 30e55c6..c047dfc 100644 --- a/crates/boot/src/phases.rs +++ b/crates/boot/src/phases.rs @@ -30,7 +30,12 @@ pub fn phase(context: Rc, phase: &[PhaseConfiguration]) -> Result pub fn before_handoff(context: &SproutContext) -> Result<()> { // If we have not been asked to retain the boot console, then we should clear the screen. if !context.root().options().retain_boot_console { - uefi::system::with_stdout(|stdout| stdout.reset(true)).context("unable to clear screen")?; + // Clear the screen. We use clear here instead of reset because some firmware, + // particularly Dell firmware, does not clear the screen on reset. + // We clear both stdout and stderr because it's not guaranteed that they are the same + // text output. + uefi::system::with_stdout(|stdout| stdout.clear()).context("unable to clear screen")?; + uefi::system::with_stderr(|stderr| stderr.clear()).context("unable to clear screen")?; } Ok(()) }