Skip to content

fix(native): terminal not updated on new capabilities#877

Open
AnatoleLucet wants to merge 2 commits intoanomalyco:mainfrom
AnatoleLucet:fix/capabilites-initial-render
Open

fix(native): terminal not updated on new capabilities#877
AnatoleLucet wants to merge 2 commits intoanomalyco:mainfrom
AnatoleLucet:fix/capabilites-initial-render

Conversation

@AnatoleLucet
Copy link
Copy Markdown

When rendering right after creating the renderer, features that depend on special capabilities (e.g. hyperlinks) won't work right away because the capability response has not been processes/received yet.
It results in a terminal output were some features won't work until their cells are updated.

For instance:

const rdr = await createCliRenderer();

const l = new TextRenderable(rdr, {
  content: t`a link: ${link("https://google.com")(underline("Click Me!"))}`,
});
rdr.root.add(l);

If we render a simple link right after creating the renderer (on a terminal that supports OSC8), the link won't work until these cells are re-rendered by the renderer, because the initial render did not send the OSC8.

To fix it, i added a forced render after processing new capabilities to make sure every feature works correctly with the latest capabilities.

@AnatoleLucet AnatoleLucet changed the title fix(native): output not updated when new capabilites fix(native): terminal not updated on new capabilities Mar 26, 2026
@AnatoleLucet AnatoleLucet force-pushed the fix/capabilites-initial-render branch 2 times, most recently from 0f0afe0 to 74da178 Compare March 27, 2026 10:56
@AnatoleLucet AnatoleLucet force-pushed the fix/capabilites-initial-render branch from 74da178 to 244d274 Compare March 27, 2026 10:59
@AnatoleLucet
Copy link
Copy Markdown
Author

AnatoleLucet commented Mar 27, 2026

made a little update to the pr because i realized my previous fix in the zig renderer could produce half-baked renders if stdin is processed mid-draw.

demo of the issue with my hold fix
screenrecording-2026-03-27_11-29-39.mp4

this is now fixed. i moved the "re-render when receiving capabilities" logic to typescript so it can be properly scheduled with the rest.

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.

2 participants