d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
669 stars 47 forks source link

Can't paste the char `ă` in entry box #164

Closed ta2013 closed 10 months ago

ta2013 commented 10 months ago

Can't input/paste the char ă into the entry box.

Thanks.

d99kris commented 10 months ago

If you run nchat in key dump mode, nchat -k, and paste the character (ex: ă) you can see what it maps to on your system. On my Mac it is \403 KEY_UP.

Assuming that's the case on your system, you can run nchat -k and find some other key you'd like to use for "up", and then replace KEY_UP with that key in ~/.nchat/key.conf (or if you don't use KEY_UP you could just remove it, but then you cannot access all functionality, so..).

It's a little strange though, that ă has same key code as KEY_UP. Can I check what's your output if you run locale in the terminal?

d99kris commented 10 months ago

Doing a little more research on this, it seems there is a way for an application using ncurses to differentiate between ă and KEY_UP. I will look into how to fix this in nchat. Will update here again once I've found a solution.

ta2013 commented 10 months ago

If you run nchat in key dump mode, nchat -k, and paste the character (ex: ă) you can see what it maps to on your system. On my Mac it is \403 KEY_UP.

Assuming that's the case on your system, you can run nchat -k and find some other key you'd like to use for "up", and then replace KEY_UP with that key in ~/.nchat/key.conf (or if you don't use KEY_UP you could just remove it, but then you cannot access all functionality, so..).

It's a little strange though, that ă has same key code as KEY_UP. Can I check what's your output if you run locale in the terminal?

Hi there, the output is: nchat -k: \403 KEY_UP

$ locale:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=vi_VN
LC_TIME=vi_VN
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=vi_VN
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=vi_VN
LC_NAME=vi_VN
LC_ADDRESS=vi_VN
LC_TELEPHONE=vi_VN
LC_MEASUREMENT=vi_VN
LC_IDENTIFICATION=vi_VN
LC_ALL=
ta2013 commented 10 months ago

its this char: https://www.ascii-code.com/character/%C4%83

other chars:

https://en.wikipedia.org/wiki/VSCII

https://opensource.apple.com/source/X11libs/X11libs-17.6/libX11/libX11-1.1.5/src/xlibi18n/lcUniConv/tcvn.h.auto.html

d99kris commented 10 months ago

Thanks for sharing additional details. I believe I have found what is the problem. I will be preparing a fix for this, will update here again once generally available (likely in the weekend).

d99kris commented 10 months ago

Pasting of ă should be fixed in above commit. Thanks for reporting this issue!