xtermjs/xterm.js

Infinite loop when drawing large ligatures to char atlas

Open

#4 362 ouverte le 2 janv. 2023

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)TypeScript (1 574 forks)batch import
area/addon/ligaturesarea/addon/webglhelp wantedtype/bug

Métriques du dépôt

Stars
 (16 196 stars)
Métriques de merge PR
 (Merge moyen 4j 3h) (81 PRs mergées en 30 j)

Description

some fonts provide extremely long ligatures, e.g. Fira Code for =================================================== The char atlas code tries to find a row to fit it but fails and gets stuck in an infinite loop https://github.com/xtermjs/xterm.js/blob/fe8981766769c19ab1903dffa19f1a64ad83da13/src/browser/renderer/shared/TextureAtlas.ts#L792-L799 ^Here we're checking if there's room on the current row and creating a new one if not.

Details

  • Browser and browser version: chrome 108
  • OS version: macOS 12
  • xterm.js version: 5.1.0 (also on latest master branch)

Steps to reproduce

  1. Install Fira Code font, Run the xterm demo and enable ligatures
  2. start typing =
  3. Keep looking at the char atlas drawn below, once the glyph is almost the same width as char atlas, typing the next = will freeze everything.

Guide contributeur