fix(terminal): fix Chinese Pinyin input on iOS - #4458
Conversation
|
| 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
Reviews (2): Last reviewed commit: "Merge branch 'main' into xiangyu/fix-ter..." | Re-trigger Greptile
|
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. |
|
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. |
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.