Cmder: Character persistence on cmder windows

Created on 26 May 2015  路  32Comments  路  Source: cmderdev/cmder

Character persistence occurs when residual character of a previous command remains visible on the screen.
When press up-arrow key to view the last command, "mplayer" for example, the Command Window display is ok. See Fig1.
cmder1

Subsequently press down-arrow key to change command history, some character remains visible on the CMDER windows.See Fig2.
cmder2

It is very annoying. How to resolve the problem? Thanks.
It should be noted that the number of a command is less than or equal to 4,the phenomenon would not occur again.
Fig3 is font setting.
font setting

馃憜 clink Requires Testing

Most helpful comment

same problem, replace all, just two lambda "位" in file \cmder\vendor\clink.lua with "$", solved.

if env == nil then
    lambda = "$"
else
    lambda = "("..env..") $"
end

All 32 comments

me too

me too

This error is not replicable for me

Same here, struggling for at least 6 months, after windows 10 upgrade.
To reproduce this bug:

  1. Type some long commands (>5 length of characters)
  2. Ctrl-C
  3. Arrow-Up
  4. Arrow-Down
    There's should be a first character of last command stay on screen.
    I'm on latest version of cmder. Change the codepage to utf-8 wont help.
    This bug is only happening on CMD. Under bash shell everything is fine.

Having the same problem here in Windows 10

I have searched around again of any solution for this bug, and it's turned out that changing the {lambda} to proper ascii character will help (under cmder/config/cmder.lua). Check again #553.

I can't reproduce this on my 1.3.0-pre can more people try it please.

I'm still getting this error in the latest version.

Have this error on latest version 161206 ... My system locale is Chinese (Simplified). Changing the lambda character in clink.lua file to an ascii one (like '>') worked and the error disappeared. When I changed my system locale back to English (US) (I'm based in China so I had it set to GBK Simplified Chinese), the lambda non-ascii works.

Same issue here

It looks like the character '位' have different character width based on code page

For example:
01

same problem, replace all, just two lambda "位" in file \cmder\vendor\clink.lua with "$", solved.

if env == nil then
    lambda = "$"
else
    lambda = "("..env..") $"
end

The new location seems to be \cmder\config\cmder.lua (ConEmu v161206)

function lambda_prompt_filter()
    clink.prompt.value = string.gsub(clink.prompt.value, "{lamb}", "$")
end

Same issue, locale is Chinese simplified.

I am using the latest version of cmder (version 1.3.8). It seems that this old issue still persists. The clink.lua file have changed. Find the line

    local lambda = "位"

and replace it with

    local lambda = "$"

Restart cmder and the problem should disappear.

@jdhao
the replace method was for version 1.3.4 older, like screenshot
image
I tried cmd ver 1.3.8 and ComEmu ver 180626[64] just now, have not encontered this bug again.
and no more running the environment:
set LANG=zh_CN.UTF8

Still not working after updated 1.3.8

@hulucc I tried ver1.3.8 as new installation, yes, the bug still there, my solution:
changing the "位" with "$" at line 43.
image

You guys keep calling this a bug but I can't reproduce it. If we can't reproduce it and you keep masking it by just changing it to $ it will never get fixed as you guys seem to want based on the recent comments.

If someone can find a root cause and tell us how to reproduce it might be looked at but until that happens no one on the Cmder team is trying to 'fix' it.

If you do want to just mask it there are better ways than changing the clink.lua because this file is overwritten on upgrade.

@daxgames ha~ those bugs often met with Non-English Windows by chcp and UTF and font ... so many mixed mistakes, like:
https://github.com/cmderdev/cmder/issues/1339
https://github.com/cmderdev/cmder/issues/764
https://github.com/cmderdev/cmder/issues/1171

and "lambda" is not a normal ascii code, and most bugs from M$ Windows, not within capabilities of cmder.... so cmder run like a patch bbs of M$

@daxgames it's very easy to reproduce. Change the system locale of your system to something like Chinese Simplified. Then open cmder and write a bunch of commands. Then try to use the 'up' key to view previous commands. That should reproduce the issue. It's probably something to do with the byte size of the lambda character in different encodings.

@daxgames , I will try to elaborate my possibly-related settings for you to reproduce this bug.

I am using Windows 10 Pro, Version 1803 and OS build 17134.345. My region is set as China and my language is set English (United States).

I am using Cmder version 1.3.8 with ConEmu 180626. My settings for Startup -> Environment is

set PATH=%ConEmuBaseDir%\Scripts;%PATH%
set LANG=en_US.utf8
chcp utf-8
set TERM=xterm-256color

Please let me know if you need any further info.

@jdhao @daxgames , I did not set certain chcp or utf in cmder settings, with win10 enterprise 1803, and with font and charset:

image

image

run chcp:
image

and I DID NOT change the lua file, Chinese and lambda is all right with cmder ver1.3.8.

@Justsoos , You have to type long command (some say the command length must be longer than four ) to actually trigger this bug. Have you tried long commands?

53

@justsoos are you using the up arrow to cycle through history as others have mentioned? And then backspacing to the beginning of the line?

@daxgames it is a complex story.... before update to 1.3.8, I run an 1.3.4 probably, have to set LANG=zh_CN.UTF8 and chage the lambda to $ and several things else to avoid Chinese charactor errors, but this time, I delete the old cmder and extract 1.3.8 to the default install directory, have not to change them that mentioned, all works well.

An update on this issue, since I'm having it as well...
I think it's absolutely a rendering issue... since you cannot have arbitrary characters as the "lambda". For example - the default is and if you replace it with 饾澓 (which is a different lambda) - the prompt is completely screwed up

image

For reference, I got that lambda from https://en.wikipedia.org/wiki/Lambda, and it is the U+1D77A lambda. I have UTF support enabled in windows.Only the first two lambda's work from that page. (and they screw up with command history navigation)

I'm facing the same issue with v1.3.14

The only solution, sadly, is to change the character. ~ is what I use, and works without issues.

@daxgames It is year 2020. Sadly, this issue still persists. If this issue is hard to fix, why not just change the default prompt character from lambda to something purely ASCII, for example, > or $ or whatever?
I am curious to know what is the rationale to still use this lambda character.

@jdhao it's not up to me. This is not my project I just help maintain it. Changing the prompt is user configurable by adding lua code to the config folder. You can change it to whatever you want one time and you will never have to change it again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emesx picture emesx  路  3Comments

edgariscoding picture edgariscoding  路  3Comments

danwellman picture danwellman  路  3Comments

isnullxbh picture isnullxbh  路  3Comments

tfarina picture tfarina  路  3Comments