From b76adc155d979705a353fd6dc87c702f9dfc6c22 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 1 Aug 2026 04:27:50 +0300 Subject: fix(input): preserve native key lifecycle across routing (#2142) refs #2077 Co-authored-by: Jonathan Liebig --- src/pane/input.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pane/input.rs') diff --git a/src/pane/input.rs b/src/pane/input.rs index 6906e77d..38e8138b 100644 --- a/src/pane/input.rs +++ b/src/pane/input.rs @@ -1,5 +1,5 @@ pub(super) fn ghostty_key_event_from_terminal_key( - key: crate::input::TerminalKey, + key: &crate::input::TerminalKey, ) -> Option { let mut event = crate::ghostty::KeyEvent::new().ok()?; event.set_action(match key.kind { @@ -32,7 +32,7 @@ pub(super) fn ghostty_key_event_from_terminal_key( Some(event) } -pub(super) fn ghostty_prefers_herdr_text_encoding(key: crate::input::TerminalKey) -> bool { +pub(super) fn ghostty_prefers_herdr_text_encoding(key: &crate::input::TerminalKey) -> bool { matches!(key.code, crossterm::event::KeyCode::Char(_)) } @@ -168,7 +168,7 @@ pub(super) fn ghostty_mouse_event_from_wheel_kind( Some(event) } -fn ghostty_key_text(key: crate::input::TerminalKey) -> Option { +fn ghostty_key_text(key: &crate::input::TerminalKey) -> Option { match key.code { crossterm::event::KeyCode::Char(c) => Some( key.shifted_codepoint @@ -180,7 +180,7 @@ fn ghostty_key_text(key: crate::input::TerminalKey) -> Option { } } -fn ghostty_unshifted_codepoint(key: crate::input::TerminalKey) -> Option { +fn ghostty_unshifted_codepoint(key: &crate::input::TerminalKey) -> Option { match key.code { crossterm::event::KeyCode::Char(c) => Some(c as u32), _ => None, -- cgit v1.2.3