Skip to content

v0.2.7

Latest

Choose a tag to compare

@brainkim brainkim released this 14 Nov 20:20

0.2.7 closes a privacy leak where images: "none" did not stop every image request, and bounds what hostile markup can cost to lay out. Programs in a pty embed can now send kitty graphics and read kitty keys, and the test suite runs on Windows.

Security

Thanks to @titanism of Forward Email for finding and fixing these.

  • images: "none" now stops every image request. An <img> in the html option or in an <iframe srcdoc> was still requested, because both documents are parsed before the option could be read. A mail client that turned images off still told each sender's server that the message was opened, and markup could point the request at loopback or link-local addresses. Every version with the images option is affected. Upgrade if you show markup you did not write.
  • A redirect to another origin no longer carries credentials. window.fetch followed a cross-origin redirect with the request's Authorization, Cookie and Proxy-Authorization headers. They are now dropped when the origin changes, and stay off for the rest of the chain.
  • Markup can no longer exhaust memory or the stack in layout:
    • <td colspan=1000 rowspan=65534> threw while the table was laid out.
    • A grid item from line 1 to line 10000 on both axes threw or hung.
    • A calc() with 20,000 nested parentheses or signs overflowed the stack. A calc() nested past 100 levels is now ignored, as an invalid value is.

Added

  • Programs in a pty embed can draw kitty graphics. The embed answers the graphics query and draws the images a program sends, as real images on a terminal with kitty graphics and in half blocks elsewhere. A TermDOM page running inside an embed now shows its images.
  • Programs in a pty embed can use the kitty keyboard protocol. While a program has the protocol's flags set, its keys are encoded as Ghostty encodes them, so it can tell Escape, Ctrl+Enter and Shift+Enter apart, and gets key releases when it asks for them.
  • A pty embed reports its default colors (OSC 10 and 11), so a program inside can tell a dark theme from a light one.
  • ::highlight() rules can set font-weight and font-style, which draw as bold, faint and italic. This departs from CSS, which limits highlights to properties that cannot change layout. In a terminal these are cell attributes and move nothing.

Changed

  • The pty embed's emulator follows xterm and Ghostty where xterm.js differs from both. Erasing from the last column, the three alternate-screen modes (47, 1047, 1049), and a pending wrap across a screen switch or cursor restore now behave as they do there.
  • On Windows, a pty embed fires error. There is no /bin/sh to run its command. Under Bun it used to fire load and close around an empty screen.

Performance

  • Dense grids place thousands of items quickly. With grid-auto-flow: dense, each item's search started over and walked past every item before it. 2,000 items of 9 by 9 cells took 2.3 seconds to the first frame and now take 0.3. 5,000 items in one fixed column took over 100 seconds and now take 0.9.

Fixed

  • A program in a pty embed that drew black, as an RGB or a palette color, got the terminal's default color instead.
  • A pty embed could answer a program's questions out of order. A TermDOM page in an embed then sometimes found no kitty graphics and drew its images in half blocks.

Windows

The Node and Bun test suites now run on Windows in CI. Running in a real Windows terminal, with raw-mode input and resizes, has not been tested yet.

These notes were generated with Claude Code.