Closed niaodan2b closed 1 year ago
Duplicate of #2774.
This is not a Clink bug, nor a Cmder bug, nor a ConEmu bug.
CJK defines a range of characters ambiguously, and it includes the lambda λ
character -- for monospace fonts they can be 1 cell width, or 2 cells wide. Depending on the combination of font, version of the OS, Active Code Page, and terminal program being used, the lambda character may display with a width different than expected, which breaks the input line display.
The simplest solution is to run chcp 65001
to make cmd.exe use UTF8.
Thanks for the info !
I don't know where to run this chcp 65001
, I just edited config/cmder_prompt_config.lua to change the λ for $, and problem solved.
Clink v1.4.8 looks like it may have solved the width problems with the lambda character in the prompt.
Well, maybe not entirely -- the input line no longer gets garbled, but also there is no longer a space after the lambda. There's nothing Clink can do about that, though.
I change the startup task from {cmd:Cmder} to {bash:bash} or other shell, would not show this problem
I change the startup task from {cmd:Cmder} to {bash:bash} or other shell, would not show this problem
If a shell shows a lambda (λ
) in the prompt, then the shell will have some variation of this problem, unless you change the codepage to UTF-8. It is because of a mismatch in the OS when using codepage 932, 936, 949, or 950. Different shells will encounter problems after different actions, but all of them will experience the problem under some conditions.
Here are two ways you can solve the problem:
chcp 65001
. Refer to the Startup Environment settings page documentation for more info on configuring ConEmu.
Version Information
Cmder Edition
Cmder Mini
Description of the issue
After pressing backspace or left arrow, the cursor position is 1 space left to its correct position, as the screenshot shows. All settings are default. I've tested ConEmu, doesn't have this problem.
How to reproduce
No response
Additional context
No response
Checklist