Skip to content

feat: add an opt-in headless WezTerm backend - #289

Draft
cpendery (cpendery) wants to merge 1 commit into
mainfrom
feat/wezterm-backend
Draft

cpendery (cpendery) wants to merge 1 commit into
mainfrom
feat/wezterm-backend

Conversation

@cpendery

Copy link
Copy Markdown
Member

Summary

Add an opt-in wezterm backend using WezTerm's non-UI Rust VT crates, pinned to e68a8ec27727fbbda15e07f0a0737cd5e16481f6. No WezTerm application, window, GPU renderer, multiplexer, or WezTerm-managed PTY is involved.

  • Keep the existing PTY, process lifecycle, shell integration, locators, assertions, screenshots, and recordings in tui-test.
  • Map native cells, graphemes, styles, hyperlinks, colors, cursor state, terminal modes, scrollback, replies, bells, and session-local clipboard writes onto Emulator.
  • Forward the optional feature through the CLI and FFI crates, expose the selector in Python/JavaScript/Go, regenerate native declarations, and add backend CI coverage on the existing three-OS matrix.
  • Keep Alacritty as the default and leave the new feature out of standard release builds.

The core's writer is asynchronous. The adapter fences its FIFO through the supplied capture writer before draining replies or returning native key encodings. Fence bytes are removed before anything is forwarded to the PTY; regression coverage includes split escape sequences, bracketed paste, and previously queued terminal replies.

Native differences are preserved and explicitly asserted in conformance coverage: ST-only color replies, ignored OSC 52 read queries, ignored title-stack operations, mutually exclusive bold/dim intensity, bare palette resets that also reset dynamic colors, and wide-glyph overflow at the right margin. The latter is a native edge case, not normalized to another emulator's wrapping behavior.

Draft blocker

Keep this as a draft. The pinned upstream termwiz 0.24.0 and split VT crates are not all published to crates.io. cargo package --locked --allow-dirty -p tui-test-rs --no-verify currently fails on the unavailable registry version of termwiz. This affects publishing the crate even when the optional feature is disabled. Upstream publication or an agreed vendoring/distribution approach is required before merging this into a releasable version.

Source builds and custom native libraries work. Documentation makes the source-build requirement and native behavior differences explicit.

Validation

Performed on Windows:

  • 545 core-library tests, including the new backend and the existing Alacritty backend.
  • 525 terminal tests with all five emulator backends enabled.
  • A new Rust runtime test launching a real program through the existing PTY with Backend::Wezterm.
  • CLI selector tests with the feature both enabled and disabled; core rejection of the selector when disabled.
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings.
  • Feature-disabled core Clippy, targeted CLI Clippy, Rust formatting, Go formatting, and generated native declaration checks.
  • Built tui-test-ffi with --features wezterm; Python, JavaScript, and Go in-process smoke runs each selected the backend, launched a child, and observed native bold/dim behavior through a style locator.
  • Python/JavaScript backend-normalization tests and the TypeScript build.
  • Checked the VT dependency graph for GUI/font/window/multiplexer crates and confirmed that no existing locked package versions were removed or upgraded.

Linux and macOS execution is covered by the added CI steps, not claimed as locally exercised.

This branch has not been deployed

No deployments
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