From 3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 23 Dec 2021 10:23:06 +0000 Subject: Fix CreateNewWindow CLI fallback The existing behavior for the new CreateNewWindow actions was to always pass in their own options, which would discard the existing options configured on the terminal's PTY config. To fix this the behavior for CreateNewWindow is now the same as for the initial window creation, the config values are overwritten conditionally based on their individual presence in the CLI options. However all temporary CLI options set on the "master" Alacritty instance are discarded by all future windows. Fixes #5659. --- alacritty/src/input.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'alacritty/src/input.rs') diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs index 40b18ca2..466fe130 100644 --- a/alacritty/src/input.rs +++ b/alacritty/src/input.rs @@ -802,11 +802,8 @@ impl> Processor { self.ctx.clear_selection(); let utf8_len = c.len_utf8(); - let mut bytes = Vec::with_capacity(utf8_len); - unsafe { - bytes.set_len(utf8_len); - c.encode_utf8(&mut bytes[..]); - } + let mut bytes = vec![0; utf8_len]; + c.encode_utf8(&mut bytes[..]); if self.ctx.config().alt_send_esc && *self.ctx.received_count() == 0 @@ -1007,7 +1004,7 @@ mod tests { } fn terminal_mut(&mut self) -> &mut Term { - &mut self.terminal + self.terminal } fn size_info(&self) -> SizeInfo { -- cgit