Skip to content

Commit 81c8217

Browse files
authored
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.
1 parent 17e729d commit 81c8217

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/boot/src/phases.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ pub fn phase(context: Rc<SproutContext>, phase: &[PhaseConfiguration]) -> Result
3030
pub fn before_handoff(context: &SproutContext) -> Result<()> {
3131
// If we have not been asked to retain the boot console, then we should clear the screen.
3232
if !context.root().options().retain_boot_console {
33-
uefi::system::with_stdout(|stdout| stdout.reset(true)).context("unable to clear screen")?;
33+
// Clear the screen. We use clear here instead of reset because some firmware,
34+
// particularly Dell firmware, does not clear the screen on reset.
35+
// We clear both stdout and stderr because it's not guaranteed that they are the same
36+
// text output.
37+
uefi::system::with_stdout(|stdout| stdout.clear()).context("unable to clear screen")?;
38+
uefi::system::with_stderr(|stderr| stderr.clear()).context("unable to clear screen")?;
3439
}
3540
Ok(())
3641
}

0 commit comments

Comments
 (0)