Skip to content

fix(terminal): fix Chinese Pinyin input on iOS - #4458

Closed
makabakaxy wants to merge 2 commits into
getpaseo:mainfrom
makabakaxy:xiangyu/fix-terminal-ime
Closed

fix(terminal): fix Chinese Pinyin input on iOS#4458
makabakaxy wants to merge 2 commits into
getpaseo:mainfrom
makabakaxy:xiangyu/fix-terminal-ime

Conversation

@makabakaxy

@makabakaxy makabakaxy commented Sep 8, 2026

Copy link
Copy Markdown

Chinese Pinyin input on iOS sends Latin letters before the confirmed Chinese text and can break Backspace. Reported with both Apple and WeChat keyboards on iOS 26.6.

Use native IME composition state to send only confirmed text, handle deletion once, and keep Backspace/Return inside the IME while composing.

Validation: typecheck, lint, formatting, and 39 existing tests pass. Manual event replay covers composition and deletion.

Draft: native iOS build and real-device keyboard testing are still pending.

@makabakaxy makabakaxy changed the title fix(terminal): send only committed iOS IME input fix(terminal): fix Chinese Pinyin input on iOS Sep 8, 2026
@makabakaxy
makabakaxy marked this pull request as ready for review September 8, 2026 02:46
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes iOS terminal input handling to consume native IME composition metadata and emit only committed text to the terminal.

  • Extends the patched React Native Fabric TextInput events with composition and empty-buffer state.
  • Adds an iOS input state machine for committed text, deletion, submission, and native-buffer resets.
  • Enables building React Native from source so iOS builds include the native patch.
  • Adds manual testing instructions for Apple and WeChat Pinyin keyboards.

Confidence Score: 5/5

The current PR has no accepted new findings and appears safe to merge from this review’s perspective.

Both earlier findings—the runtime platform branch and missing adjacent state-machine tests—were manually resolved without explanation, so they are not outstanding and do not reduce merge confidence.

Important Files Changed

Filename Overview
packages/app/src/terminal/native-renderer/terminal-input-state.ios.ts Adds the iOS-specific state machine that suppresses marked text and translates committed edits into terminal input.
packages/app/src/terminal/native-renderer/terminal-input.native.tsx Routes native TextInput change and keypress events through the iOS-aware input state.
patches/react-native+0.81.5.patch Adds iOS composition and native-buffer metadata to Fabric TextInput events.
packages/app/app.config.js Forces iOS React Native source builds so the patched native implementation is included.
docs/mobile-testing.md Documents manual IME regression checks and the native rebuild requirement.

Sequence Diagram

sequenceDiagram
  participant IME as iOS IME
  participant RN as Patched Fabric TextInput
  participant State as iOS Input State
  participant PTY as Terminal PTY

  IME->>RN: marked-text update
  RN->>State: "change(text, isComposing=true)"
  State-->>PTY: no input

  IME->>RN: commit candidate
  RN->>State: "change(text, isComposing=false)"
  State->>PTY: committed text delta

  IME->>RN: Backspace
  RN->>State: keypress/change metadata
  State->>PTY: one delete sequence

  IME->>RN: Return while composing
  RN->>State: "isComposing=true"
  State-->>PTY: no submission

  IME->>RN: Return after composition
  RN->>State: "isComposing=false"
  State->>PTY: carriage return
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into xiangyu/fix-ter..." | Re-trigger Greptile

Comment thread packages/app/src/terminal/native-renderer/terminal-input.native.tsx
@boudra

boudra commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closing for now: this needs a successful native iOS build, on-device Apple and WeChat Pinyin evidence covering composition, candidate confirmation, Backspace and Return, and regression coverage for the new input state machine. Please reopen with that evidence.

@boudra boudra closed this Sep 8, 2026
@boudra

boudra commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Please disregard the earlier invitation to reopen with evidence. This PR remains closed unless I explicitly follow up. You don't need to resubmit this PR or provide further QA evidence.

Please read the updated PR policy. For now, I'm automatically closing feature PRs so I can focus more time on bug fixes and core improvements. Focused bug-fix PRs with a clear reproduction and QA are still welcome. The previous guide already asked contributors to submit only if they were comfortable with closure, and explained that unsolicited PRs could be closed without a detailed review.

For feature ideas, please start in GitHub Discussions and share your workflow: what you're trying to do, how you do it today, and where Paseo gets in the way. If there's already a discussion about it, join in and share your use case. I'll periodically review discussions for highly requested workflows and use that feedback to shape the roadmap.

I'll periodically look through closed PRs and choose which contributions to take forward, whether solicited or unsolicited. I may reopen a PR, including one closed by mistake, or use it as a reference for my own implementation, with attribution either way.

There are hundreds of PRs alongside ongoing development. I can't commit to reviewing every submission, providing individual feedback or giving timelines.

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