aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2023-03-25 00:07:20 +0100
committerGitHub <noreply@github.com>2023-03-24 23:07:20 +0000
commit2df8f860b960d7c96efaf4f059fe2fbbdce82bcc (patch)
tree343f21f24245b6d36dc357c206d4f754359c924c /alacritty/src/event.rs
parentef8cc5d63f34b09e46d8c733cd5a472d480f7cf1 (diff)
downloadr-alacritty-2df8f860b960d7c96efaf4f059fe2fbbdce82bcc.tar.gz
r-alacritty-2df8f860b960d7c96efaf4f059fe2fbbdce82bcc.tar.bz2
r-alacritty-2df8f860b960d7c96efaf4f059fe2fbbdce82bcc.zip
Fix selection rotation on the last line
This fixes an issue with terminal resizes when the selection is on the last line. Alacritty would fail to rotate lines and keep the selection in the same line index whenever the terminal line count was grown or shrunk. This issue occurred due to the range passed to the selection's rotate function still being based on the old terminal size, which caused the initial or target state of the rotation to be outside of the terminal bounds. Closes #6698.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 2ccd42cb..9a27963c 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -796,7 +796,7 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
// We remove `\x1b` to ensure it's impossible for the pasted text to write the bracketed
// paste end escape `\x1b[201~` and `\x03` since some shells incorrectly terminate
// bracketed paste on its receival.
- let filtered = text.replace('\x1b', "").replace('\x03', "");
+ let filtered = text.replace(['\x1b', '\x03'], "");
self.write_to_pty(filtered.into_bytes());
self.write_to_pty(&b"\x1b[201~"[..]);