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

[Bug] wired color blocks when running a CLI program based on Python and prompt_toolkit in cmder #2924

Open
kkhaveabigdream opened this issue Mar 4, 2024 · 6 comments

Comments

@kkhaveabigdream
Copy link

kkhaveabigdream commented Mar 4, 2024

Version Information

Cmder version: 1.3.21
Operating system: win11

Description of the issue

When running a Python CLI program based on prompt_toolkit in cmder, there are strange color blocks in the UI. It appears to be a problem with Chinese character parsing, as lines containing Chinese characters render with color blocks exceeding their expected length. However, this issue does not occur in PowerShell
looks fine in powershell:
1
wired in cmder:
2

@chrisant996
Copy link
Contributor

The difference is Windows Terminal vs ConEmu.

Powershell isn't related to this.

@chrisant996
Copy link
Contributor

Also, probably if you run chcp 65001 that might resolve the issue.

Code page 936 has a collection of characters that it defines as "ambiguous width". Some things treat them as 1 cell wide, and some things treat them as 2 cells wide. Setting the terminal to use code page to UTF8 (by running chcp 65001) gets out of that mode, and then the character widths are unambiguous.

@kkhaveabigdream
Copy link
Author

I have set the environment like this,but noting changes
3

@kkhaveabigdream
Copy link
Author

tried run chcp 65001, doesn't resolve this issue :(

@chrisant996
Copy link
Contributor

You might be able to try a different Chinese font in ConEmu, or a different font size. It looks like the Chinese font is different than in Windows Terminal, or at least a slightly different size.

But this isn't a Cmder issue, it's a ConEmu issue. Try going to the ConEmu repo and searching issues there, or opening an issue there.

@kkhaveabigdream
Copy link
Author

thanks a lot! It does give me a direction.

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

No branches or pull requests

2 participants