Skip to content

fix: preserve multibyte input in alternate-screen TUI - #744

Merged
will-lamerton merged 1 commit into
Nano-Collective:mainfrom
RealBhupesh:codex/fix-korean-input
Aug 5, 2026
Merged

will-lamerton merged 1 commit into
Nano-Collective:mainfrom
RealBhupesh:codex/fix-korean-input

Conversation

@RealBhupesh

Copy link
Copy Markdown
Contributor

Summary

  • Decode alternate-screen stdin with a stateful UTF-8 decoder so multibyte characters are preserved across data chunk boundaries.
  • Keep the existing mouse-sequence filtering and wheel-event handling unchanged after decoding.
  • Add regression coverage that splits Korean input inside a character, plus the current settings-tab contract needed by the upstream test suite.

Closes #532

Root cause

The alternate-screen input proxy converted every Buffer chunk with Buffer#toString('utf8'). When a terminal or IME split a multibyte character across chunks, the incomplete byte sequence was replaced before the next chunk arrived. The decoder now retains incomplete sequences and emits the character only after all bytes are available.

Validation

  • pnpm exec ava source/utils/terminal-mouse.spec.ts source/app/components/settings-tabs.spec.tsx
  • pnpm test:ava (6,255 passed, 1 skipped)
  • pnpm test:format
  • pnpm test:lint
  • pnpm test:types
  • pnpm build

@RealBhupesh

Copy link
Copy Markdown
Contributor Author

Update: all required GitHub Actions checks are passing, including CodeQL, unit tests, coverage, type checks, linting, formatting, and the build. The PR is technically mergeable; the remaining step is maintainer review and approval.

@will-lamerton

Copy link
Copy Markdown
Member

Nice work @RealBhupesh :)

@will-lamerton
will-lamerton merged commit 15a2250 into Nano-Collective:main Aug 5, 2026
11 checks passed
@RealBhupesh

Copy link
Copy Markdown
Contributor Author

Nice work @RealBhupesh :)

Thank you so muchh ❤️

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.

[Feature] korean

2 participants