Repository: alacritty/alacritty
File: alacritty/src/input.rs (Rust)

Code before:
        // Pass keys to search and ignore them during `suppress_chars`.
        let search_active = self.ctx.search_active();
        if suppress_chars || search_active || self.ctx.terminal().mode().contains(TermMode::VI) {
            if search_active && !suppress_chars {
                self.ctx.search_input(c);
            }

            return;
        }

        self.ctx.on_typing_start();

        if self.ctx.terminal().grid().display_offset() != 0 {
            self.ctx.scroll(Scroll::Bottom);
        }
        self.ctx.clear_selection();

        let utf8_len = c.len_utf8();
        let mut bytes = vec![0; utf8_len];
        c.encode_utf8(&mut bytes[..]);

        #[cfg(not(target_os = "macos"))]
        let alt_send_esc = true;

        // Don't send ESC when `OptionAsAlt` is used. This doesn't handle
        // `Only{Left,Right}` variants due to inability to destinguish them.
        #[cfg(target_os = "macos")]
        let alt_send_esc = self.ctx.config().window.option_as_alt != OptionAsAlt::None;

        if alt_send_esc
            && *self.ctx.received_count() == 0
            && self.ctx.modifiers().alt()
            && utf8_len == 1
        {
            bytes.insert(0, b'\x1b');
        }

        self.ctx.write_to_pty(bytes);

        *self.ctx.received_count() += 1;
    }

    /// Attempt to find a binding and execute its action.
    ///
    /// The provided mode, mods, and key must match what is allowed by a binding
    /// for its action to be executed.
    fn process_key_bindings(&mut self, input: KeyboardInput) {
        let mode = BindingMode::new(self.ctx.terminal().mode(), self.ctx.search_active());
        let mods = *self.ctx.modifiers();
        let mut suppress_chars = None;


Review comment (suggestion):
```suggestion
        // `Only{Left,Right}` variants due to inability to distinguish them.
```

Code after:
        // Pass keys to search and ignore them during `suppress_chars`.
        let search_active = self.ctx.search_active();
        if suppress_chars || search_active || self.ctx.terminal().mode().contains(TermMode::VI) {
            if search_active && !suppress_chars {
                self.ctx.search_input(c);
            }

            return;
        }

        self.ctx.on_typing_start();

        if self.ctx.terminal().grid().display_offset() != 0 {
            self.ctx.scroll(Scroll::Bottom);
        }
        self.ctx.clear_selection();

        let utf8_len = c.len_utf8();
        let mut bytes = vec![0; utf8_len];
        c.encode_utf8(&mut bytes[..]);

        #[cfg(not(target_os = "macos"))]
        let alt_send_esc = true;

        // Don't send ESC when `OptionAsAlt` is used. This doesn't handle
        // `Only{Left,Right}` variants due to inability to distinguish them.
        #[cfg(target_os = "macos")]
        let alt_send_esc = self.ctx.config().window.option_as_alt != OptionAsAlt::None;

        if alt_send_esc
            && *self.ctx.received_count() == 0
            && self.ctx.modifiers().alt()
            && utf8_len == 1
        {
            bytes.insert(0, b'\x1b');
        }

        self.ctx.write_to_pty(bytes);

        *self.ctx.received_count() += 1;
    }

    /// Attempt to find a binding and execute its action.
    ///
    /// The provided mode, mods, and key must match what is allowed by a binding
    /// for its action to be executed.
    fn process_key_bindings(&mut self, input: KeyboardInput) {
        let mode = BindingMode::new(self.ctx.terminal().mode(), self.ctx.search_active());
        let mods = *self.ctx.modifiers();
        let mut suppress_chars = None;