cmderdev / cmder

Lovely console emulator package for Windows
https://cmder.app
MIT License
25.81k stars 2.02k forks source link

[Bug] Cursor Bug in Bash with 位 in prompt (CJK) #2824

Closed lawweiliang closed 1 year ago

lawweiliang commented 1 year ago

Version Information

Cmder version: Version 1.3.18.1106
Operating system:
Window 10

Cmder Edition

Cmder Full (with Git)

Description of the issue

The command that I type was automatically changed by cmder.

Before that, image

After that, press "up key" over keyboard image

How to reproduce

No response

Additional context

No response

Checklist

chrisant996 commented 1 year ago

Read other recent issues. There are many about this.

If you run clink update it should get some changes that compensate for CJK ambiguous width characters. This is a CJK problem, which happens depending on the combination of font and code page and terminal program and characters in the prompt.

It should make the problem go away. But after updating Clink and restarting Cmder, if it still occurs, then press Ctrl-X Ctrl-Z and read the diagnostic report and further steps it suggests.

lawweiliang commented 1 year ago

Thanks for your reply @chrisant996 . I didn't use clink for my usecase.

I am using bash in cmder using this method. https://gist.github.com/nickautomatic/02ccb76292f7f8d9767e

chrisant996 commented 1 year ago

Thanks for your reply @chrisant996 . I did't use clink for my usecase.

I am using bash in cmder using this method. https://gist.github.com/nickautomatic/02ccb76292f7f8d9767e

Oh. 馃槥 Sorry, then you can either run chcp 65001 to use UTF8 and disable CJK code pages, or change the prompt character to an ASCII character instead of the lambda. There are some other issues with directions on how to do that.

daxgames commented 1 year ago

@lawweiliang Not sure why you would want to run bash this way since it is supported natively with the Cmder - Full you say you are using. You could simply make the Cmder included task {bash::bash} your default task as shown below:

image

Also I do not believe you are using the config you think you are using because you would not have the in the prompt if you were.

Running bash according to the link provided is not using Cmder configuration at all. It is simply using ConEmu and external component distributed as a part of Cmder to run your external install of Git Bash. I am running the config detailed here below:

image

Notice the difference between mine, $ instead of , where yours has the :

image

lawweiliang commented 1 year ago

@daxgames , oh man. This literally solved my problem. Thanks bro.

daxgames commented 1 year ago

@lawweiliang glad to help!