Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ligatures in terminal #34103

Closed
Tyriar opened this issue Sep 10, 2017 · 73 comments · Fixed by #232829
Closed

Support ligatures in terminal #34103

Tyriar opened this issue Sep 10, 2017 · 73 comments · Fixed by #232829
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 10, 2017

Regresses with performance improvements in terminal's renderer #33954

@Tyriar Tyriar added feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label labels Sep 10, 2017
@Tyriar Tyriar added this to the Backlog milestone Sep 10, 2017
@Tyriar Tyriar self-assigned this Sep 10, 2017
@Tyriar Tyriar added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Sep 10, 2017
@Mohamed3on
Copy link

Hi! is there any timeline for this feature?

@Tyriar
Copy link
Member Author

Tyriar commented Oct 10, 2017

Nope.

Here's the upstream issue xtermjs/xterm.js#958

@coreh
Copy link

coreh commented Oct 10, 2017

Would be really nice if there was a setting to re-enable the old terminal rendering until all the issues with the new terminal are resolved (blurriness, ligatures, emoji). 😕

@MPV
Copy link

MPV commented Oct 3, 2018

It seems there is now an xterm.js plugin for ligatures support:
https://github.com/xtermjs/xterm-addon-ligatures

How can we get it into vscode?

@Tyriar
Copy link
Member Author

Tyriar commented Oct 3, 2018

@MPV it would have to be built into the core, the main thing that needs to happen now is to evaluate how much weight the addon would add to the VS Code distributable.

@cziem
Copy link

cziem commented Jan 28, 2019

font-ligatures

This is how my vscode term looks like, I want it to look like this:

font-ligatures-2

@Tyriar
Copy link
Member Author

Tyriar commented Jan 28, 2019

@Phavor I don't think your issue is about ligatures but rather your powerlines setup https://code.visualstudio.com/docs/editor/integrated-terminal#_can-i-use-powerline-fonts-in-the-integrated-terminal

@cziem
Copy link

cziem commented Jan 28, 2019

@Tyriar I fixed though. Thanks. This line did the job "terminal.integrated.fontFamily": "'Fira Code iScript'"

@FelikZ
Copy link

FelikZ commented Jul 31, 2019

any news on it? I believe this is the last thing is missing for terminal to render everything proper

@wolf99
Copy link

wolf99 commented Sep 19, 2019

Just tried Cascadia Code font in the integrated terminal... ligatures not present 😢

@jhpratt
Copy link

jhpratt commented Sep 23, 2019

I see that there's a way to do this via an extension that modifies VS Code's internal files. Would it be possible to add a checkbox in settings that toggles this itself? @Tyriar

@Tyriar
Copy link
Member Author

Tyriar commented Sep 23, 2019

@jhpratt that's what it would do eventually, the remaining work here is slimming down the ligatures xterm.js addon to bare essentials and test/include it. I don't have time to do it right now due to other priorities though.

@Tyriar Tyriar added intergrated-terminal-xtermjs upstream-issue-linked This is an upstream issue that has been reported upstream and removed intergrated-terminal-xtermjs labels Oct 8, 2019
@Geobert
Copy link

Geobert commented Oct 26, 2019

Is this bug why I got this in vscode:
image

instead of:
image

(using this font https://github.com/adam7/delugia-code)?

@Tyriar
Copy link
Member Author

Tyriar commented Oct 27, 2019

@Geobert probably caused by xtermjs/xterm.js#1709 or xtermjs/xterm.js#942, ligatures are different to emoji.

@Tyriar
Copy link
Member Author

Tyriar commented Dec 4, 2019

Got a bunch of questions about ligatures when tweeting about the WebGL renderer so I'll give an update here. Here's the remaining work to do on this:

  • xterm.js
  • vscode
    • Integrate xterm-addon-ligatures such that the addon code is not loaded if ligatures is off, add the setting, etc.

@pattrickrice
Copy link

@Tyriar is there a repro of the bundling issue? I feel like that would be a good starting point for those that want to help here

@Tyriar
Copy link
Member Author

Tyriar commented Nov 1, 2024

Giving it another shot in #232829

@Tyriar
Copy link
Member Author

Tyriar commented Nov 4, 2024

Looks like this should land as a preview feature in the November release! #232829

Enable it with "terminal.integrated.fontLigatures": true and please report any problems you see. It should be in tomorrow's Insiders build.

@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 4, 2024
@pattrickrice
Copy link

Wow amazing!

@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 5, 2024
Tyriar added a commit that referenced this issue Nov 5, 2024
@Tyriar Tyriar mentioned this issue Nov 27, 2024
3 tasks
@iwangbowen
Copy link

Finally

@joshlawton
Copy link

Just to confirm, this setting only accepts a boolean value and does not enable explicit font-feature-settings like ss01 or cv69? That is, even if terminal.integrated.fontLigatures is true, the font may not necessarily match the style sets and character variants enabled in the editor?

// settings.json

// Works
"terminal.integrated.fontLigatures": true

// Won't work as expected at this time?
"terminal.integrated.fontLigatures": "'calt', 'liga', 'ss19', 'cv69'"

Compare editorOptions.ts to terminalConfiguration.ts.

@Tyriar
Copy link
Member Author

Tyriar commented Dec 4, 2024

@joshlawton yes it's all or nothing right now. If someone can figure out how to pass that information on to an OffscreenCanvas it should be trivial to add the support: https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D#text_styles

Created #235316 to track

@AndreiKrutikov
Copy link

It works strangely on the latest Insiders build. Some of the ligatures are working, and some are not. Cannot figure out the rule, but for instance '=>' works, but not '-<'.
Note that it doesn't work in the input but does work on the output; some ligatures don't work either on the input line or in the output.
Image

@Master-Hash
Copy link

It works strangely on the latest Insiders build. Some of the ligatures are working, and some are not. Cannot figure out the rule, but for instance '=>' works, but not '-<'.
Note that it doesn't work in the input but does work on the output; some ligatures don't work either on the input line or in the output.
Image

I found - and < has different colors in the first line, which may be the reason.

The third line is correct.

@Tyriar
Copy link
Member Author

Tyriar commented Dec 5, 2024

I found - and < has different colors in the first line, which may be the reason.

@Master-Hash yes that's by design in that particular case since pwsh is coloring is differently

@sunshaoce
Copy link

I encountered a problem where the progress bar cannot be displayed correctly in the terminal using the Fira Code font.

echo "[=========================---------------------------------------------------------------]"

Will be
Image

@Tyriar
Copy link
Member Author

Tyriar commented Dec 16, 2024

@sunshaoce tracked in #235988 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet