Terminal: Fonts with programming ligatures show weird behavior

Created on 7 May 2019  Â·  14Comments  Â·  Source: microsoft/terminal

When fonts with programming ligatures is used, a weird behavior is show if write some characters at first, for example with FiraCode.

image

image

Area-Fonts Area-Rendering Issue-Question Needs-Tag-Fix Resolution-By-Design

Most helpful comment

I think you can use: https://en.wikipedia.org/wiki/Zero-width_non-joiner
According to the wiki, the intent is literally to stop ligatures from joining.

All 14 comments

I mean, isn't that how ligatures normally work? They can't really tell the difference between system32>=some_cmd and if (system32>=foo)

Well, but maybe there should be some stop-character (by default?) that prevents a ligature in this case

@puco Is there such a character?

If there is, then you could definitely add it to your prompt, with PROMPT $p$g<whatever the char is>.

However, that doesn't really seem like it's a solution that'll work for all cases

I think you can use: https://en.wikipedia.org/wiki/Zero-width_non-joiner
According to the wiki, the intent is literally to stop ligatures from joining.

fonts are free to define any arbitrary ligatures they want, so if you were to try to use a ZWNJ character to defeat the ligatures, then you'd have to insert them between every single character. which would probably then break logic related to graphemes when formed by multiple characters (e.g. separate jamo in korean hangul which should be presented as a single glyph).

in css, there is a font-variant-ligatures: none that you can use to disable ligature usage during font rendering. i'd assume that whatever font rendering engine used by the terminal would have a similar knob that could be turned ...

To be clear, I was suggesting zwnj for the end of prompt by default. It would absolutely be a bad idea to use to remove ligatures everywhere.

i'd assume that whatever font rendering engine used by the terminal would have a similar knob that could be turned ...

I believe this _is_ something we could work with. I believe @miniksa already has a list of renderer knobs he's thinking about exposing as settings

This looks as designed to me, trying to do some trickery with ZWJ that only works in Windows Terminal sounds like the wrong direction. If you use ligatures and hit this often you should probably just change your prompt.

what if we broke ligatures when we were overlaying the COOKED_READ data? That would solve it for CMD specifically ...


From: Daniel Imms notifications@github.com
Sent: Wednesday, May 8, 2019 8:15:50 AM
To: microsoft/Terminal
Cc: Subscribed
Subject: Re: [microsoft/Terminal] Fonts with programming ligatures show weird behavior (#514)

This looks as designed to me, trying to do some trickery with ZWJ that only works in Windows Terminal sounds like the wrong direction. If you use ligatures and hit this often you should probably just change your prompt.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTerminal%2Fissues%2F514%23issuecomment-490527963&data=01%7C01%7Cduhowett%40microsoft.com%7C4c6b0c3ae7184187320a08d6d3c80ea7%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=EtTyMXc0%2FgLyhZ1d9oPsKaaDjf0QrrmGKAPJVAhzOkk%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADNHLGSNVHPU6T2N3FR6U7DPULVCNANCNFSM4HLJZ6GQ&data=01%7C01%7Cduhowett%40microsoft.com%7C4c6b0c3ae7184187320a08d6d3c80ea7%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=w%2Blge7QO2CmIW%2BUbK8GZ5D2xmNQ7K17BgSbReA7xPsw%3D&reserved=0.

@DHowett-MSFT that's not a terrible idea, but I'm not sure how we could render that without sticking a fake ZWNJ in the buffer, or rendering that ZWNJ via conpty. It's certainly something that could be investigated, but I don't have high hopes it would work easily

OK. This weird behavior, as is, is by design. I've created two follow-on issues to dig into the different proposals here as they're separate concerns. I'll close this one as is so other complaints can be duped here.

'Resolutin-By-Design'..... LOL, Design must be .... 👎

@Luuk34 This is literally the design of how ligatured fonts work. If you don't like ligatured fonts, then you're free to

  • pick any of the gazillions of fonts that are out there that _don't_ have liagtured glyphs
  • wait for the next release to come out where we switch to "Cascadia Mono" (without ligatures) instead of "Cascadia Code" (with ligatures) (see #5505)
  • Help us implement settings for disabling ligatures #759

but comments like "Design must be .... 👎" aren't really constructive here.

:edit seeing #757 seems like the disliked comment was actually taken to heart and people are now trying to fix it.

How is it not constructive when someone gives you the most valuable information.
It pops up in a lot of different places.
From the second any other party has any responsibility Microsoft's approach has classically been its fully up to them to resolve any issues especially if it's regarding customizing aesthetics>

All that is being asked is an exception in code that states.

IF 
$path + >+ = 
Don`t
Use the code to render ligatures on  + > = 

And of course a toggle switch because people who know what they are doing don't want permanent decisions made for them.

Please don't view negative feedback as unconstructive.|

He is probably not talking about the design of the ligature fonts but about the design of how cmder handles them !

I haven't seen this functionality in any other terminal emulator in windows or Linux. But the goal should always be better than the competition by as large a margin as possible.

And ofc if your code is so bloated by company standard practices adding anything like this adds huge amount of unnecessary bloat.

Don't get me wrong much love to y'all and thx for making this emulator its now my main one.
**to bad i couldn`t figure out how to hide all the ui tho :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dev-logan picture dev-logan  Â·  3Comments

zadjii-msft picture zadjii-msft  Â·  3Comments

wkbrd picture wkbrd  Â·  3Comments

ghost picture ghost  Â·  3Comments

alabuzhev picture alabuzhev  Â·  3Comments