Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4a41113
upgrade to zig 0.15.2 with ghostty-vt dependency
remorses Dec 23, 2025
be69a9b
fix(ci): update zig to 0.15.2 and skip macOS cross-compilation from L…
remorses Dec 23, 2025
1fe9c14
fix: add macOS SDK for cross-compilation from Linux
remorses Dec 23, 2025
59b5391
fix: add explicit refs to git URLs in build.zig.zon
remorses Dec 23, 2025
7e8a205
fix: correct hash for macos_sdk dependency
remorses Dec 23, 2025
08a4dad
fix: use raw macOS SDK tarball instead of outdated zig package
remorses Dec 23, 2025
920c5d4
fix(ci): only build lib, not native binaries for all platforms
remorses Dec 23, 2025
d7e55c5
fix(ci): use macos-latest runners for cross-compilation
remorses Dec 23, 2025
7492abd
fix: build only native platform by default, add --all for all platforms
remorses Dec 23, 2025
bac4cd3
fix: remove reference to non-existent ghostty-terminal.zig test file
remorses Dec 23, 2025
82924dd
fix: update zig tests for 0.15 API changes
remorses Dec 23, 2025
b37dc0b
ci: retry
remorses Dec 23, 2025
36ba112
fix: use arena allocator for ZON parser to avoid memory leaks in tests
remorses Dec 23, 2025
ed20f79
ci: use macos-large runner for faster builds
remorses Dec 23, 2025
143c409
ci: revert to macos-latest, skip native tests (hang issue)
remorses Dec 23, 2025
401c5cc
ci: trigger rebuild (transient network error)
remorses Dec 23, 2025
aff2fce
feat: add VTerm terminal rendering functions and renderables
remorses Dec 23, 2025
8e27f53
feat: register Terminal renderables in solid, react, and vue
remorses Dec 23, 2025
7f9ad9f
style: fix prettier formatting
remorses Dec 23, 2025
05da396
fix read after free
remorses Dec 24, 2025
c166d28
use gpa for strings. use a arena for each persistent terminal
remorses Dec 24, 2025
b244bf7
use input buffers, nicer allocations, no longer leak
remorses Dec 24, 2025
c64388d
remove unnecessary std options
remorses Dec 24, 2025
7ff1e61
disable ghostty logging
remorses Dec 24, 2025
2a5c85d
add support for forwarding events in Terminal
remorses Dec 24, 2025
800a7ed
do not allow changing streams
remorses Dec 24, 2025
3a29ff4
show cursor in Terminal
remorses Dec 24, 2025
5566465
cleanup demo
remorses Dec 24, 2025
b0b3400
fix: prettier formatting
remorses Dec 24, 2025
c1fb8bc
ci: retry
remorses Dec 24, 2025
9639559
fix: handle flushSync rename in react-reconciler 0.32.0 (#454)
remorses Jan 1, 2026
f75ad23
run CI on push only (#462)
kommander Jan 2, 2026
c5a9fcf
Revert "run CI on push only (#462)"
kommander Jan 2, 2026
c417503
use gpa (#465)
kommander Jan 2, 2026
dc98b37
fix(utf8): widen WrapBreak offsets to u32 for lines > 64KB (#464)
simonklee Jan 2, 2026
31a5cc2
prepare release v0.1.68
kommander Jan 2, 2026
e8c1233
feat(solid): allow passing custom CliRenderer to render() (#469)
remorses Jan 4, 2026
663e000
bench(text-buffer-view): add measureForDimensions benchmark (#472)
simonklee Jan 5, 2026
4a54bd7
improve word wrap perf by tracking byte_offset instead of recalc (#473)
kommander Jan 5, 2026
23e8ab8
perf(text-buffer-view): cache measureForDimensions results (#475)
simonklee Jan 5, 2026
aa21855
bench: replace the measureForDimensions bench (#474)
simonklee Jan 5, 2026
e040c59
prepare release v0.1.69
kommander Jan 5, 2026
535b7b3
Merge remote-tracking branch 'upstream/main' into ghostty-opentui-2
remorses Jan 6, 2026
6a47d5e
fix some examples and more coverage for osc8
kommander Jan 6, 2026
c85d932
Upgrade to Zig 0.15.2 (#439)
remorses Jan 6, 2026
bb10ec8
Merge upstream/main into ghostty-opentui-2
remorses Jan 6, 2026
0c4fa21
Update ghostty to latest, switch CI to ubuntu, fix type errors
remorses Jan 6, 2026
77bfd69
Remove unused ts-expect-error directive
remorses Jan 6, 2026
3e63499
Increase perf test threshold for CI variance
remorses Jan 6, 2026
db78f25
Switch remaining CI workflows to ubuntu
remorses Jan 6, 2026
2a1c967
Use ghostty fork with musl PIC fix, remove -gnu suffix
remorses Jan 7, 2026
6f1eb53
Add both glibc and musl linux targets
remorses Jan 7, 2026
4176490
Add musl linux targets and runtime detection
remorses Jan 7, 2026
933d59b
Use process.report for musl detection instead of filesystem check
remorses Jan 7, 2026
c70527d
Use fast filesystem check for musl detection
remorses Jan 7, 2026
ed1a57b
Fix formatting
remorses Jan 7, 2026
8a5d5b7
ci: cross-compile all platforms and test on matrix of OSes
remorses Jan 7, 2026
ed4340f
ci: install gcc-multilib for cross-compilation
remorses Jan 7, 2026
f764fbd
ci: use macos runner for cross-compilation
remorses Jan 7, 2026
b22b0ba
ci: temporarily disable failing platform test matrices
remorses Jan 7, 2026
d0e472d
fix: cross-platform test failures
remorses Jan 7, 2026
363a7f6
fix: update mock-mouse tests to expect correct SGR protocol
remorses Jan 7, 2026
7c33967
test: skip flaky mouse drag selection tests on Windows
remorses Jan 7, 2026
e19f381
style: fix prettier formatting
remorses Jan 7, 2026
9efbcdb
test: fix more cross-platform test issues
remorses Jan 7, 2026
7c6758d
test: fix remaining cross-platform test issues
remorses Jan 7, 2026
c014708
ci: remove darwin-x64 from test matrix
remorses Jan 7, 2026
9a1bfdb
test: increase idle() timing tolerance for all platforms
remorses Jan 7, 2026
cda9daf
docs: add TODO comments for disabled tests
remorses Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 53 additions & 7 deletions .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
branches: [main]

jobs:
build:
name: Core - Build and Test
runs-on: ubuntu-latest
build-native:
name: Build Native (All Platforms)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -21,17 +21,63 @@ jobs:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.1
version: 0.15.2

- name: Install dependencies
run: bun install

- name: Build
- name: Build native for all platforms
run: |
cd packages/core
bun run build
bun run build:native --all

- name: Upload native artifacts
uses: actions/upload-artifact@v4
with:
name: native-all
path: packages/core/node_modules/@opentui/
retention-days: 1

test-ts:
name: Test (${{ matrix.name }})
needs: build-native
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: linux-x64
- os: ubuntu-latest
name: linux-musl-x64
container: oven/bun:alpine
- os: macos-latest
name: darwin-arm64
# darwin-x64 removed: macos-13 is deprecated with no free x64 runner available
# darwin-arm64 provides sufficient macOS coverage
- os: windows-latest
name: win32-x64
runs-on: ${{ matrix.os }}
container: ${{ matrix.container || '' }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
if: ${{ !matrix.container }}
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Download native artifacts
uses: actions/download-artifact@v4
with:
name: native-all
path: packages/core/node_modules/@opentui/

- name: Run tests
run: |
cd packages/core
bun run test
bun run test:js
2 changes: 1 addition & 1 deletion .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
build-examples:
name: Build Example Executables
runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ on:
default: false

env:
ZIG_VERSION: 0.14.1
ZIG_VERSION: 0.15.2

jobs:
build-native:
name: Build Native Libraries
runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand All @@ -39,7 +39,10 @@ jobs:
run: bun install

- name: Build packages (cross-compile for all platforms)
run: bun run build
run: |
cd packages/core
bun run build:native --all
bun run build:lib

- name: Verify build outputs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.1
version: 0.15.2

- name: Install dependencies
run: bun install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-solid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.1
version: 0.15.2

- name: Install dependencies
run: bun install
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.1
version: 0.15.2

- name: Extract version from tag
id: extract_version
Expand All @@ -52,8 +52,13 @@ jobs:
- name: Prepare release versions
run: bun run prepare-release "${{ steps.version_scheme.outputs.version }}"

- name: Build packages
run: bun run build
- name: Build packages (cross-compile for all platforms)
run: |
cd packages/core
bun run build:native --all
bun run build:lib
cd ../solid && bun run build
cd ../react && bun run build

- name: Publish packages
run: bun run publish
Expand Down
2 changes: 1 addition & 1 deletion .zig-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.1
0.15.2
18 changes: 9 additions & 9 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"types": "src/index.ts",
"module": "src/index.ts",
"main": "src/index.ts",
"version": "0.1.67",
"version": "0.1.69",
"type": "module",
"scripts": {
"build": "bun run build:native && bun run build:lib",
Expand All @@ -29,6 +29,7 @@
"@types/bun": "latest",
"@types/node": "^24.0.0",
"@types/three": "0.177.0",
"bun-pty": "^0.4.2",
"commander": "^13.1.0",
"typescript": "^5",
"web-tree-sitter": "0.25.10"
Expand All @@ -47,12 +48,12 @@
"bun-webgpu": "0.1.4",
"planck": "^1.4.2",
"three": "0.177.0",
"@opentui/core-darwin-x64": "0.1.67",
"@opentui/core-darwin-arm64": "0.1.67",
"@opentui/core-linux-x64": "0.1.67",
"@opentui/core-linux-arm64": "0.1.67",
"@opentui/core-win32-x64": "0.1.67",
"@opentui/core-win32-arm64": "0.1.67"
"@opentui/core-darwin-x64": "0.1.69",
"@opentui/core-darwin-arm64": "0.1.69",
"@opentui/core-linux-x64": "0.1.69",
"@opentui/core-linux-arm64": "0.1.69",
"@opentui/core-win32-x64": "0.1.69",
"@opentui/core-win32-arm64": "0.1.69"
},
"exports": {
".": {
Expand Down
43 changes: 23 additions & 20 deletions packages/core/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ const args = process.argv.slice(2)
const buildLib = args.find((arg) => arg === "--lib")
const buildNative = args.find((arg) => arg === "--native")
const isDev = args.includes("--dev")
const buildAll = args.includes("--all") // Build for all platforms (requires macOS or cross-compilation setup)

const variants: Variant[] = [
{ platform: "darwin", arch: "x64" },
{ platform: "darwin", arch: "arm64" },
{ platform: "linux", arch: "x64" },
{ platform: "linux", arch: "arm64" },
{ platform: "linux-musl", arch: "x64" },
{ platform: "linux-musl", arch: "arm64" },
{ platform: "win32", arch: "x64" },
{ platform: "win32", arch: "arm64" },
]
Expand All @@ -56,7 +59,12 @@ if (!buildLib && !buildNative) {
}

const getZigTarget = (platform: string, arch: string): string => {
const platformMap: Record<string, string> = { darwin: "macos", win32: "windows", linux: "linux" }
const platformMap: Record<string, string> = {
darwin: "macos",
win32: "windows",
linux: "linux",
"linux-musl": "linux-musl",
}
const archMap: Record<string, string> = { x64: "x86_64", arm64: "aarch64" }
return `${archMap[arch] ?? arch}-${platformMap[platform] ?? platform}`
}
Expand All @@ -78,16 +86,17 @@ if (missingRequired.length > 0) {
}

if (buildNative) {
console.log(`Building native ${isDev ? "dev" : "prod"} binaries...`)
console.log(`Building native ${isDev ? "dev" : "prod"} binaries${buildAll ? " for all platforms" : ""}...`)

const zigBuild: SpawnSyncReturns<Buffer> = spawnSync(
"zig",
["build", `-Doptimize=${isDev ? "Debug" : "ReleaseFast"}`],
{
cwd: join(rootDir, "src", "zig"),
stdio: "inherit",
},
)
const zigArgs = ["build", `-Doptimize=${isDev ? "Debug" : "ReleaseFast"}`]
if (buildAll) {
zigArgs.push("-Dall")
}

const zigBuild: SpawnSyncReturns<Buffer> = spawnSync("zig", zigArgs, {
cwd: join(rootDir, "src", "zig"),
stdio: "inherit",
})

if (zigBuild.error) {
console.error("Error: Zig is not installed or not in PATH")
Expand Down Expand Up @@ -124,16 +133,10 @@ if (buildNative) {
}

if (copiedFiles === 0) {
console.error(`Error: No dynamic libraries found for ${platform}-${arch} in ${libDir}`)
console.error(`Expected to find files like: libopentui.so, libopentui.dylib, opentui.dll`)
console.error(`Found files in ${libDir}:`)
if (existsSync(libDir)) {
const files = spawnSync("ls", ["-la", libDir], { stdio: "pipe" })
if (files.stdout) console.error(files.stdout.toString())
} else {
console.error("Directory does not exist")
}
process.exit(1)
// Skip platforms that weren't built (e.g., macOS when cross-compiling from Linux)
console.log(`Skipping ${platform}-${arch}: no libraries found (cross-compilation may not be supported)`)
rmSync(nativeDir, { recursive: true, force: true })
continue
}

const indexTsContent = `const module = await import("./${libraryFileName}", { with: { type: "file" } })
Expand Down
16 changes: 14 additions & 2 deletions packages/core/src/examples/golden-star-demo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun

import { createCliRenderer, CliRenderer, FrameBufferRenderable, BoxRenderable } from "../index"
import { createCliRenderer, CliRenderer, FrameBufferRenderable, BoxRenderable, OptimizedBuffer } from "../index"
import { RGBA } from "../lib"
import { ASCIIFontRenderable } from "../renderables/ASCIIFont"
import type { ASCIIFontName } from "../lib/ascii.font"
Expand Down Expand Up @@ -299,6 +299,15 @@ export async function run(renderer: CliRenderer): Promise<void> {
const HEIGHT = renderer.terminalHeight
const CAM_DISTANCE = 3

const framebufferRenderable = new FrameBufferRenderable(renderer, {
id: "golden-star-main",
width: WIDTH,
height: HEIGHT,
zIndex: 10,
})
renderer.root.add(framebufferRenderable)
const framebuffer = framebufferRenderable.frameBuffer

const engine = new ThreeCliRenderer(renderer, {
width: WIDTH,
height: HEIGHT,
Expand Down Expand Up @@ -450,6 +459,9 @@ export async function run(renderer: CliRenderer): Promise<void> {
const particleSystem = new StarParticleSystem(sceneRoot, 150)

const resizeHandler = (width: number, height: number) => {
if (framebuffer) {
framebuffer.resize(width, height)
}
if (cameraNode) {
cameraNode.aspect = engine.aspectRatio
cameraNode.updateProjectionMatrix()
Expand Down Expand Up @@ -899,7 +911,7 @@ export async function run(renderer: CliRenderer): Promise<void> {
char.bottom = Math.round(Math.max(0, jump))
}

engine.drawScene(sceneRoot, renderer.nextRenderBuffer, deltaTime)
engine.drawScene(sceneRoot, framebuffer, deltaTime)
})
}

Expand Down
Loading
Loading