diff --git a/src/input.rs b/src/input.rs index d5151addc..0e55a370f 100644 --- a/src/input.rs +++ b/src/input.rs @@ -13,7 +13,7 @@ use crate::reader::{ ReaderData, }; use crate::signal::signal_clear_cancel; -use crate::threads::assert_is_main_thread; +use crate::threads::{assert_is_main_thread, iothread_service_main}; use crate::wchar::prelude::*; use once_cell::sync::{Lazy, OnceCell}; use std::ffi::CString; @@ -434,6 +434,10 @@ impl InputEventQueuer for ReaderData { self.parser().sync_uvars_and_fire(true /* always */); } + fn ioport_notified(&mut self) { + iothread_service_main(self); + } + fn paste_start_buffering(&mut self) { self.input_data.paste_buffer = Some(vec![]); self.push_front(CharEvent::from_readline(ReadlineCmd::BeginUndoGroup)); diff --git a/src/input_common.rs b/src/input_common.rs index 7fbaa6f47..9da57e4de 100644 --- a/src/input_common.rs +++ b/src/input_common.rs @@ -12,7 +12,7 @@ use crate::key::{ Key, Modifiers, }; use crate::reader::{reader_current_data, reader_test_and_clear_interrupted}; -use crate::threads::{iothread_port, iothread_service_main, MainThread}; +use crate::threads::{iothread_port, MainThread}; use crate::universal_notifier::default_notifier; use crate::wchar::{encode_byte_to_char, prelude::*}; use crate::wutil::encoding::{mbrtowc, mbstate_t, zero_mbstate}; @@ -595,7 +595,7 @@ pub trait InputEventQueuer { } ReadbResult::IOPortNotified => { - iothread_service_main(reader_current_data().unwrap()); + self.ioport_notified(); } ReadbResult::Byte(read_byte) => { @@ -1215,6 +1215,10 @@ pub trait InputEventQueuer { /// The default does nothing. fn uvar_change_notified(&mut self) {} + /// Override point for when the ioport is ready. + /// The default does nothing. + fn ioport_notified(&mut self) {} + /// Reset the function status. fn get_function_status(&self) -> bool { self.get_input_data().function_status