Skip to content

✨ feat: formalize shared Ghostty sessions - #19

Draft
zrr1999 wants to merge 2 commits into
mainfrom
codex/ghostty-terminal-hard-cut
Draft

✨ feat: formalize shared Ghostty sessions#19
zrr1999 wants to merge 2 commits into
mainfrom
codex/ghostty-terminal-hard-cut

Conversation

@zrr1999

@zrr1999 zrr1999 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make cued the sole owner of PTYs, processes, named sessions, raw history, and controller leases
  • support durable shared human/agent sessions with multiple observers, a single controller, explicit handoff, generation fencing, archive/restore, and reconnect
  • hard-cut the TUI to the single cue-terminal / libghostty-vt backend and remove the legacy vt100 / tui-term path
  • bound foreground input, terminal reply, client writer, and UI event queues; fail closed on stale leases, oversized terminal transactions, partial writes, and failed detach
  • make pending connection attempts switchable/cancellable and apply an end-to-end connection timeout
  • pin the Ghostty source, Zig toolchain, minimal VT-only patch, verified dependency closure, licenses, static wheel packaging, and cross-platform package CI
  • document the formal TUI ownership model and the Spark integration boundary through typed cue IPC rather than duplicated PTY/session state

Why

cue-shell's primary Zellij replacement use case is a named process session that humans and agents can safely observe and share. The previous client-side terminal path duplicated terminal behavior and did not make authority, replay, or control handoff explicit.

This change keeps execution truth in the daemon while treating each client terminal as a reconstructable projection. It intentionally does not introduce cmux, a second terminal backend, or a separate session owner.

User and developer impact

  • humans and agents can attach to the same named session without both writing concurrently
  • observers retain local scrolling, selection, and copy while only the confirmed controller can send input, terminal replies, or resize events
  • reconnect and target switching no longer wait indefinitely behind a stuck connector
  • Ghostty integration is static, pinned, reproducible, and fails closed when the prepared dependency closure is unavailable
  • Spark integrates through the existing typed JSON IPC/session contract and does not link Ghostty or duplicate cue daemon state

Validation

  • just ci
    • cue-client: 137 tests
    • cue-daemon: 496 tests
    • daemon integration: 51 tests
    • cue-terminal: 18 tests
    • cue-tui: 222 tests
  • just pre-commit
  • just tui-debug-smoke against a real PTY
  • scripts/verify-ghostty-deps.sh
  • scripts/verify-ghostty-fail-closed.sh
  • git diff --check origin/main...HEAD

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant