Skip to content

Infinite loop when drawing large ligatures to char atlas #4362

Open
@LabhanshAgrawal

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

// If there is not enough room in the current row, finish it and try again
if (activeRow === activePage.currentRow) {
activeRow.x = 0;
activeRow.y += activeRow.height;
activeRow.height = 0;
} else {
activePage.fixedRows.splice(activePage.fixedRows.indexOf(activeRow), 1);
}

^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.

Screenshot 2023-01-02 at 13 32 47

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions