cmderdev / cmder

Lovely console emulator package for Windows

Home Page:https://cmder.app

Repository from Github https://github.comcmderdev/cmderRepository from Github https://github.comcmderdev/cmder

[Bug] Cropped off rendering of 'd' in commands 'cd' and 'md' at the beginning of a line

mayankxor opened this issue · comments

Version Information

Cmder version:1.3.25.328
Operating system:Windows 10 Pro 64-bit

Cmder Edition

Cmder Full (with Git)

Description of the issue

I am using Fira Code Retina font with bold and italic mode turned on. When I go to type 'cd' or 'md', the 'd' gets cutoff midway making it look like an 'a' or 'o'. It might be an issue with the font itself but cmder has no problem rendering the 'd' afterwards. I've been able to replicate this issue with only these 2 commands. Note that non-italicized 'd' renders without flaw.

Image
As the image shows, the 'd' at second positions doesn't look like a 'd' but all others do. The commands I used are:
cd cd
md md

How to reproduce

  1. In normal environment, I guess, I didn't really do anything except tweaking settings.
  2. With config file as :
    config.txt Convert to XML please.
  3. Run cd cd
  4. See error: The first 'd' doesn't look correct while the second does

Additional context

imageNon italicized font has no issue

ImageBug shows up for Fira Code Medium as well but the upper part of 'd' is a little more visible than Retina variant

Image

Image

Image
Bug persists for every single variant

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.

Image
Also shown here is that other commands work well, cd and md are somehow tweaking

That happens because of how ConEmu does rendering when different letters have different colors.

ConEmu uses a simplistic algorithm for rendering, and it doesn't work well for italics. Its algorithm is roughly: Each time the background or foreground color changes, that splits the line into sub-rectangles. Each sub-rectangle is painted from left to right, and paints both the background color and text color at the same time. If the last character in a rectangle is italicized, then its top actually extends into the next rectangle. So when the next rectangle's background is painted, that erases the part of the previous rectangle's text that extended outside the previous rectangle.

Windows Terminal, for example, uses a more complicated algorithm that solves that problem. Its algorithm is roughly: It uses two passes. The first pass calculates and draw the background colors for all character cells in the line. The second pass overlays colored text onto the already-painted background colors. (But if the background color changes in places in a line of text, then you can still clearly see that the top of an italicized letter extends beyond its rectangle and into the rectangle of the next character, and that leads to some unavoidable coloring quirks.)

Your options are:

  • Report the problem in the ConEmu repo. But the author of ConEmu hasn't been active for a few years, so they probably won't make changes for the problem.
  • Don't use an italicized font.
  • Disable colors in the input line via clink set clink.colorize_input false.
  • Or use Windows Terminal instead of ConEmu.

Guess I'll have to live without colors then. Thanks a lot.

@mayankxor or, you could use Windows Terminal instead of ConEmu. ConEmu isn't being updated anymore. The Cmder team is working on releasing a version of Cmder that uses Windows Terminal instead of ConEmu. If you search in other issues, you can find links to instructions for how to try that out before it's officially released.

I'm currently trying to use Windows Terminal but it just refuses to start. It appears for a brief second in my task manager process tree and then closes.

Also, the top of the last character cell in a line is also cut off in ConEmu (e.g. column 120 if the terminal is 120 columns wide). The only solution for that is to not use italics or not use ConEmu. Windows Terminal has a configurable-width gutter around the terminal display, so the italics are able to extend into the gutter and still be seen.

ImageJust noticed it. Im definitely gonna migrate from cmder

I was wrong: the rightmost italicized character gets clipped even in Windows Terminal.

Image

But Windows Terminal is actively developed, so if you open an issue in the Windows Terminal repo, you'll get a response.

However, I'm not sure whether Windows Terminal allows choosing italics by default for a font. The VT specification assumes a non-italics font, so that the ANSI escape codes for "use italics" and "cancel italics" can work.

I'm not sure whether you'll be able to find any terminal that works quite how you want, with respect to always forcing italics for all characters.

For the sake of completeness, it's pretty easy to add Cmder (and by extension, clink) as a profile to Windows Terminal today:

https://github.com/cmderdev/cmder/wiki/Seamless-Windows-Terminal-Integration

(I've personally set up the Cmder profile as the default profile, and then WT as the default terminal emulator, giving a rock solid experience)

With that said, there are more information available below about what @daxgames and I have been working on, to replace ConEmu with WT:

https://github.com/orgs/cmderdev/discussions/2864

If possible, please participate in the poll by voting your preferred console of choice.

There are some small hurdles to overcome, once done, I think Cmder can be released with Windows Terminal as the default console of choice, and ConEmu as an alternative.


Thanks to @Maximus5 for all the years he maintained this amazing piece of software when the terminal experience on Windows was truly horrible, but we need active development to support Cmder (the same way @chrisant996 has thankfully picked up clink development from the previous developer, truly making it awesome)

In the meantime, I hope the guide above will help anyone try out Cmder with Windows Terminal, it's really amazing!