diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-10 10:14:45 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-10 10:14:45 -0800 |
commit | b6c372ab4800b8dbc9e3efb042e369c9980c607a (patch) | |
tree | be7518b00a4b5a8cc46b90d7b43d82031299120b /src | |
parent | d19e6e38a425063133596aa454ccbf6f82d8b7d6 (diff) | |
download | alacritty-b6c372ab4800b8dbc9e3efb042e369c9980c607a.tar.gz alacritty-b6c372ab4800b8dbc9e3efb042e369c9980c607a.zip |
Use checked subtraction for backspace
Some shells will send a backspace at column 0, apparently.
Diffstat (limited to 'src')
-rw-r--r-- | src/term.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/term.rs b/src/term.rs index b4ac14af..33890ad5 100644 --- a/src/term.rs +++ b/src/term.rs @@ -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 |