microsoft / inshellisense

IDE style command line auto complete
MIT License
8.21k stars 179 forks source link

When render a dropdown box on Chinese characters, wide characters, the cursor moves the wrong step #175

Open PaulXu-cn opened 4 months ago

PaulXu-cn commented 4 months ago

Describe the bug Characters such as Chinese, Japanese, and Korean occupy two characters in the terminal, and English characters and numbers occupy one character.

When moving the cursor to render the box, the number of steps counted as a single character will cause the characters to be confused.

To Reproduce Steps to reproduce the behavior:

  1. Go into inshellisense runtime.
  2. Go to a git repo dir
  3. Exec LANG=zh_CN git status
  4. Repeat the previous command until the prompt reaches the last line of your screen
  5. Now trigger suggestion box. try type git

Expected behavior Render the suggestion box correctly.

Environment

Additional context shell_box_err