aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--README.md5
-rw-r--r--src/term/mod.rs24
3 files changed, 22 insertions, 8 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 67614ddb..4d0af202 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -46,4 +46,5 @@ rev = "af7fe340bd4a2af53ea521defcb4f377cdc588cf"
[profile.release]
+lto = true
debug = true
diff --git a/README.md b/README.md
index 4683b35a..0fea0075 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ will walk you through how to build from source on both macOS and Ubuntu.
If you run into problems, you can try a known-good version of the compiler by running
```sh
- rustup override set $(cat rustc-version)
+ rustup override set $(<rustc-version)
```
#### Additional Linux Prerequisites
@@ -74,6 +74,7 @@ apt-get install cmake libfreetype6-dev libfontconfig1-dev xclip
On Arch Linux, you need a few extra libraries to build Alacritty. Here's a
`pacman` command that should install all of them. If something is still found
to be missing, please open an issue.
+
```sh
pacman -S cmake freetype2 fontconfig xclip
```
@@ -176,7 +177,7 @@ Just Works.
`env WAYLAND_DISPLAY= alacritty`
- _When will Windows support be available?_ When someone has time to work on it.
Contributors would be welcomed :).
-- _My arrow keys don't work_ It sounds like you deleted some key bindings from
+- _My arrow keys don't work_. It sounds like you deleted some key bindings from
your config file. Please reference the default config file to restore them.
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 92e5463d..47d30d3f 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -484,8 +484,8 @@ impl Term {
let old_cols = self.size_info.cols();
let old_lines = self.size_info.lines();
- let num_cols = size.cols();
- let num_lines = size.lines();
+ let mut num_cols = size.cols();
+ let mut num_lines = size.lines();
self.size_info = size;
@@ -493,6 +493,16 @@ impl Term {
return;
}
+ // Should not allow less than 1 col, causes all sorts of checks to be required.
+ if num_cols <= Column(1) {
+ num_cols = Column(2);
+ }
+
+ // Should not allow less than 1 line, causes all sorts of checks to be required.
+ if num_lines <= Line(1) {
+ num_lines = Line(2);
+ }
+
// Scroll up to keep cursor and as much context as possible in grid.
// This only runs when the lines decreases.
self.scroll_region = Line(0)..self.grid.num_lines();
@@ -522,10 +532,12 @@ impl Term {
self.tabs[0] = false;
- // Make sure bottom of terminal is clear
- let template = self.empty_cell;
- self.grid.clear_region((self.cursor.line).., |c| c.reset(&template));
- self.alt_grid.clear_region((self.cursor.line).., |c| c.reset(&template));
+ if num_lines > old_lines {
+ // Make sure bottom of terminal is clear
+ let template = self.empty_cell;
+ self.grid.clear_region((self.cursor.line + 1).., |c| c.reset(&template));
+ self.alt_grid.clear_region((self.cursor.line + 1).., |c| c.reset(&template));
+ }
// Reset scrolling region to new size
self.scroll_region = Line(0)..self.grid.num_lines();