Repository navigation
feat!: make term updates return void - #166
Merged
Merged
Conversation
Contributor
Changeset suggestionThe current changeset no longer matches this PR. This review contains a corrected replacement. Why: Changeset should start with an approved active present-tense verb. Changeset package scope does not match the affected packages confidently. Changeset bump does not match the consumer-visible impact. View the proposed changeset---
'@bomb.sh/tty': minor
---
Changes `term.update(events)` to return `void` instead of `Uint8Array`.
Dimension and capability changes still apply synchronously; call `term.render()` and write its `output` to reflect them. Multiple `update()` calls before the next render accumulate in call order.
Disabling pointer-shape support no longer resets the terminal's pointer shape. While the capability is `false`, renders emit no shape changes. When re-enabled, the next render compares against the last emitted shape as usual. To reset the pointer to `default`, render without a `pointer` option while the capability is `true` and write the result's `output`.
#### Migration
```diff
-let output = term.update(events);
-if (output.length) stdout.write(output);
+term.update(events);
+let { output } = term.render(ops);
+stdout.write(output);
```Review this changeset manually If this draft is correct, react with 🚀 and Cooper will commit it to this branch. |
commit: |
|
Size Reduced — -1.2 KB 131.2 KB unpacked |
6 of 12 tasks
natemoo-re
approved these changes
Dec 1, 2026
cowboyd
force-pushed
the
feat/state-only-update
branch
from
December 1, 2026 02:23
ba2d1bd to
c791853
Compare
| @@ -0,0 +1,8 @@ | |||
| --- | |||
Contributor
There was a problem hiding this comment.
Changeset needs revision.
Changeset should start with an approved active present-tense verb. Changeset package scope does not match the affected packages confidently. Changeset bump does not match the consumer-visible impact.
View the proposed replacement
---
'@bomb.sh/tty': minor
---
Changes `term.update(events)` to return `void` instead of `Uint8Array`.
Dimension and capability changes still apply synchronously; call `term.render()` and write its `output` to reflect them. Multiple `update()` calls before the next render accumulate in call order.
Disabling pointer-shape support no longer resets the terminal's pointer shape. While the capability is `false`, renders emit no shape changes. When re-enabled, the next render compares against the last emitted shape as usual. To reset the pointer to `default`, render without a `pointer` option while the capability is `true` and write the result's `output`.
#### Migration
```diff
-let output = term.update(events);
-if (output.length) stdout.write(output);
+term.update(events);
+let { output } = term.render(ops);
+stdout.write(output);
```
cowboyd
force-pushed
the
feat/state-only-update
branch
from
December 1, 2026 02:30
c791853 to
74b02ce
Compare
cowboyd
force-pushed
the
feat/state-only-update
branch
from
December 1, 2026 02:34
74b02ce to
b6e8713
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
why?
the replay cache work involves splitting the state into "previous" and "last" frames, which means that rendering transactions should be clearly defined, and only happen via a single mechanism. The "mini-frame" made it unclear where what is actually the last pointer.
This feels better not only internally, but externally as well since the driver does not need to concern itself with output after a call to
term.update()term.update()previously returned terminal bytes, giving hosts a second output path alongsiderender(). It now returnsvoidand applies dimension and capability changes synchronously. Hosts invokerender()to display the resulting state; multiple updates accumulate in call order for that render. The examples now follow this pattern, including rendering after capability changes in 2048.Disabling pointer shape support suppresses all OSC 22 output and preserves the last emitted shape. Re-enabling support compares against that remembered shape. To reset the pointer to default, render without a pointer while support is enabled.
Stacked on #164, now based on
mainafter #162 merged. This implements the reviewedupdate(): voidspec as groundwork for frame ownership and replay; no separate issue is needed.Type of change
Checklist
deno task test: 29 suites, 389 steps)deno task fmt)Also verified the WASM build,
deno task verify,deno lint, example type checks, andgit diff --checkafter rebasing ontomain.AI-generated code disclosure