add carriage returns to the local echo

This commit is contained in:
bunnie 2024-06-19 21:29:48 +08:00
parent 3b6629e58f
commit b9cdf166ca

View file

@ -97,7 +97,12 @@ fn uart_handler(_irq_no: usize, _arg: *mut usize) {
}
}
if unsafe { KBD_CONN != 0 } {
print!("{}", char::from_u32(c as u32).unwrap_or('.')); // local echo
let c = char::from_u32(c as u32).unwrap_or('.');
print!("{}", c); // local echo
// naked carriage return
if c == '\r' {
println!(" "); // line feed with carriage return
}
xous::try_send_message(unsafe { KBD_CONN }, xous::Message::new_scalar(0, c as usize, 0, 0, 0))
.ok();
}