Repository navigation
feat(linux): upgrade libghostty, add Kitty clipboard and fix GL teardown - #55
Conversation
GhosttySurface now holds its own ref on the pane's GdkGLContext and runs ghostty_surface_free under it, restoring the prior context afterwards. The last-chance free moves to the widget's destroy, and a skipped free quarantines the engine so its callbacks stop reaching GTK or the model. Adds the isolated retained-context check, the LD_PRELOAD shim, the log analyzer and the gl-teardown AT-SPI scenarios that judge every teardown path. The negative control on the unfixed code reported the expected foreign, no-context and sibling deletes. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
gl-teardown-quarantine skips one overlay's free, then has its still running child speak OSC 22, 2, 52 and 9 and exit after the widget is gone. Each late callback must stop at the registry with the clipboard unchanged. A command surface always waits, so its close arrives as SHOW_CHILD_EXITED and is logged under the name the scenario asks for. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
Adds the container runner behind the headless Wayland and X11 proofs and states the retained owner context, the display-open invariant, the last-chance free, the degraded branches and the quarantine once in the libghostty rules. The plan records the evidence and closes the GL teardown gate; the startup-mutation and live-display gates stay open. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
The concurrent reader kept its exception on its own thread and recorded a time only after a success, so a dead reader reported 0 ms and passed. ControlProbe rethrows on the scenario thread, requires a completed read and rejects a reader still alive after the join. The same shape sat in stderr_slice, where an uncaptured stderr looked like no degraded line; it now requires the sink's marker. The headless runner gains a stage command that records the commit, because a linked worktree's gitdir is not in the container, and a run refuses a stage that names none. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
END proves only that the shim's destructor ran. exit(nonzero) runs destructors too and a later library finalizer can still abort, so a clean trace could sit beside a failing app while the runner discarded wait's status and the scenarios never read returncode. The runner and the gl-teardown scenarios now judge the exit apart from the trace and accept only 0, because the GLib SIGTERM handler quits cleanly. Stand-ins cover nonzero and signal exits beside a complete trace with no display. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
The analyzer, path and exit suites check the judge behind the gl-teardown scenarios and ran under no gate. They need only the standard library and bash, so they sit beside the SVG check and stop the script on failure. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
A headless run took any stage naming a commit, so a stale stage could pass while the tests under it came from the live tree. run_host now compares the stage commit with Sources and linux/patches, on the host where a linked worktree's gitdir resolves. A commit git cannot resolve refuses, as do untracked sources, which git diff does not see. run_stage's own clean check gains linux/patches through the shared list. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
…-list Every text read ran through the path decoder, so a Kitty client reading back its own text/plain file:// URL got a path. The callback has no request kind, so the clipboard's formats decide, taken as the read starts. Literal text round-trips and an offer with text/uri-list still reads and pastes as paths. A clipboard offering only text/plain with file:// lines no longer converts on paste, which is the intended trade. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
A blank context line in a unified diff is a single space, so the rebased patches fail CI's git diff --check. Same rule as scripts/zmx-patches; the patch bytes and their digest stay as built. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
18cd6e4 to
cba2f6f
Compare
A surface with no `command` closes through close_surface_cb, the one RetainedGhosttySurface entry no scenario reached. gl-teardown-quarantine-close quarantines a split, releases its exec'd child, and requires the callback's drop with the primary pane's shell unchanged. The callback drops under its own `close_surface` kind: SHOW_CHILD_EXITED logs `close` first on a plain exit and each kind logs once, so the old label could never appear. Removing the initializer's guard fails the scenario by name. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
`printf > file` creates the file before it writes, so waiting for it to exist and then reading it can see it empty. The likely cause of the `daemon-typed` assertion failing in CI on melonamin#55; that assertion recorded no value, so this is not proven. A wrong value now times out by name. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
Under a Russian layout xdotool sends a named p through a temporary spare keycode and unbinds it after the tap. Freezing the app across the press lost the palette 0/3 opened at 50 ms and 0/6 until xdotool exited, while the same freeze on a US layout and ctrl+shift+33 under Russian kept it. Keycode 33 is what a real keyboard sends, and matches the Ctrl-J/K steps. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
Brings in melonamin#54's real commits, so this branch merges without a rebase once melonamin#54 lands. Both sides added atspi_smoke.py scenario lines at the same spots; the tree is unchanged by this merge. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
`printf > file` creates the file before it writes, so waiting for it to exist and then reading it can see it empty. The likely cause of the `daemon-typed` assertion failing in CI on melonamin#55; that assertion recorded no value, so this is not proven. A wrong value now times out by name. Claude-Session: https://claude.ai/code/session_01MeR3EkF5tniXNzBrRWmfYZ
|
Holding this upgrade for validation against the current linux-port/v0.40 integration before merge/release. Two prerequisites in the description are already satisfied: #54 merged as 5d3f29b, and CI run 41352781624 used a warm runtime cache, passed all 64 GTK scenarios, and passed 623 Linux-package tests. The remaining integration gate is current-branch validation of rendering, font/resize behavior, input/IME, clipboard, process lifecycle/GL teardown, and control-socket paths. The unexplained remote-presentation failed-probe assertion still needs a baseline or diagnosis; the previous passing reruns do not establish its cause. Native-display coverage and the deliberate quarantine behavior (engine and child remain live until app exit when safe teardown fails) remain explicit release decisions. The November 1 checks are useful evidence, but they predate the current v0.40 integration. The current branch also contains 1925919, which moves resource-environment and locale initialization ahead of GTK workers and adds a startup-order regression; carry that correction through the integration. This addresses the startup-order hazard described in this PR, without proving the cause of the earlier captured crash. No new blocking code defect was established by the focused review. |
|
Merged current linux-port (6db162b) into this branch as a4a4766, preserving the existing history. This includes the merged #57 local-link fix, #56 split-layout fix and rendered cold-restoration regression, and the startup initialization-order correction. The merge was clean. Strict SwiftLint 0.65.0, core-boundary and CLI-drift checks pass; agtermCore remains identical to the Linux base. Fresh CI will validate the engine/clipboard/teardown changes against the current v0.40 application and complete GTK suite. The current remote-presentation harness also passed once against the existing e85e8a6 baseline build using the verified old Ghostty pin 0ba6250 and its pinned zmx runtime. It exercised SSH-255 loss, failed-probe reason/count reporting, stable pane identities, reattachment, leadership, overlay jobs, and ask handback. The initial harness launch had an unstaged zmx path; after mounting the existing verified runtime at the harness's expected path, the scenario completed successfully. One passing baseline run does not explain or clear the earlier intermittent failure. Current-head integration CI is still pending, and native-display acceptance remains unverified. |
Moves Linux libghostty from 0ba6250 to 683d8db, adapts clipboard callbacks to its ABI, and fixes pane teardown freeing GL objects under another surface's context. The branch includes the current v0.40 Linux integration, #56 split restoration, #57 local links, and the startup initialization-order correction. There is no agtermCore delta from linux-port.
Changes
Validation
Current integration head a4a4766 passed CI run 42424893442:
The current remote-presentation harness separately passed once against baseline build e85e8a6 with the verified old 0ba6250 engine and pinned zmx runtime. This exercised SSH-255 loss, failed-probe reason/count reporting, stable pane identities, reattachment, leadership, overlay jobs, and ask handback. A passing baseline and current-head run do not explain the earlier intermittent failure.
Earlier branch validation traced GL deletes against their owning contexts across nine close paths and exercised deliberate mutations, headless Wayland, OSC 52/5522, font resizing, scrollback, IME commits, and busy/background teardown. Those runs are historical evidence; native desktop acceptance was not repeated for the current integration.
Remaining limits and release follow-ups