diff options
author | Joe Wilm <joe@jwilm.com> | 2017-02-11 13:53:32 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-02-11 13:54:37 -0800 |
commit | d2e8a0cd103a4923d296136ac499ce026fdd625a (patch) | |
tree | b3aafa3c087388cfa5a0b528101bb9d2a26a8aec | |
parent | 2063f54455a987fc6bd7dbc6f770c660d0ec48e6 (diff) | |
download | alacritty-d2e8a0cd103a4923d296136ac499ce026fdd625a.tar.gz alacritty-d2e8a0cd103a4923d296136ac499ce026fdd625a.zip |
Fix issue with cat /dev/urandom
-rw-r--r-- | src/term/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index a7cda171..26ed2fad 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -893,7 +893,7 @@ impl Term { // Clear `lines` lines at bottom of area { let end = self.scroll_region.end; - let start = end - lines; + let start = Line(end.0.saturating_sub(lines.0)); self.grid.clear_region(start..end, |c| c.reset(&template)); } @@ -925,7 +925,7 @@ impl Term { // Clear `lines` lines starting from origin to origin + lines { - let end = origin + lines; + let end = min(origin + lines, self.grid.num_lines()); self.grid.clear_region(origin..end, |c| c.reset(&template)); } |