cursive
cursive copied to clipboard
[BUG] Blt backend could not resolve "ctrl-f" in the text_area example.
Describe the bug Blt backend could not resolve "ctrl-f" in the text_area example.
To Reproduce
cursive\examples> cargo run --features cursive/blt-backend --no-default-features --bin text_area
and press ctrl-f in the textarea
Expected behavior The search dialog should op up.
Environment
- Operating system used Windows 10
- Backend used: ncurses (the default one), pancurses, crossterm, ... blt
Temporarily I solved it this way
Index: cursive/src/backends/blt.rs
===================================================================
diff --git a/cursive/src/backends/blt.rs b/cursive/src/backends/blt.rs
--- a/cursive/src/backends/blt.rs (revision 8e252e176bb7b9b4bb1a37b3cdb957d5b92af490)
+++ b/cursive/src/backends/blt.rs (date 1613718816371)
@@ -374,7 +374,11 @@
}
fn blt_keycode_to_char(kc: KeyCode, shift: bool) -> char {
- match bear_lib_terminal::terminal::state::char() {
+ let c = bear_lib_terminal::terminal::state::char();
+ if (c as usize) < 32 /*code for space*/ {
+ return blt_keycode_to_char_impl(kc, shift);
+ }
+ match c {
'\u{0}' => blt_keycode_to_char_impl(kc, shift),
c => c,
}
Hi, and thanks for the report!
I just tested on linux and ctrl+F is working fine as-is. Could it be a difference between the linux and windows implementation of BLT? :S