Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input characters may be garbled when running the installation interactively. #70

Open
ta-Hirose opened this issue Sep 16, 2022 · 1 comment

Comments

@ta-Hirose
Copy link
Contributor

When running the installation interactively, the following input has been confirmed to be garbled

  • 鶴ヶ島ー>鶴ヶ��
  • アイウエオー>アイ��エオ

If only garbled characters are entered, no garbling occurs.

@ta-Hirose
Copy link
Contributor Author

ta-Hirose commented Sep 29, 2022

The cause may be the process of reading from Cliffy's standard output.

The buffer size for reading a character is 8 bytes, and when reading a character that exceeds this size, it seems that the character is split in the middle of one character.

https://github.com/c4spar/deno-cliffy/blob/cd8d73cc7407e6126976f567060b8715fa2a0a7b/prompt/_generic_prompt.ts#L294-L305

const buffer = new Uint8Array(8);
~~~~
const nread: number | null = await Deno.stdin.read(buffer);

Proposals:

As a countermeasure, we propose to clone Deno-cliffy and use its modified version.

We have the following two suggestions for modification.

  1. Keep buffer size large enough.

There is no standard for how much increase is sufficient, so this is only a palliative measure

  1. Modify code to work even when split in the middle of a character.

The conversion process to keycode using parse implemented in keycode/key_code.ts of deno-cliffy exists in between. The degree of difficulty of modification is considered to be quite high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant