Some fixes for cooked mode
This commit is contained in:
parent
3ff51e6e5f
commit
25519c4f1c
3 changed files with 53 additions and 33 deletions
|
@ -65,9 +65,15 @@ impl Scheme for DisplayScheme {
|
|||
|
||||
fn write(&self, id: usize, buf: &[u8]) -> Result<usize> {
|
||||
if id == 1 {
|
||||
let mut input = self.input.borrow_mut();
|
||||
for &b in buf.iter() {
|
||||
input.push_back(b);
|
||||
self.input.borrow_mut().push_back(b);
|
||||
if ! self.console.borrow().raw_mode {
|
||||
if b == 0x7F {
|
||||
self.write(0, b"\x08")?;
|
||||
} else {
|
||||
self.write(0, &[b])?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(buf.len())
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue