Use checked subtraction for backspace
Some shells will send a backspace at column 0, apparently.
This commit is contained in:
parent
d19e6e38a4
commit
b6c372ab48
|
@ -570,7 +570,9 @@ impl ansi::Handler for Term {
|
|||
#[inline]
|
||||
fn backspace(&mut self) {
|
||||
debug_println!("backspace");
|
||||
self.cursor.col -= 1;
|
||||
if self.cursor.col > Column(0) {
|
||||
self.cursor.col -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// Carriage return
|
||||
|
|
Loading…
Reference in New Issue