terminal: adopt embedded runtime 1.4 improvements - #224
Merged
Conversation
Read exact and mapped MIME representations before falling back to native pasteboard synthesis while preserving complete multi-file URI lists. Keep the reference macOS host on the same callback contract and document the read and write approval model.
Use the active input source for IME mode changes and refresh shortcut collision data whenever the selected keyboard layout changes.
Standardize service URLs before shared separator normalization so equivalent dotted paths deduplicate while terminal and agent paths keep one spelling.
Clipboard protocols can expose many MIME names for one payload. Owning the borrowed bytes and publishing pasteboard data once per alias made memory scale with the alias count. Share each unique payload across its aliases and defer pasteboard data requests until a consumer asks for a representation.
Restoring many hidden panes kept each surface's renderer resources alive until the full layout finished, and screenshot capture could leave a hidden surface visible to the renderer after forcing a draw. Apply hidden state as each restored surface is created and restore it after hidden captures so renderer memory follows actual visibility.
The permission copy implied that writes prompt by default and that a denied request could be remembered. Neither matches the terminal policy. State the defaults exactly and name the optional session approval as an allow-only choice.
Terminal configuration can change while Settings remains open. Refresh reserved terminal bindings when the Shortcuts tab becomes active so its conflict state reflects the current configuration.
🛠️ Tuist Run Report 🛠️Tests 🧪
Builds 🔨
|
Clipboard writes could retain stale pasteboard items, while aliased data crossed the C boundary through pointer identity. Replace pasteboard contents and preserve explicit payload IDs instead. Hidden pane captures also changed logical terminal visibility while restoring renderer resources. Use a renderer-only transition and centralize pane activity updates around tree and focus state changes. Split callback, pasteboard, payload, and shortcut work out of the runtime, and route keyboard-layout changes through its existing config event.
The embedded runtime no longer copies each selection on macOS by default. Validate the private pasteboard before offering Paste Selection, and stop UI tests from relying on the removed side effect.
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.
Why
Our embedded terminal fork had fallen behind the 1.4 core and its reference macOS host. The gap included scrollback compression, hidden-surface GPU release, idle renderer parking, binary multi-format clipboard support, committed-text handling, keyboard-layout refresh, and smaller correctness and allocation fixes.
Updating the core alone would leave Supaterm on old callback contracts and keep renderer resources alive for panes hidden by its own spaces, tabs, splits, restoration, and screenshot paths. This syncs the fork and host so the app layer follows actual pane visibility and the new protocol behavior.
What changed
The fork now places six Supaterm commits directly above the current upstream head, with no merge commits. Supaterm adopts the matching macOS host behavior across these cases:
Note
This does not copy standalone-app window, tab, toolbar, or settings UI that Supaterm replaces with spaces, tabs, panes, and its own chrome.
Memory measurement
Two isolated arm64 Release builds used the same saved 1228×768 window frame, five idle login-shell tabs, and five
footprintsamples after each workload settled. Values are the stable median and are rounded byfootprint.origin/mainThe minimized branch build releases its 45 MB IOSurface allocation to 128 KB. The old fork already had scrollback compression, which is why both visible builds add only 4 MB for the scrollback workload. This update preserves that win and adds the app-layer occlusion path needed to release GPU resources.
Verification
Regression coverage checks shared clipboard payload ownership, lazy pasteboard delivery, binary MIME selection, callback validation and off-main delivery, permission grants, hidden-surface transitions, restoration order, capture cleanup, keyboard-layout changes, shortcut refresh, and canonical working directories.
The fork's core build, full Zig test suite, and reference macOS unit tests pass. The full Supaterm macOS unit suite passes, including the new clipboard bridge tests and the existing occlusion, clipboard, input, shortcut, and working-directory suites. Swift formatting, SwiftLint, and diff checks pass. Computer Use verified a live Metal-backed window restoring after its minimized renderer resources were released.