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

Add support for font ligatures via xterm-addon-ligatures - Close #3607 #3853

Merged
merged 3 commits into from
Oct 9, 2019
Merged

Add support for font ligatures via xterm-addon-ligatures - Close #3607 #3853

merged 3 commits into from
Oct 9, 2019

Conversation

GitSquared
Copy link
Contributor

@GitSquared GitSquared commented Oct 9, 2019

This PR, which is possible thanks to the xTerm update in #3830, enables support for font ligatures thanks to xterm-addon-ligatures.

Note that this addon doesn't support the WebGL renderer (from xterm-addon-webgl) yet, but that renderer is considered unstable and was disabled during the upgrade to xTerm.js 4 anyway.

Hopefully by the time we get to re-enable the WebGL renderer ligatures will be supported on it. I added a comment to warn future maintainers (see line 141 in lib/components/term.js).

Related issues:
Close #3607

@GitSquared
Copy link
Contributor Author

GitSquared commented Oct 9, 2019

Peek 2019-10-09 13-18

A little demo (Fira Code).

@Stanzilla
Copy link
Collaborator

Can you make this optional? There a lot of people that don't like ligatures, including me :)

@GitSquared
Copy link
Contributor Author

@Stanzilla Wouldn't you simply use a font without programming ligatures if you don't want them?

So far the behaviour I've seen in other term emulators is that ligatures are automatically enabled if the font supports it - I'm not against the idea of implementing a boolean option but I think it will just confuse people trying to get ligatures in Hyper.

Just to clarify, only the handful of programming ligatures fonts like Fira Code and Iosevka are impacted by this PR; it doesn't change anything for "regular" fonts.

@Stanzilla
Copy link
Collaborator

@GitSquared is there a non-ligature version of Fira Code? I think it would just be good practice to add an option for it, VS Code has one as well.

@GitSquared
Copy link
Contributor Author

@Stanzilla Yes, Fira Code is based on Mozilla's Fira. If we add an option, would you agree to make ligatures enabled by default?

@Stanzilla
Copy link
Collaborator

yeah would be fine by me

@GitSquared
Copy link
Contributor Author

@Stanzilla I added a disableLigatures option, which defaults to false, and works as expected.

@Stanzilla
Copy link
Collaborator

Awesome, build only fails because of a linting issue

@GitSquared
Copy link
Contributor Author

Should be fixed now 👍

@Stanzilla
Copy link
Collaborator

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Font ligatures don't work v3
2 participants