diff --git a/src/gliumwindows.rs b/src/gliumwindows.rs index a19559f8b..0c6da9df5 100644 --- a/src/gliumwindows.rs +++ b/src/gliumwindows.rs @@ -635,11 +635,7 @@ impl GliumTerminalWindow { return Ok(()); } - tab.terminal().key_down( - key, - mods, - &mut TabHost::new(&mut tab.pty(), &mut self.host), - )? + tab.terminal().key_down(key, mods, &mut *tab.pty())? } ElementState::Released => tab.terminal().key_up( @@ -699,7 +695,7 @@ impl GliumTerminalWindow { tab.terminal().key_down( KeyCode::Char(c), self.last_modifiers, - &mut TabHost::new(&mut tab.pty(), &mut self.host), + &mut *tab.pty(), )?; self.paint_if_needed()?; } diff --git a/src/xwindows/xwin.rs b/src/xwindows/xwin.rs index da5a78b60..0d15d4838 100644 --- a/src/xwindows/xwin.rs +++ b/src/xwindows/xwin.rs @@ -241,11 +241,7 @@ impl X11TerminalWindow { return Ok(()); } - tab.terminal().key_down( - code, - mods, - &mut TabHost::new(&mut tab.pty(), &mut self.host), - )?; + tab.terminal().key_down(code, mods, &mut *tab.pty())?; } } xcb::KEY_RELEASE => { diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 3505b7e90..42dd523d1 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -601,7 +601,7 @@ impl TerminalState { )?; } else if self.screen.is_alt_screen_active() { // Send cursor keys instead (equivalent to xterm's alternateScroll mode) - self.key_down(key, KeyModifiers::default(), host)?; + self.key_down(key, KeyModifiers::default(), host.writer())?; } else { self.scroll_viewport(scroll_delta) } @@ -692,7 +692,7 @@ impl TerminalState { &mut self, key: KeyCode, mods: KeyModifiers, - host: &mut TerminalHost, + writer: &mut std::io::Write, ) -> Result<(), Error> { const CTRL: KeyModifiers = KeyModifiers::CTRL; const SHIFT: KeyModifiers = KeyModifiers::SHIFT; @@ -710,10 +710,6 @@ impl TerminalState { // TODO: also respect self.application_keypad let to_send = match (key, ctrl, alt, shift, self.application_cursor_keys) { - (Enter, _, ALT, ..) | (Char('\r'), _, ALT, ..) | (Char('\n'), _, ALT, ..) => { - host.toggle_full_screen(); - return Ok(()); - } (Tab, ..) => "\t", (Enter, ..) => "\r", (Backspace, ..) => "\x08", @@ -858,7 +854,7 @@ impl TerminalState { }; // eprintln!("sending {:?}", to_send); - write_all(host.writer(), to_send.as_bytes())?; + write_all(writer, to_send.as_bytes())?; // Reset the viewport if we sent data to the parser if !to_send.is_empty() && self.viewport_offset != 0 {