Sorry for my poor English, this is not my first language.
I have a Python3 file whose contents are simply
print(input(">"))
When I run it on zsh or bash and write a handle and use my backspace key, an unexpected behavior occurs.
If I press ใด three times, go back three times, I will leave this:
>ใด
No matter how many times I press backspace, "ใ
" will not be deleted. Similarly, if I initially write "๋"
>๋
and then erase it, there are fatal spaces, and any other characters that I print afterwards look like
> ๊ฐ๋๋ค
This seems to be just a visual problem, as if I had to type โใด ใดใดใดใดโ and press backspace until no changes are shown, I would stay with
>ใดใด
Next I typed "๋" and hit enter.
>ใดใด ๋
will result in
๋
print only.
The ultimate weirdness in this is that it only occurs when the input () method is run from a python file. If I had done all this through an interactive shell, nothing unusual would have happened.
This happens on my El Capitan-based MBP, and it seems to be a problem with all CJK keyboards, I did a little testing with the Chinese and Japanese keyboards, and it showed a similar behavior.
Can someone tell me why this is happening and how can I prevent it?