mridgers / clink

Bash's powerful command line editing in cmd.exe
mridgers.github.io/clink
GNU General Public License v3.0
3.15k stars 286 forks source link

Incorrect operation when scrolling through commands with vertical arrows #554

Open gskoczylas opened 3 years ago

gskoczylas commented 3 years ago

I'm using clink within cmder. I think the problem is in the clink.

To illustrate the problem, let's assume that I executed the following commands in sequence:

  1. dir
  2. pushd c:\temp
  3. cd ..\Tools\
  4. dir /w
  5. popd

Now I want to execute one of the previous commands again. To do this, I press the up arrow key (on the keyboard).

This additional letter at the beginning is only virtual. For example, if I see a ddir and execute this command, then I will execute the dir command - as if this additional letter was not there at the beginning.

You can live with it, but it's annoying and it interferes with your working comfort.

At first I did not have such problems. It happened at some point. I did not change any settings in the program. I didn't notice anything special that could change this behavior.

Environment: Windows 10 Enterprise ver. 1909

chrisant996 commented 3 years ago

It's because of a combination of things. There are many posts about it in the Cmder issues list with more information, including how to change the lambda character.

  1. The lambda character that's part of the prompt is represented as different widths in different fonts.
  2. Cmder is using a different font than the OS expects to be used, and the two fonts have different widths for the lambda.
  3. Since this was posted, Clink from chrisant996/clink introduced a change that should compensate for the mismatched font problem, and at least make characters show up in the right spots, although sometimes there will be extra spaces between characters or a line might not fit as many characters as it looks like should fit.
gskoczylas commented 3 years ago

In the latest version of Cmder the problem does not occur for me anymore (Windows 10 Pro PL & Windows 10 Ent EN).

chrisant996 commented 3 years ago

In the latest version of Cmder the problem does not occur for me anymore (Windows 10 Pro PL & Windows 10 Ent EN).

Yup. Cmder switch to including Clink from chrisant996/clink a few months ago. 👍