Skip to content

Add terminal resize stream - #9639

Merged
tim-smart merged 6 commits into
Effect-TS:v4/next-minorfrom
jpowersdev:terminal-resize
Oct 21, 2026
Merged

tim-smart merged 6 commits into
Effect-TS:v4/next-minorfrom
jpowersdev:terminal-resize

Conversation

@jpowersdev

@jpowersdev jpowersdev commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Expose terminal size changes through Terminal.size so CLI renderers can respond to window changes.

Terminal.size is Effect<Queue.Dequeue<Size, Cause.Done>, never, Scope>, matching readInput. The resize listener is attached by the time the effect returns, so no resize is missed between subscribing and consuming. On Node, Bun, and Deno the queue starts with the current dimensions and uses a sliding capacity of 1, so a slow consumer only sees the latest size. Closing the scope removes the listener and ends the queue. Use Stream.unwrap(Effect.map(terminal.size, Stream.fromQueue)) to consume it as a stream.

Each subscription adds its own resize listener to process.stdout, so holding more than ten subscriptions at once triggers Node's MaxListenersExceededWarning; subscribe once and fan out, or raise the limit with setMaxListeners.

Terminal.make now requires size, so custom terminals built with it must supply one.

Closes #6352
Closes EFF-2620

@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 378951a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
effect Minor
@effect/platform-node-shared Minor
@effect/opentelemetry Minor
@effect/vitest Minor
@effect/ai-anthropic Minor
@effect/ai-cloudflare Minor
@effect/ai-openai-compat Minor
@effect/ai-openai Minor
@effect/ai-openrouter Minor
@effect/ai-typesafe Minor
@effect/atom-react Minor
@effect/atom-solid Minor
@effect/atom-vue Minor
@effect/platform-browser Minor
@effect/platform-bun Minor
@effect/platform-deno Minor
@effect/platform-node Minor
@effect/sql-clickhouse Minor
@effect/sql-d1 Minor
@effect/sql-libsql Minor
@effect/sql-mssql Minor
@effect/sql-mysql2 Minor
@effect/sql-pg Minor
@effect/sql-pglite Minor
@effect/sql-sqlite-bun Minor
@effect/sql-sqlite-do Minor
@effect/sql-sqlite-node Minor
@effect/sql-sqlite-react-native Minor
@effect/sql-sqlite-wasm Minor
@effect/docgen Minor
@effect/doctest Minor
@effect/graphql-generator Minor
@effect/openapi-generator Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-bot
effect-bot changed the base branch from main to v4/next-minor October 20, 2026 23:26
@tim-smart
tim-smart enabled auto-merge (squash) October 20, 2026 23:56
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.16 KB 39.16 KB 0.00 KB (0.00%)
basic.ts 7.07 KB 7.07 KB 0.00 KB (0.00%)
batching.ts 10.93 KB 10.93 KB 0.00 KB (0.00%)
brand.ts 6.71 KB 6.71 KB 0.00 KB (0.00%)
cache.ts 11.37 KB 11.37 KB 0.00 KB (0.00%)
config.ts 22.53 KB 22.53 KB 0.00 KB (0.00%)
differ.ts 21.68 KB 21.68 KB 0.00 KB (0.00%)
http-client.ts 24.59 KB 24.59 KB 0.00 KB (0.00%)
http-router.ts 35.72 KB 35.72 KB 0.00 KB (0.00%)
logger.ts 11.71 KB 11.71 KB 0.00 KB (0.00%)
metric.ts 9.30 KB 9.30 KB 0.00 KB (0.00%)
optic.ts 6.93 KB 6.93 KB 0.00 KB (0.00%)
pubsub.ts 15.81 KB 15.81 KB 0.00 KB (0.00%)
queue.ts 12.63 KB 12.63 KB 0.00 KB (0.00%)
schedule.ts 11.61 KB 11.61 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 13.87 KB 13.87 KB 0.00 KB (0.00%)
schema-binary.ts 40.55 KB 40.55 KB 0.00 KB (0.00%)
schema-class.ts 21.39 KB 21.39 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 32.35 KB 32.35 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.55 KB 27.55 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.11 KB 15.11 KB 0.00 KB (0.00%)
schema-string.ts 12.13 KB 12.13 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.05 KB 16.05 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.68 KB 38.68 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 25.73 KB 25.73 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.61 KB 20.61 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 20.80 KB 20.80 KB 0.00 KB (0.00%)
schema-toFormatter.ts 20.90 KB 20.90 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 25.54 KB 25.54 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 20.90 KB 20.90 KB 0.00 KB (0.00%)
schema.ts 20.57 KB 20.57 KB 0.00 KB (0.00%)
stm.ts 13.91 KB 13.91 KB 0.00 KB (0.00%)
stream.ts 10.16 KB 10.16 KB 0.00 KB (0.00%)

@tim-smart
tim-smart merged commit d912c8b into Effect-TS:v4/next-minor Oct 21, 2026
16 of 17 checks passed
@effect-bot effect-bot mentioned this pull request Oct 21, 2026
effect-bot added a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit to devangpratap/effect that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit to lloydrichards/open_effect that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit to lloydrichards/open_effect that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit to lloydrichards/open_effect that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit to lloydrichards/open_effect that referenced this pull request Oct 21, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
tim-smart pushed a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 23, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 23, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 23, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
effect-bot added a commit that referenced this pull request Oct 23, 2026
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] add size change observer on Terminal

3 participants