Add function that removes a printed character from the screen.
Closed this issue · 6 comments
Motanescu1357 commented
Add function that removes a printed character from the screen.
nicholasbishop commented
You can do this by printing a backspace character (numeric value of 8). Here's a simple example, which I tested in both a VM on a Lenovo Thinkpad X1 Carbon:
#![no_main]
#![no_std]
use uefi::prelude::*;
use uefi::print;
#[entry]
fn main() -> Status {
uefi::helpers::init().unwrap();
print!("abcdefghijklmnopqrstuvwxyz");
for _ in 0..26 {
// Pause briefly.
boot::stall(500_000);
// Print backspace character.
print!("\x08");
}
Status::SUCCESS
}This prints abcdefghijklmnopqrstuvwxyz, then slowly removes characters one at a time.
Motanescu1357 commented
for me it does not work.
Motanescu1357 commented
Maybe my bios does not implement special characters like backspace.
nicholasbishop commented
Checking a couple things:
- What specific machine are you testing on?
- Did you test exactly the code above, or some variation? (I want to make sure we're both testing the exact same thing.)
Motanescu1357 commented
I used a ASUS M509 DA laptop with a AMD RYZEN 5 procesor.
I tested the same code.
nicholasbishop commented
Unfortunately I don't think there's anything we can do here. It sounds like the vendor's implementation just doesn't support this. As an alternative you could potentially use the GraphicsOutput protocol to fully replace the console output with manually-drawn text.