refactor(flterm): harden the adapter and expose OSC 52 writes - #100
Closed
adonm wants to merge 8 commits into
Closed
refactor(flterm): harden the adapter and expose OSC 52 writes#100adonm wants to merge 8 commits into
adonm wants to merge 8 commits into
Conversation
adonm
force-pushed
the
refactor/flterm-thin-adapter
branch
2 times, most recently
from
July 15, 2026 02:31
75264d5 to
7bb1817
Compare
Author
|
Superseded by #101 after renaming the head branch to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TerminalRenderPipelinethe single owner of the atlas lease, frame buffers, painters, Kitty placement/image state, paint order, and terminal dirtinessTerminalRenderObserver,TerminalPainterStack,TerminalPainter, andTerminalRawGestureDetector)libghostty/fltermcallback on native and WASM targets; clipboard read queries remain disabledWhy
flterm should translate Flutter lifecycle, input, paint, accessibility, and host effects at the UI boundary while libghostty remains authoritative for terminal behavior. The removed state and pass-through abstractions created synchronization paths without adding a stable boundary.
The input and rendering fixes close issues found while integrating the adapter in a remote-shell client: fabricated
(0, 0)wheel positions, lost mouse-button identity, dirty state consumed by terminal size queries, blank frames during Kitty image replacement, and custom-painted terminal content being unavailable to assistive technologies.The OSC 52 callback lets embedders apply their own trust policy, payload limits, decoding, foreground-tab checks, and platform clipboard write. It deliberately exposes the raw selector and base64 payload rather than granting clipboard access inside libghostty.
Compatibility and scope
packages/fltermandpackages/libghostty; the pinned Ghostty commit remains91f66da24527fa02d92b5fd0b41cd020f553a64cTerminal.onClipboardWriteandTerminalController.onClipboardWriteare additive optional callbacks?) are ignored before the callback boundarypackage:flterm/flterm.dartentrypoint is unchangedTerminalView.semanticsLabelandTerminalView.semanticsHintare additive optional parameters;semanticsLabel: nulllets an embedding application provide its own accessible surfaceKittyPlacementCacheremain intactVerification
libghostty-vtZig tests for OSC 52 stream and C callbacks passdart analyze packages/fltermpasses with the three pre-existing info-level lints interminal_frame_builder_test.dartpackages/libghostty/test/hook/ghostty_source_test.dart: 12 tests passedpackages/libghostty/test/impl/terminal/terminal_test.dart: 71 tests passedpackages/flterm/test/widgets/terminal_controller_test.dart: 60 tests passedwasm32-freestandinglibrary compiles successfully; CI runs the Chrome WASM suite