jrnxf / thokr

✨ sleek typing tui with visualized results and historical logging
MIT License
528 stars 18 forks source link

Kernel panics when encountering unicode characters in custom prompt. #19

Open joelle-o-world opened 1 year ago

joelle-o-world commented 1 year ago

Description

From looking at the readme it seems like supporting an extended character set is beyond the current scope of this project at the moment. So I feel a bit cheeky making this request. I would love it to work because I'm trying to use thokr as part of practice learning languages.

The program halts when it encounters an extended character (when the user is expected to type that character, before they have done so).

To Reproduce

Enter this command:

thokr -p "ich heiße Thokr"

and type ich hei

Expected behavior

The kernel panics with the following output:


                                                                               ich heithread 'main' panicked at 'byte index 8 is not a char boundary; it is inside 'ß' (bytes 7..9) of `ich heiße Thokr`', /Users/joelle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thokr-0.4.1/src/ui.rs:92:21
                                                                                                                             note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
                              ⏎                      

Screenshots

Screenshot 2023-07-13 at 13 42 20

Environment

Additional context