Skip to content

fix: guard lineInfo getter against undefined logicalLineInfo#96

Merged
hyldmo merged 1 commit intomainfrom
hyldmo/bundle-patches
Mar 23, 2026
Merged

fix: guard lineInfo getter against undefined logicalLineInfo#96
hyldmo merged 1 commit intomainfrom
hyldmo/bundle-patches

Conversation

@hyldmo
Copy link
Copy Markdown
Owner

@hyldmo hyldmo commented Mar 23, 2026

Summary

  • The existing ghostty-opentui patch guarded logicalLineInfo inside GhosttyTerminalRenderable's own methods (renderSelf, getScrollPositionForLine)
  • But @opentui/core's base class TextBufferRenderable has a lineInfo getter that also calls logicalLineInfo, and its scrollHeight/scrollWidth properties access the result without null checks — causing crashes in consumers
  • Override the lineInfo getter on GhosttyTerminalRenderable.prototype to return an empty fallback when logicalLineInfo is undefined
  • Both @opentui/core (0.1.90) and ghostty-opentui (1.4.7) are at latest — no upstream fix available

Test plan

  • bun install applies patch successfully
  • bun run build bundles the override into dist/numux.js
  • All 614 tests pass
  • Verified EMPTY_LINE_INFO fallback and lineInfo getter present in bundle

🤖 Generated with Claude Code

The existing patch guarded logicalLineInfo inside GhosttyTerminalRenderable's
own methods, but @opentui/core's base class TextBufferRenderable has a
lineInfo getter that also calls logicalLineInfo — and its scrollHeight/
scrollWidth properties access the result without null checks. Override the
getter to return a safe empty fallback when logicalLineInfo is undefined.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@hyldmo hyldmo merged commit f5646b6 into main Mar 23, 2026
2 checks passed
@hyldmo hyldmo deleted the hyldmo/bundle-patches branch March 23, 2026 20:14
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.10.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant