arimelody / OpenTerminal

an online terminal and communal text buffer :)
https://term.arimelody.me
GNU General Public License v3.0
11 stars 1 forks source link

Backspace breaks emojis #4

Open username24532 opened 1 year ago

username24532 commented 1 year ago

image

Using backspace on emojis like 🤩 causes them to become an unknown Unicode character, in this case � instead of deleting them. Might be because you're working with bytes instead of graphemes?

arimelody commented 1 year ago

i do believe this is an issue to do with the buffer being a simple javascript string at present. i'm not 100% sure what the solution to this would be, beyond detecting emoji unicode pairs in the backspace process and sending two keystrokes, but feel free to experiment with this and send a PR if you have some success!