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:
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user