Skip to content

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Dec 23, 2025

Stacked on #439 (zig 0.15 upgrade).

Adds terminal rendering support using ghostty-vt:

  • TerminalRenderable - stateful terminal emulator for interactive sessions
  • StatelessTerminalRenderable - fast renderer for first few lines of output (renders in ~ms, for opencode bash previews)

The terminal output is renderd line by line instead of using character cells. This should make it pretty fast even for super long ANSI outputs if they don't use many colors. Each line will simply be a line of text in opentui.

Includes VTerm FFI bindings and registration in React, Solid, and Vue.

Here is how bash outputs looks like in opencode using these terminal renderables (only stateless for now):

Screen.Recording.2025-12-24.at.13.15.29.mov

- update build.zig for zig 0.15 API (createModule, standardOptimizeOption)
- add ghostty-vt dependency for terminal emulation
- use -gnu suffix for linux targets to fix PIC linker errors
- update CI workflows to use zig 0.15.2
- update all zig source files for 0.15 compatibility
…inux

- Update React and Solid workflows to use Zig 0.15.2 (required by ghostty-vt)
- Skip macOS targets when building on non-macOS hosts (ghostty's apple-sdk
  doesn't support cross-compilation from Linux)
- Update TypeScript build script to handle missing platform builds gracefully
- Add mitchellh/zig-build-macos-sdk dependency (official SDK used by Ghostty)
- Configure SDK paths on module before loading ghostty dependencies
- Update to latest ghostty commit
- Remove skip logic for macOS targets since SDK is now provided
Native binaries for all platforms are built in the release workflow
(build-native.yml on macOS). PR checks only need to build the TypeScript
library and run tests.
macOS can cross-compile to all platforms (Linux, Windows, macOS).
This avoids the complexity of setting up macOS SDK on Linux runners.
- By default, zig build now only builds for the native platform
- Add -Dall option to zig build for building all platforms
- Add --all flag to TypeScript build script
- Update release workflow to use --all for cross-compilation

This allows Linux users to run `bun run build` without failing on macOS targets.
- ArrayList.init(allocator) → ArrayListUnmanaged with allocator per-method
- std.fmt.formatIntBuf → std.fmt.bufPrint
- std.fmt.formatInt → writer.print
- std.zon.parse.Status removed, use fromSlice directly
- Add vterm.zig with ghostty-vt integration for terminal emulation
- Add VTerm FFI functions to lib.zig and zig.ts
- Add StatelessTerminalRenderable and TerminalRenderable classes
- Fix renderer.zig to skip stdout writes in testing mode (fixes hanging tests)
- Fix circular dependency by moving VTerm types to lib/vterm-ffi.ts
@remorses
Copy link
Contributor Author

Here is the multiplexing demo running 4 focusable opencode processes with support for mouse, scrolling and keys forwarding

Screen.Recording.2025-12-24.at.12.59.23.mov

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