diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-12-23 10:23:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-23 12:23:06 +0200 |
commit | 3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1 (patch) | |
tree | d2e8132a7b0acfc6f44c7f8e4ca0d7f5f78a5432 /alacritty/src/input.rs | |
parent | 6d1a63ef28d18168ed4ca0d6a8c3413cb4621ca5 (diff) | |
download | r-alacritty-3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1.tar.gz r-alacritty-3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1.tar.bz2 r-alacritty-3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1.zip |
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.
Diffstat (limited to 'alacritty/src/input.rs')
-rw-r--r-- | alacritty/src/input.rs | 9 |
1 files changed, 3 insertions, 6 deletions
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<T: EventListener, A: ActionContext<T>> Processor<T, A> { 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<T> { - &mut self.terminal + self.terminal } fn size_info(&self) -> SizeInfo { |