magmax / python-inquirer

A collection of common interactive command line user interfaces, based on Inquirer.js (https://github.com/SBoudrias/Inquirer.js/)
MIT License
992 stars 98 forks source link

Unable to input full-width characters #432

Closed Pandaft closed 2 weeks ago

Pandaft commented 1 year ago

Environment:

Code:

import inquirer

answers = inquirer.prompt([
    inquirer.Text('msg',
                  message="message"),
])

Reproduce:

When I try to type Chinese:

1

It turned out:

2

This problem also occurs with other full-width characters, such as Korean and Japanese.

Cube707 commented 1 year ago

This stems from the libary function readchar using only the msvcrt.getch() function, which only returns single bytes (Its old, from a time where ascii was the only characterset).

There are plans to fix that in an upcoming version, but there's no timeframe on when I will come around to it.

Cube707 commented 1 year ago

Relevant: https://github.com/magmax/python-readchar/issues/93

Cube707 commented 2 weeks ago

closed by #622