charmbracelet / bubbles

TUI components for Bubble Tea 🫧
MIT License
5.56k stars 264 forks source link

Extended Latin characters not supported in textinput on Windows #460

Closed StephGD closed 9 months ago

StephGD commented 9 months ago

Hello, First of all, thanks for this amazing libraries. In the textinput and the textarea bubble, the latin accentuated characters (ex. éàêâö) aren't supported. This keys are bypassed. It's a little bit annoying if you working with some language (like french :-). This issue (or non-feature) is also in "gum" and "huh". Is there a solution for working with this characters ? Thanks for your time, have a good day (or night :-)

meowgorithm commented 9 months ago

Hi there! This shouldn't be the case; we have tested this library with diacritics and extended Latin fairly extensively.

What terminal emulator, operating system, and window manager are you using?

StephGD commented 9 months ago

I tried some possibilities. I'm on windows 10. This won't work correctly on the official terminal emulator with powershell config and cmd config. Same with VS Code's terminal, Wezterm, the powershell original console (without emulator) and the cmd console. Buuuut... (drum roll) ...it work perfectly fine on debian with the linux subsystem. All the output works, but I have the same issue with all the input (also with the filter in the list).

meowgorithm commented 9 months ago

Okay, so perhaps it's a Windows issue. The majority of our testing on Windows has been around IME (Chinese, Japanese, Korean) whereas we've spent more time with Latin diacritics on Linux and macOS.

While unlikely, this could also be related to physical keyboards sending diacritics on Windows. Am I correct to assume you're using a proper AZERTY keyboard to enter characters like é, è, and à?

Additionally, what gets inputted when you send a ç?

Finally, what's your locale (i.e. fr_FR.UTF-8)?

StephGD commented 9 months ago

It's exact, I use a AZERTY keyboard and the layout is fr_FR. When I try with the "ç" (and the "ù"), nothing's happening. With the euro symbol (altGr+e) it's different, it replaced by the "?". Finally I tried to pass à diacritic as KeyMsg. Same result, nothing's happening when I press the specified key. I don't know if it helps, but the other characters on the same keys (accessible with Shift and altGr) works fine.

meowgorithm commented 9 months ago

Hi! We have another report of this over at https://github.com/charmbracelet/bubbletea/issues/907 which is probably a better place for this issue. I'm going to close this one; let’s continue the conversation there.

StephGD commented 9 months ago

Hi! This is indeed a better place.

meowgorithm commented 9 months ago

Good news! @aymanbagabas’s mystical PR https://github.com/charmbracelet/bubbletea/pull/878 will fix this issue. We'll update here when we merge.

StephGD commented 9 months ago

Amazing ! Thanks for your efforts.

meowgorithm commented 8 months ago

This is now fixed in Bubble Tea on master and will be available in the next Bubble Tea release.

StephGD commented 8 months ago

Hi! Thanks a lot for this enhancement and for your work.

StephGD commented 8 months ago

I finally tried with the master branch and it works perfectly under Windows (cmd, Powershell, Wezterm and Windows terminal emulator). I also saw that now the resize signal also works "out of the box" in Windows. Thank you again for this improvement and for all your works.