-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Weird input cursor positioning problem #2628
Comments
|
Also, does running |
Also, you can test whether the problem happens in plain CMD:
Does the problem still occur? (If you don't have a %cmder_root% environment variable defined, then you will need to substitute it with the path to your Cmder installation.) I am unable to reproduce the reported problem. I'm using Clink v1.2.48 on Windows 10 21H1 in US English, with the font Fira Code NF. I've tried changing many different settings related to terminal behavior and ANSI codes. I can't make the problem happen. |
First, thank you @chrisant996 for the quick response for this issue, this problem has bothered me for a couple of while. I have tried those step you have mentioned, the answers or responses should all at down below:
|
And by noticing your windows version is not same as mine, I have update the version to 21H2, but sadly the problem is still occuring. Appending Informations after trying:ConEmu Version: 210912 stable |
The code page can be checked by running I searched in the ConEmu repo issues page for "wrap" and for "same line". There are several reports of similar things, but the situations sounds a bit different. The first thing to do is check the Real Console by pressing Win+Ctrl+Alt+Space and then try to reproduce the problem. Does the Real Console window show the same problem, or does the problem only appear in the ConEmu window? |
I have tried the real console, and yes, the problem will also show on the smaller real console window. |
Interesting. Let's see if Clink can help diagnose what's happening:
Then run Or if you prefer, you can email the file privately to the email address in my GitHub profile. The extra logging will make it possible to see the exact output of both the prompt and the input text. One of the most common reasons listed for this kind of problem is apparently incorrect escape sequences in the prompt string. The logging will make it possible to see the exact characters being output. |
Here's the log file, feel free to share to other developers. The content is kinda long so I'll just put a download link here, if there are any problem while downloading, please tell me. |
For some additional information of this situation, I have asked some friend to help me test out if there will have same problem on their pc, and the result turns out to be yes. Like I said, the problem has been existed for a long long time, so plenty of my friends just gave up waiting and go to use powershell or wsl instead. |
Perfect, thank you! The log shows what happened. First Problem: At column 0 of line 6, it prints two characters: the lambda Question 1: Does the smaller Real Console window use three columns to display the two characters? I expect it does. Second Problem: When the "A" inputs reach column 118, then Readline prints a space and a carriage return. This is the same as what it does on my computer where there is no problem. But what is different is that on my computer the space character is printed at column 0 of line 7 -- and on your computer the space is printed at column 118 of line 6. This is probably happening because the lambda character is a different width in the ConEmu window's font vs in the Real Console window's font. That kind of discrepancy throws off the arithmetic for figuring out columns and lines, and then Readline and ConEmu and the Real Console window get out of sync with each other. Question 2: Can you please share a screen shot of the Fonts page in the ConEmu Settings window? Question 3: What code page number is reported when you run the Question 4: What is the font used in the Real Console window? Press Win+Alt+Ctrl+Space to show the Real Console window, and then right click on its title bar and choose Properties, then find the font it's using. I will use the answers to try to reproduce the issue on my computer. |
Also:
Here is a script you could copy into the replace_lambda.lua-- Change this to whatever you want to replace the lambda with:
local replace_with = ">"
local p = clink.promptfilter(99)
function p:filter(prompt)
local escaped = replace_with:gsub("%%", "%%%%") or replace_with
prompt = prompt:gsub("m\xce\xbb ", "m"..escaped.." ")
return prompt
end |
Or download the unreleased build that allows configuring the prompt and
lamba char.
|
And here is the answers of questions above: Next. here are the solutions I have tried after last post:
Sorry about I can't try the solution mentioned by @daxgames cause I don't really know how to build your project to a executable .exe file from the newest state. At last, thank you for all developers who try to solve this problem, this problem really bother me for a long time, this could be a big rescue to me, so big thank to you guys!! |
And I am still here, if you still cannot reproduce the bug and need more support, feel free to tag me anytime! |
@kingdom84521 no need to build ut yourself. https://ci.appveyor.com/project/MartiUK/cmder/build/artifacts |
@kingdom84521 You can change the size of the real console's font in its Properties dialog. Here is what I see when using code page 950 on my computer: Indeed the real console shows 3 cells used for the 2 characters, but the ConEmu window shows only 2 cells used. But on my computer the ConEmu window still successfully knows that the widths were different, and it still wraps the cursor after the right number of characters as though it had used 3 cells. The problem about wrapping onto the same line seems like a ConEmu problem. There is unfortunately ambiguity about the "proper" width of a range of characters in Unicode, and various CJK code pages behave differently than other code pages. I think that my US-EN installation of Windows may have different fonts for code page 950 than your ZH-TW installation does. I don't know how to force my computer to behave like yours, without installing Chinese Windows (which I don't want to do 🙃).
I have a "MingLiU_HKSCS-ExtB" font and a "MingLiU-ExtB" font installed (because I installed a Chinese language pack), but it won't let me use either of them in the Real Console window.
At this point, we have gathered enough information to know that the issue is between ConEmu and Windows. The upcoming version of Cmder has a built-in way to change the lambda character, because of exactly this problem between ConEmu and Windows. The strange part is that for some reason, on your computer the width issue causes text to wrap onto the same line. That isn't what most reports about the font mismatch issues have stated, so it wasn't possible at first to recognize that you're encountering a known issue, and that the next Cmder already has a workaround.
This is not a Cmder issue, nor a Clink issue. It is a ConEmu issue. Your best option for being able to someday use the lambda character in the prompt, is if you report the issue in the ConEmu repo, and try to work with Maximus for how to be able to reproduce the problem. |
Got it! I thought this is a Cmder issue after all these try, sorry about I don't know how all these output thing are really worked down below the application, so since this is a ConEmu issue, I will then close it and try to contact to ConEmu's developers, but still I want to say thank you to you guys. (Maybe I will re-open the issue someday later, to mention the issue is solved on ConEmu) |
Also, the ConEmu site has some articles about troubleshooting and configuring Unicode and code page issues. For example: https://conemu.github.io/en/UnicodeSupport.html#font-charset Maybe using 65001 code page (UTF8) may help. |
This appears to be the same problem as Maximus5/ConEmu#2404. |
Using 65001 code page doesn't help!!! |
@bitdream Specifically what are you seeing? Share a screen shot. Lambda issues should have been solved quite a while ago, so I wonder if you're using an old version of Clink. |
When I type 12345 and then backspace, it deletes from 4 rather than 5. The cursor position looks messed. |
@bitdream If you want to use the default lambda prompt character, then you could revert the prompt_lambSymbol change, and try the following instead:
(You haven't shared a screen shot yet, but I'm guessing you need Also, if you press Ctrl-x, Ctrl-z, then Clink will print some information about itself (including the version), and near the end will be a section something like this:
Can you press Ctrl-x, Ctrl-z and then copy/paste the "ambiguous width characters in prompt" section into a reply here? Depending on what system font your computer is using, the system font width for "λ" might be different than the font that the ConEmu terminal is actually using. That's why you might need to manually tell Clink |
OK, here is the output. Neither clink set terminal.east_asian_ambiguous two nor one seems having any effect on my side. (Use a numeric argument for additional diagnostics; e.g. press Alt+1 first.) |
Oh! You're using a very old version of Clink. How did that happen? You said you downloaded Cmder on 2023/12/31, but then I'd expect you to have Cmder v1.3.24 which comes with Clink v1.5.1. Maybe there was some confusion about when it was downloaded, or maybe it was downloaded from somewhere that had an old version. East Asian Ambiguous Width Character support should be working in v1.4.12 and higher. You can probably update Clink simply by typing |
The date of the unzipped files are of 2022/12/19. That's possible since this is the time I started to use this laptop. |
Ah, it was a typo in the cited date. Mystery solved. 🙂 It's a good idea to check for updates when there are problems. That can sometimes save a lot of time and pain. |
Yes...but I remembered at some earlier time I tried update once but without luck.🤦♂️ |
@bitdream I strongly suggest downloading the latest version of cmder_mini and extracting it over your (very old) installation. In addition to chris' amazing work to support |
Purpose of the issue
Bug report
Version Information
ConEmu Version: 210912 stable
Cmder Version: 1.3.18.1106
Windows Version: Windows Enterprise 20H2
Description of the issue
Step to reproduce the error:
More Description:
This error has been occured for a long long time, a least over one year. I expected it will be fixed someday in the newer version of cmder or ConEmu, but it did not. Although this looks pretty like a ConEmu error for me, but I still want to check if it really is. If there can be some developers confirm the error is a pure ConEmu error, then I will close the issue and go to ConEmu's repo and try to find more help there.
The text was updated successfully, but these errors were encountered: