Font ligatures don't work v3
orangecoloured opened this issue · comments
- I am on the latest Hyper.app version
- I have searched the issues of this repo and believe that this is not a duplicate
- OS version and name: 10.14.4 macOS Mojave
- Hyper.app version: 3.0.0
- Link of a Gist with the contents of your .hyper.js:
- Relevant information from devtools (CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere):
- The issue is reproducible in vanilla Hyper.app:
Is Vanilla
or with thehyper-font-ligatures
add-on.
Issue
I'm using Fira Code font and the ligatures don't work. I found this issue #914 and tried installing the hyper-font-ligatures
add-on or adding this css
termCSS: `
x-screen x-row {
font-variant-ligatures: initial;
}
`,
but none of these seem to work.
At least on Windows 10, setting webGLRenderer: false
in your config file will bring them back (assuming you still have the hyper-font-ligatures
plugin installed). This will also fix some of the other rendering anomalies of v3, although sadly not all.
Oh. Yes, working now.
So, ligatures in exchange for performance :)
@orangecoloured So why did you close this bug?
@nurtext Because technically this bug was resolved. The ligatures work without WebGL renderer.
I think another issue should be created addressing this.
@orangecoloured I understand, but for me it's still open because turning off the newly introduced renderer isn't a valid fix. Ever tried tail
ing or cat
ing some logs with the old renderer? It made Hyper almost useless for me. Now Hyper is back in the game (at least for me), but ligatures are a must have in 2019 IMHO.
Yeah, I would recommend reopening this as well.
So, based on this comment, looks like there's a fix for this in xterm.js. Would be really awesome to get that pulled in so ligatures will work without a performance hit.
xTerm 4 supports this through the new Addon system: https://github.com/xtermjs/xterm-addon-ligatures
However, the xterm fork used by Hyper is severely out of date: 56 commits ahead, 1290 commits behind
.
Edit: Switching the fork for latest xTerm works... except the WebGL renderer is quite broken - I believe it should be possible to fix it but I haven't researched that much. Also, the fork contains valuable work that needs to be rebased on xterm@4.
@GitSquared Looks like they're already on it: #3830
@GitSquared our effort in that PR is currently stuck on broken resizing
Now that #3830 has been merged, I'm sending a PR for enabling font ligatures.
Does not work for me, even with WebGL disabled.
@alexgalkin1994 You're testing on the canary version, right?
Reopening since I don't see them working as well here, something broke during the Electron update?
@Stanzilla They still work for me under Linux, could this be platform-specific? (Still using Fira Code.)
Could be yea, anything known about issues with that on Windows @Tyriar?
Working for me on mac (also using Fira Code)
@alexgalkin1994 You're testing on the canary version, right?
I installed it via Homebrew. (brew cask install hyper)
Version 3.0.2 is installed
@alexgalkin1994 That's the latest release. This issue has been closed on the canary branch, which is the development version - ligatures will be enabled in the next release.
I upgraded to Hyper 3.0.1-canary.4 (canary) on macOS and I'm using the Nerd Fonts version of Fira Code, and I also tried Pragmata Pro Mono Liga and I don't see ligatures.
You need to use a build from CI or compile your own
Oh alright, thanks @Stanzilla!
Just built (yarn run dev
) and ran (yarn run app
) the latest on canary (f40496f). I can see ligatures with fontFamily
set to "Fira Code", but not with any of the variants of either Iosevka or PragmataPro that I've tried. I assume either should work (they properly work in VS Code/IDEA), what might I be doing incorrectly?
any idea when this will become live for everyone?
Sadly not
Will the fix in canary make it into 3.0.1? Can a build be put out for this fix? I couldn't find any build artifacts on CI.
No, not soon, for which OS are you looking for?
MAC OS
Can you try this then? https://github.com/zeit/hyper/releases/tag/v3.1.0-canary.3
Should that be v3.1.0-canary.5? since v3.1.0-canary.4 is already published
Ah yes, my bad, try https://github.com/zeit/hyper/releases/tag/v3.1.0-canary.4
It kind of works, see screenshot. The font is Iosevka
If I remove the first "=" then the ligatures for the double arrow get disabled. See 2nd screenshot.
@Stanzilla btw, the font rendering has also changed in v3.1.0-canary.4, in my opinion it has improved. Earlier fonts used to rendered very thin.
Sounds good, thank you! The bug you mentioned might be something to report over at xterm, does it happen in VSCode for you as well?
I don't use VS Code, so wouldn't know. But I was wondering if its a font specific issue. I switched to PragmataPro Liga, which has ligatures and they don't work.
The same was reported here
that was canary 3.0.1-canary4 though, in theory it should work in 3.1.0-canary4. Can you please install VSCode and see if it works there?
Well "great" then it's probably a hyper bug.
Unfortunately, I think so too.
Oh damn it, good call, I did not actually look at the screenshot -.-
@IceMan81 You should try this in the integrated terminal provided by VSCode.
Do you need to do something to enable ligatures for the integrated terminal in VSCode?
@IceMan81 You should try this in the integrated terminal provided by VSCode.
Do you need to do something to enable ligatures for the integrated terminal in VSCode?
It looks like VSCode's integrated terminal does not currently support ligatures. There used to be a ligatures setting which has been disabled.
microsoft/vscode#34103
@Stanzilla btw vscode's terminal doesn't support ligatures, it never ended up making it that far and the work on the addon has pretty much all been external. It may be broken on some renderers now I'm not sure, that's because we're waiting on xtermjs/xterm.js#2847 so it can stay up to date.
That explains that, thank you
Looks like xtermjs/xterm.js#2847 is merged now.
If ligatures are merged upstream whatʼs the next step here then?
Also happens to me on macOS Catalina with vanilla installation, is there a fix? It's the only thing that prevents me from using Hyper regularly.
Hello everyone, removing the qoutes in fonts settings in .hyper.js accidently worked for me, but when I tried to reset it and redo for making some guide for you, guys, it didn`t work for the second time. Also it worked when I removed another qoutes from other fonts in the list but for one single terminal run. I had idea about wrong font recognition because of those quotes, nevertheless now I guess they are used for multi-word-fonts.
I'm confused why this is still an issue - it seems that xterm.js has resolved most issues with ligatures:
xtermjs/xterm.js#3286
xtermjs/xterm.js#2847
Is there a bug in Hyper that's preventing ligatures from working?
Turning off WebGL is, unfortunately, a non-starter for a lot of us. The stuttering caused by using Vim in Canvas gives me a headache.
EDIT: Looks like we're just not enabling ligatures if webgl is enabled:
Line 179 in dd0ae33
EDIT2: I tried updating that line to ignore the WebGL check, but ligatures still appear broken. Might need a core contributor to dig into this.
EDIT3: Figured it out, had wonky config locally. Here's a PR to enable ligatures with the WebGL renderer! #5888
CC: @Stanzilla @GitSquared since you both seemed invested in this issue.
We're not enabling ligatures with webgl as it's causing issues with rendering #5757
@LabhanshAgrawal has requested that we not enable WebGL + Ligatures in hyper
directly, so I've instead opened a PR with hyper-font-ligatures
that enables WebGL + Ligatures: tolbertam/hyper-font-ligatures#11
EDIT: As I'm playing with this again, I'm seeing more issues than I thought. Especially while using Vim. The WebGL + Ligature combination appears to be better than what's been released, but people should still be cautious when enabling both.
Has this issue been resolved? This was the reason I stopped using Hyper