Skip to content

Reinstate ink alt-screen render fix (#639) via forked ink + npm: alias #663

@esengine

Description

@esengine

Background

0.39.0 introduced a patches/ink+7.0.2.patch (1-line change to ink's render path) for issue #639 — alt-screen ghosting / log-update drift on CJK terminals where Yoga undercounts visual rows. It was wired up via postinstall: patch-package.

This approach can't work for a published library:

  • patch-package looks for ./node_modules/<dep> relative to itself
  • When reasonix is installed as a dependency, npm hoists ink to the consumer's top-level node_modules/ink
  • patch-package runs from node_modules/reasonix/ and finds nothing

0.39.0 also shipped without patch-package in dependencies and without patches/ in the files array, so the postinstall threw 'patch-package' is not recognized as an internal or external command on every fresh install. 0.39.0 has been deprecated on npm and the entire patch-package machinery is removed in 0.39.1.

Plan

Fork ink@7.0.2 with the alt-screen render patch applied, publish under a new name, and switch the dependency via the npm: alias mechanism.

  • Fork vadimdemedes/ink at the 7.0.2 tag
  • Apply the alt-screen render diff (1-line OR in Ink.render, see patches/ink+7.0.2.patch in 0.39.0 git history for the exact change)
  • Publish as reasonix-ink@7.0.2-reasonix.0 (or @esengine/ink) — name TBD
  • In reasonix package.json change "ink": "^7.0.2" to "ink": "npm:reasonix-ink@7.0.2-reasonix.0" with exact pin
  • Add a smoke test that mounts a fake ink app in alt-screen mode and asserts the per-frame clear hits

Parallel: upstream PR

Also submit the same change upstream to vadimdemedes/ink as a PR. If it lands and ships, drop the fork and switch back to "ink": "^X.Y.Z".

Why this matters

Tracked symptom from #639: terminals showing ghosted prompt lines / scroll drift on Chinese/CJK input under alt-screen mode. 0.38.0 had the bug. 0.39.0 broke install while trying to fix it. 0.39.1 reverted the fix attempt — until this lands, the bug is present again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv1Legacy TypeScript line (0.x) — v1 branch, maintenance only

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions