microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.27k stars 8.27k forks source link

How to disable character auto convert (ligatures)? #12213

Closed gitsang closed 2 years ago

gitsang commented 2 years ago

Version: Windows Terminal Preview 1.12.3472.0

For example, if I type != it will be auto convert to . I don't want this. How can is disable it?

image

237dmitry commented 2 years ago

Disable ligatures in font features. Or choose font without ligatures. As a rule, the name of the font contains the word Mono.

zadjii-msft commented 2 years ago

Yea, those are called ligatures. You can change the font from "Cascadia Code" to "Cascadia Mono" as an easy solution. Otherwise yes, the font features is another way to disable them. See: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-11-release/#font-features-and-axes

/dup #759

ghost commented 2 years ago

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

gitsang commented 2 years ago

https://docs.microsoft.com/zh-cn/typography/opentype/spec/featurelist

"font": {
    "face": "Iosevka",
    "size": 11,
    "features": {
        "calt": 0
    }
},

diable calt can solve this

lukebakken commented 1 year ago

@gitsang FINALLY I found the correct way to disable ligatures. Everything else I read suggests "liga": 0 will do it but it does not. "calt": 0 disables them. Thank you!

dufuhang commented 1 year ago

@gitsang It's very useful! THANK YOU!

Tumb1eweed commented 1 year ago

https://docs.microsoft.com/zh-cn/typography/opentype/spec/featurelist

"font": {
    "face": "Iosevka",
    "size": 11,
    "features": {
        "calt": 0
    }
},

diable calt can solve this

very useful!

ClaireCJS commented 2 weeks ago

I only want to disable one specific ligature: ***

Any hints on that, anyone who happened to have read this far?

DHowett commented 2 weeks ago

Unless the font allows you to customize individual glyphs (with specific OpenType features,) it's not going to be possible to turn off just one ligature. Sorry!

ClaireCJS commented 1 week ago

Unless the font allows you to customize individual glyphs (with specific OpenType features,) it's not going to be possible to turn off just one ligature. Sorry!

Hmm, okay... Is there some easy tool i can use to edit the font, remove that 1 ligature, and use that in WT instead?

Heck, if i'm at that level i might want to add or modify even more than that one, just for fun.

o-sdn-o commented 1 week ago

Is there some easy tool i can use to edit the font

You could try FontForge.

  1. Run FontForge
  2. Open ttf-file: File->Open->Ok
  3. Element->Font Info...->Lookups->GSUB-> delete what you want (look single substitution lookups, double click + mouse hover tooltips will help you to find you want) image
  4. Change Element->Font Info...->PS Names to avoid interference with original ttf
  5. File->Generate Fonts... to save modified .ttf file
  6. Locate modified ttf-file using desktop explorer and click to install it.
  7. Restart WindowsTerminal and select modified font.
ClaireCJS commented 1 week ago

Holy cow. I never dreamed of having that much control over console. This sounds like a good product for temporary hyperfocus.

For instance, I think the commas after the right brackets in a situation like this:

[1, 2, 3], [4, 5, 6], []

should be tucked a little closer (1px left, and 1px down) to the right-bracket than they are.

I'll try it out, thank you so much for the guide!

ClaireCJS commented 1 week ago

I think in the end, I've decided to just clone the font from your github, and simply remove the raising of the asterisk:

image

Tempted to delete the whole file, but the angel of unintended consequences says "change as little as possible".