Environment: Windows 11 -> Windows Terminal -> WSL or PowerShell
When imlpement my own EditMode, I stumbled upon an issue: some key events are reported incorrectly.
Basically, I convert the event using ReedlineRawEvent::into() which gives me a crossterm::event::Event value.
If I press Ctrl + Backspace for instance, it will be reported as the w key pressed with the CONTROL modifier.
I tried to debug a little bit by modifying reedline's code and it seems like the event reedline gets from crossterm using crossterm::event::read() already contains the error, it is not caused by a faulty event conversion.
When running the event_listener example in this crate with cargo run --example event_listener, I get the correct code reported.
I tried putting a terminal::enable_raw_mode() just before the event reading, but it did not work. Maybe it needs to be set as soon as the program begins? But would that cause other troubles? I don't enough about terminals to answer this.
But this is a big problem as it makes handling some key combinations impossible. Also pressing Ctrl + Backspace and Ctrl +w return the exact same event, so it's not even possible to work around this problem using a little "hack" hashmap mapping the correct codes.
Environment: Windows 11 -> Windows Terminal -> WSL or PowerShell
When imlpement my own
EditMode
, I stumbled upon an issue: some key events are reported incorrectly.Basically, I convert the event using
ReedlineRawEvent::into()
which gives me acrossterm::event::Event
value.If I press
Ctrl + Backspace
for instance, it will be reported as thew
key pressed with theCONTROL
modifier.I tried to debug a little bit by modifying reedline's code and it seems like the event reedline gets from crossterm using
crossterm::event::read()
already contains the error, it is not caused by a faulty event conversion.When running the
event_listener
example in this crate withcargo run --example event_listener
, I get the correct code reported.I tried putting a
terminal::enable_raw_mode()
just before the event reading, but it did not work. Maybe it needs to be set as soon as the program begins? But would that cause other troubles? I don't enough about terminals to answer this.But this is a big problem as it makes handling some key combinations impossible. Also pressing
Ctrl + Backspace
andCtrl +w
return the exact same event, so it's not even possible to work around this problem using a little "hack" hashmap mapping the correct codes.