fbcond: translate CR to LF on keyboard input

The keyboard input path pushed the raw character bytes, so the Enter key
(a bare CR on the keymap) never produced an LF. Line-oriented readers on
the console (e.g. a shell's read_line) then never saw a completed line and
appeared to hang. Convert CR->LF here, matching the serial input path
(push_input_bytes).
This commit is contained in:
Red Bear OS
2026-07-18 12:02:45 +09:00
parent ebf0cad69d
commit 8b605179eb
+5 -1
View File
@@ -88,7 +88,11 @@ impl TextScreen {
}
for &b in buf.iter() {
self.input.push_back(b);
// Translate a bare CR (what the Enter key produces on most keymaps)
// to LF, matching the serial input path (push_input_bytes). Without
// this, line-oriented readers such as a shell's read_line never see
// a completed line from keyboard input and appear to hang.
self.input.push_back(if b == b'\r' { b'\n' } else { b });
}
}