1002 Commits

Author SHA1 Message Date
Simon Klee 4954312d74 chore: packaging and test fixes (#1517)
pPacked parser asset paths, runtime-plugin string-literal rewrites, Node
snapshot parsing, Solid plugin file reads, SSH test retries, Node
example argv forwarding, etc. etc.
2026-09-18 11:09:57 +02:00
Simon Klee c01292fd08 text-buffer: preserve inline continuation alignment (#1511)
When a scrollback snapshot starts in the middle of a line, its first
fragment continues text already written to the terminal. Keep it flush
with the preceding tail so rendering and hit testing identify the same
cells.
2026-09-17 12:47:43 +02:00
Jensen 9b8b4c853a fix(core): support transparent background in embedded terminals (#1502)
Fixes #1501

Adds `transparentBackground` (default `false`) to
`EmbeddedTerminalRenderable`.
Enabled, cells with no explicit background compose with the `.default`
intent
(SGR 49), so the host terminal's background shows through; explicitly
painted
backgrounds stay opaque. Hot-switchable.

Tests: native `tests.zig` (off → `.rgb`, on → `.default`, explicit
unchanged) and
`EmbeddedTerminal.test.ts` (off → on → off). Native suite 2,148 passed /
32 skipped;
core file 32 passed; fmt and lint clean.

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-09-17 12:47:10 +02:00
avrl 871119e9e4 Docs website Scrollbar fix (#1510)
make the scrollbar style blend in with the website theme.

Thanks.

<img width="2530" height="1090" alt="image"
src="https://github.com/user-attachments/assets/e0b99842-3582-4160-a157-6fbb9cc661ba"
/>

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-09-16 11:13:29 +02:00
Simon Klee f3018fa86d docs: document text alignment (#1509)
Clarify that alignment applies after wrapping and uses display-cell
width.
Distinguish it from Yoga layout so measurement and selection behavior
stay
predictable.

0924679971
2026-09-16 10:50:34 +02:00
Simon Klee f015a73f3e core: keep worker error listener on termination (#1508)
A worker can emit an error while termination is pending. Keep its
listener attached so Node does not turn that failure into an uncaught
exception.
2026-09-16 10:20:18 +02:00
avrl 0924679971 feat: implement per-line text alignment support textAlign (#1507)
Fixes: #916 

Implemented this textAlign feature for left | center | right positions.

Works fine for both wraps (chars and words).

It was straightforward  to add padding = total cols - line_length.
Please let me know if I missed anything.


https://github.com/user-attachments/assets/cd45ffff-9ad7-47a7-b3db-bf6e758f36c6

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-09-16 07:37:08 +00:00
Yusuf Efe f532fa7b2b fix(core): pass markdown fg through to table cells (#1503)
Fixes #1432.

`MarkdownRenderable` passes its `fg` to prose, code blocks and quotes,
but not to tables, so table text always comes out in
`TextTableRenderable`'s `#FFFFFF` default.

- pass `fg` when the table is created and when table options are
re-applied
- add an `fg` setter to `TextTableRenderable` that updates existing
cells, so changing `fg` on the markdown later recolours the table too
(the style rerender reuses the table, so a constructor option alone
isn't enough)

Added a test that checks header and body cells use the markdown `fg`,
then changes it. It fails on `main` and passes with this. `bun test
src/renderables` and `bun run typecheck` pass locally (Windows, prebuilt
0.5.11 native lib).
2026-09-15 20:35:52 +02:00
Simon Klee 0491dc19e9 editor: allow cursor reads after destruction (#1504)
Destroyed listeners may inspect cursor state after native resources are
released. Return an empty cursor so cleanup notifications do not throw.
2026-09-15 14:17:52 +02:00
Simon Klee ac753b48d3 renderer: fix split-footer resize cleanup (#1488)
A width shrink could clear below a settling footer, leaving stale rows
visible. Clear from the visible footer origin while preserving pinned
cleanup.

Supersede #1487
Fix #1486
2026-09-09 12:45:31 +02:00
avrl 97a20ab249 feat: add comprehensive mouse pointer style support and update related functionality (#1037)
This fixes #1032, but there since there are no standard for supporting
OSC22 across terminals, there are different cursor types unsupported on
different terminal app (ghostty, kitty, etc).

https://github.com/user-attachments/assets/dc0b8399-fe3f-462a-9ca3-8636876c77ca

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-09-09 09:14:21 +00:00
OpenCode Agent 6b9863ea7c Release v0.5.11 2026-09-07 10:42:03 +00:00
opencode-agent[bot] 62a7c38289 feat(core): support PCM through the shared audio stream interface (#1481)
---------

Co-authored-by: Filip Hejmowski <fhejmowski@simplito.com>
Co-authored-by: neriousy <34747899+neriousy@users.noreply.github.com>
Co-authored-by: kommander <335157+kommander@users.noreply.github.com>
Co-authored-by: Tilda <tilda@localhost>
2026-09-07 12:30:18 +02:00
Simon Klee 7581976f4d markdown: fix hyperlink rendering and detection (#1442)
Make named and bare links clickable without exposing their destinations
when the terminal supports OSC 8. Preserve visible URL fallbacks
elsewhere and keep links intact across formatting, streaming, wrapping,
and late terminal capability detection.

Fix #1439
2026-09-04 21:30:50 +02:00
LIU Xinyu 9c55da3a63 feat(native): allow line wrapping between CJK characters (#1453)
Closes https://github.com/anomalyco/opentui/issues/1183.

---------

Co-authored-by: OpenCode Agent runtime <opencode-agent@msg-bot-e4abd35d1d114f2aa16fe1d2.exe.xyz>
Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-09-04 21:10:35 +02:00
Simon Klee 0733b5382c runtime: support Bun 1.4 (#1400) 2026-09-04 21:09:49 +02:00
Simon Klee f1b320aa74 ci: skip symbols in dependent package builds (#1476)
Speedup some ci things.

Releases still publish all eight native symbol archives, including
Windows. The symbol generation, verification, and release-upload steps
are unchanged.
2026-09-04 20:58:03 +02:00
Simon Klee 87271aff19 web: add another color theme (#1478) 2026-09-04 20:33:12 +02:00
Kit Langton aef16edbac fix(core): preserve keyboard layouts in embedded terminals (#1477)
## Why

In OpenCode's embedded terminal, Dvorak Ctrl+U and Ctrl+D can reach
Neovim as Ctrl+F and Ctrl+H when the child uses Kitty keyboard encoding.
Paging up instead pages down, and paging down moves the cursor left.

The incoming Kitty event correctly separates the active-layout character
from its base-layout alternative. `EmbeddedTerminalRenderable` currently
passes the alternative as the native encoder's unshifted character,
changing the key's identity.

## What Changes

Keep the active-layout character as the primary key, and use the
base-layout alternative only to infer the physical key when an explicit
physical code is unavailable.

| Incoming Dvorak input | Before | After |
| --- | --- | --- |
| Plain u, base-layout F | u (117), byte `75` hex | Unchanged |
| Ctrl+U, base-layout F | Ctrl+F | Ctrl+U |
| Ctrl+D, base-layout H | Ctrl+H | Ctrl+D |
| Ctrl+Shift+U, base-layout F | Ctrl+Shift+F | Ctrl+Shift+U |

If the child requests alternate-key reporting, the original base-layout
alternative remains available separately. Legacy control-byte output
stays unchanged.

This explains why ordinary typing can work while control shortcuts fail:
in the reproduced Kitty mode, plain letters use the translated text,
while control shortcuts use the incorrectly selected key codepoint.
Ctrl+U becomes `ESC[102;5u` instead of `ESC[117;5u`; Ctrl+D becomes
`ESC[104;5u` instead of `ESC[100;5u`.

Regression coverage parses real Kitty sequences and exercises the native
encoder. One table covers plain Dvorak u/d, control shortcuts, Shift,
Cyrillic input, a QWERTY control case, legacy child mode, and
alternate-key reporting. A focused-delivery test covers
press/repeat/release events.

## Demo

Real Neovim 0.12.4 running in the existing `embedded-terminal-demo.ts`
example with the production `EmbeddedTerminalRenderable`. The inspector
shows:

1. The received key, active-layout and base-layout codepoints, and raw
input sequence.
2. The actual `onData` output forwarded unchanged to the PTY, in escaped
and hexadecimal form. The inspector does not re-encode the key.
3. Neovim's independently observed key via `vim.on_key`, plus its
resulting cursor position.

Each case starts at line 80, column 8, with `scroll=8`. Plain u is typed
in Insert mode; Ctrl+D/U are pressed in Normal mode. The clean Neovim
fixture explicitly enables Kitty mode with `CSI > 1 u`; Dvorak Kitty
input sequences are injected at the outer terminal boundary rather than
generated by an OS keyboard layout.

Before uses the unchanged `EmbeddedTerminal.ts` from `fe547ebe`, loaded
through a test-only module override. After uses `03b84c9a`. The three
independent cases are reordered to show plain typing first, slowed to
0.1×, and held for four seconds each; setup and resets are omitted. Both
processes returned cleanly after the check.

**Before:** Plain u stays 117. Ctrl+D changes 100 → 104 and Neovim sees
`<C-H>`; Ctrl+U changes 117 → 102 and Neovim sees `<C-F>`.


https://github.com/user-attachments/assets/6e1b469f-e4d2-4298-a095-8f422e10a8d0

**After:** Plain u still works. Ctrl+D stays 100 and Neovim sees
`<C-D>`; Ctrl+U stays 117 and Neovim sees `<C-U>`.


https://github.com/user-attachments/assets/b825e1f0-b7e6-4f1b-a112-e780a9f34fe8

## Scope

This fixes OpenTUI's embedded-terminal key adapter, without
application-specific remapping or a public API change. OpenCode will
need to adopt an OpenTUI release containing the fix.

## Verification

```sh
cd packages/core
bun run test src/renderables/EmbeddedTerminal.test.ts
bun run typecheck
bun run test:js:node
bun run build:lib
bun run test
cd ../..
bun run fmt:check
bun run lint
```

- Focused suite: seven regressions fail with the baseline encoder, while
plain typing passes; all 31 tests pass afterward. Rechecked after
consolidating the repeated test setup.
- Full Bun suite after building the parser assets: 5,587 passed, 26
skipped, zero failures. The initial unbuilt-worktree run failed only
because `parser.worker.js` was absent.
- Node suite: 4,842 passed, seven skipped, zero failures.
- Typechecking, formatting, and lint pass.
- Real PTY before/after verification shown above.
2026-09-03 20:37:56 -04:00
Kit Langton fe547ebed1 fix(core): realign split diffs after resizing (#1463) 2026-09-02 22:53:33 +02:00
Kit Langton fccce4ec13 fix(core): bound large diff rendering work (#1462)
---------

Co-authored-by: Sebastian <335157+kommander@users.noreply.github.com>
2026-09-02 22:21:24 +02:00
OpenCode Agent runtime f6673a04cc Release v0.5.10 2026-09-01 15:38:50 +00:00
Sebastian 09a0dd695d fix(native): ship stripped libraries with separate release symbols (#1437) 2026-08-31 22:38:28 +02:00
Simon Klee 24ace6a6e7 renderer: preserve native scrollback images (#1470)
Requiring a pinned footer forces scrollback images to fall back to
blocks during startup and after resize replay resets. Allow Kitty and
Sixel images before pinning when they fit above the pinned footer to
preserve image quality while the footer settles.
2026-08-31 22:02:43 +02:00
opencode-agent[bot] c45f25ed24 fix(core): preserve markdown during stream completion (#1469) 2026-08-31 16:19:21 +02:00
Sebastian ac8543c4d0 fix(core): retry the final automatic frame after backpressure (#1457) 2026-08-31 16:18:05 +02:00
Simon Klee c1a52d2114 renderer: reduce image streaming overhead (#1467)
Reduce frame preparation and transport costs so local terminals can
consume image updates with less CPU work. Bound pending frames when
output stalls and fix per-frame GPU resource growth so sustained
rendering does not accumulate work or retain native handles.

Keep raw transport as the default and make file transport opt-in for
terminals that acknowledge image uploads.

#1328 partially superseded, but it has `NativeImage.adoptRgbaFile(path,
width, height)` that adopts an existing producer-created RGBA file
lazily. Eligible renders send that same path without reading, copying,
or rewriting its pixels.
2026-08-30 22:21:36 +02:00
Sebastian 202e1e6a00 docs: improve OpenTUI skill guidance (#1461)
Document compact layouts and companion packages.

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-08-28 12:38:20 +02:00
OpenCode Agent runtime df2fc1594b Release v0.5.9 2026-08-27 23:00:22 +00:00
Sebastian 20f669256d perf(native): reduce word layout work with eager view metadata (#1456) 2026-08-28 00:48:15 +02:00
Sebastian fbd584b28e fix(native): expose Yoga C API to Zig consumers (#1454) 2026-08-27 15:54:59 +02:00
Sebastian ab1a2aaf9b fix(core): preserve edit cursors across tab widths (#1449) 2026-08-27 15:54:09 +02:00
Sebastian 8d1dceb717 perf(core): skip tab refresh for tab-free roots (#1450) 2026-08-27 15:00:21 +02:00
Sebastian f49c935ccb fix(native): preserve mixed whitespace graphemes (#1447) 2026-08-27 14:33:41 +02:00
Sebastian bd823a02b8 fix(native): preserve truncated copy ranges (#1448) 2026-08-27 14:11:59 +02:00
James Long a57c2e40f4 fix(core): limit embedded terminal selection highlights to text (#1451) 2026-08-27 13:44:08 +02:00
Sebastian de0b5f2091 docs: document shared Zig cache for worktrees (#1452)
Document the opt-in shared Zig local cache workflow for repeated native
builds across worktrees.

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-08-27 09:08:33 +02:00
Simon Klee 7a0dca8d5e web: add rendered terminal examples to docs (#1446)
Show actual OpenTUI output beside documentation examples so readers
can see component behavior without running an application.
2026-08-26 21:04:05 +02:00
Simon Klee 33203b5029 native: prove styled text without JavaScript (#1419) 2026-08-26 17:29:03 +02:00
Simon Klee e1ad51afcd ssh: assert error code for occupied ports (#1444) 2026-08-26 16:41:47 +02:00
Simon Klee c1f2409947 ffi: preserve viewport lookup success result (#1443)
The native viewport lookup reports whether a view exists, but the FFI
binding discarded that result. Preserve the boolean so callers can
distinguish missing views from successful lookups.
2026-08-26 14:36:41 +02:00
m-pa 010c07df29 fix(core): align bordered hit-grid clipping (#1441)
## Summary
- align hit-grid scissor coordinates with bordered content bounds
- preserve correct clipping for buffered, nested, partial-border, and
scrollable containers
- add regression coverage for final-row and final-column hit targets

Fixes anomalyco/opentui#1231

## Verification
`bun test src/tests/scrollbox-hitgrid.test.ts`

---------

Co-authored-by: Simon Klee <hello@simonklee.dk>
2026-08-26 11:04:09 +00:00
Simon Klee 352c1fc59b renderer: ignore invalid terminal dimensions (#1440)
Prevent resize signals with unavailable terminal dimensions from
resetting the renderer to an arbitrary 80x24 fallback.

Supersede #687
2026-08-26 10:50:26 +02:00
Sebastian 465c3ccad0 refactor(core): clarify text layout units (#1429) 2026-08-25 22:52:07 +02:00
Sebastian d2089a81ae refactor(core): make wrapped layout byte-accurate (#1428) 2026-08-25 22:33:47 +02:00
Sebastian 8046c846cf feat(native): export audio module to Zig consumers (#1431) 2026-08-25 16:05:01 +02:00
Simon Klee dd3dce90dd renderer: preserve wide grapheme updates (#1424)
Incremental updates could start output within a wide grapheme and corrupt
it. Begin updates at printable cells to preserve the grapheme.
2026-08-25 09:20:22 +02:00
Simon Klee da717b74a1 renderer: resolve snapshot links from snapshot pool (#1418) 2026-08-25 09:16:46 +02:00
Simon Klee 29243aa294 renderer: prevent backpressure revive (#1170)
A backpressured frame could schedule a retry after its callback paused
or
stopped the renderer, reviving a cancelled continuous loop.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-25 06:52:42 +02:00
James Long a7fb4ec78e feat(native): filter Ghostty logs (#1426)
## Summary
- recognize the selected Ghostty `std.log` scopes in OpenTUI's root
logger
- keep all standard-library logs silent by default
- read `OTUI_GHOSTTY_LOG_LEVEL` inside the native `logFn` and forward
enabled messages through the existing `logger.logMessage` path
- support `error`/`err`, `warn`/`warning`, `info`, and `debug`
thresholds
- document the environment variable

## Behavior
Unset or invalid `OTUI_GHOSTTY_LOG_LEVEL` values emit no `std.log`
messages. Recognized Ghostty scopes are forwarded up to the configured
severity. Logs from every other scope are discarded. Explicit OpenTUI
logger calls are unchanged.

## Testing
- release `bun run build` from `packages/core`
- `bun run test:native` from `packages/core` (2066 passed, 8 skipped)
- `zig fmt --check packages/native/src/lib.zig
packages/native/src/logger.zig`
- `oxfmt --check packages/web/src/content/docs/reference/env-vars.mdx`
2026-08-24 16:58:16 -04:00