Skip to content

[Bug]: Orca Mobile terminal cannot enter Japanese via flick or romaji IME #7427

Description

@Chachamaru127

Summary

Orca Mobile terminal input cannot enter Japanese text. Both Japanese flick/kana input and romaji-to-kana/kanji conversion fail, so Japanese users cannot reliably type commands, prompts, or free text into the mobile terminal.

Reproduction

  1. Open Orca Mobile and connect to a paired desktop host.
  2. Open a session terminal.
  3. Focus the terminal input surface / direct terminal input.
  4. Switch the phone keyboard to Japanese.
  5. Try either:
    • kana flick input, e.g. こんにちは
    • romaji input with conversion, e.g. type nihongo and convert/commit 日本語

Expected

The IME composition should be allowed to complete, and the committed Japanese text should be sent to the PTY exactly once after commit.

Actual

Japanese composition is interrupted or cleared before a valid committed string reaches the terminal. This affects both flick/kana input and romaji conversion.

Impact

This blocks a basic day-to-day workflow for Japanese users on Orca Mobile. It also affects SSH/remote terminal use, because the mobile client forwards input through the same terminal send path.

Likely cause / code pointers

The mobile terminal live input path appears to treat every TextInput.onChangeText value as committed terminal bytes, sends it immediately, then clears the native text field:

  • mobile/app/h/[hostId]/session/[worktreeId].tsx:
    • handleLiveInputChange normalizes text, calls sendLiveTerminalInput(activeHandle, normalizedText), then resets liveInputCapture and calls liveInputRef.current?.setNativeProps({ text: '' }).
    • the live capture TextInput wires onChangeText={handleLiveInputChange}, onKeyPress={handleLiveInputKeyPress}, and onSubmitEditing={handleLiveInputSubmit}.
  • mobile/src/terminal/terminal-keyboard-type.ts already returns keyboardType="default", so non-Latin IMEs should remain selectable. The likely breakage is composition lifecycle handling, not keyboard availability.
  • mobile/mobile-terminal-direct-input-default.md documents that direct terminal input is the default for first-seen terminal tabs, so this path is now the default path for mobile terminal users.

IME pre-edit text is not equivalent to committed terminal text. Clearing the native TextInput during composition likely cancels or corrupts the IME state, which explains why both flick input and romaji conversion fail.

Related issues to keep in mind:

Candidate fix direction

A robust fix likely needs an IME-aware terminal input path rather than treating every onChangeText as terminal-ready bytes.

Possible approaches:

  1. Add a native composition-aware input bridge for mobile live input:
    • iOS: do not forward marked text while UITextInput.markedTextRange is present; forward only committed text.
    • Android: forward committed text from InputConnection.commitText / final composition events instead of forwarding pre-edit updates.
    • clear the capture field only after committed text has been forwarded and composition has ended.
  2. As a smaller fallback, provide an explicit IME-safe mobile terminal input mode that preserves the TextInput value through composition and flushes only on Send/Enter, while keeping byte-by-byte direct input for ASCII/special-key workflows.
  3. Add regression coverage with Japanese IME-like sequences, including flick-style committed kana and romaji composition/commit, and ensure no intermediate pre-edit text is sent to terminal.send.

Until fixed, a partial workaround may be to switch the terminal back to the buffered command input mode, because that path keeps the React Native TextInput value until submit. That is not a full replacement for terminal-native workflows and may still need an IME Enter-confirmation guard.

Activity

  1. Chachamaru127 commented on Jul 5, 2026

    @Chachamaru127
    Author

    Additional user-observed symptom:

    When using Japanese input on Orca Mobile, pressing the IME confirm/commit key (確定) appears to immediately send the current text to the terminal rather than just committing the composition. The user also reports punctuation/period input being transformed into kaomoji such as ^_^ and then sent.

    This strengthens the suspicion that the mobile live terminal input path is conflating IME composition/commit actions with terminal-ready input and/or submit/Enter handling. The fix should explicitly distinguish:

    • IME pre-edit/composition updates
    • IME commit/confirm (確定)
    • terminal Enter / submit
    • punctuation candidate selection such as Japanese keyboard kaomoji candidates

    Acceptance criteria should include a Japanese mobile keyboard case where pressing 確定 only commits text locally and does not send Enter or flush unintended candidates like ^_^.

  2. Chachamaru127 commented on Jul 5, 2026

    @Chachamaru127
    Author

    Additional Japanese kana-keyboard detail:

    The failure is not limited to pressing the final IME confirm key. On a Japanese kana/flick keyboard, some characters are composed by entering a base kana and then pressing the lower-left modifier key for dakuten/handakuten/small-kana variants.

    Observed example:

    • User enters つ.
    • To make small っ, the user flicks/presses the small-character modifier button afterward.
    • Orca Mobile has already sent つ to the terminal at the moment the base kana appears.
    • The later small-character modifier no longer modifies つ; instead, it appears to commit/send the first kaomoji candidate such as ^_^.

    This likely affects:

    • small kana: つ -> っ, や -> ゃ, etc.
    • dakuten: か -> が, た -> だ, etc.
    • handakuten: は -> ぱ
    • punctuation/candidate keys that share the same Japanese keyboard modifier/candidate surface

    This points more specifically to the live input path forwarding transient TextInput.onChangeText values before the Japanese keyboard has finished its local composition/modifier sequence. The fix should treat kana modifier operations as part of IME composition and must not forward the base kana until the IME has produced committed text.

    Regression cases to add:

    • Kana flick: compose っ from つ + small-kana modifier; terminal receives only っ, not つ or ^_^.
    • Kana flick: compose が from か + dakuten; terminal receives only が.
    • Kana flick: compose ぱ from は + handakuten; terminal receives only ぱ.
  3. Chachamaru127 commented on Jul 5, 2026

    @Chachamaru127
    Author

    Additional romaji-input detail:

    This also reproduces with Japanese romaji input, not only kana/flick input.

    Observed example:

    • User tries to enter さ using romaji input (s + a).
    • Orca Mobile sends/types sあ instead of producing committed さ.

    This is another concrete signal that the terminal live input path is forwarding intermediate IME state. The s is emitted before the IME can combine it with the following vowel into the kana syllable, and the subsequent input is then committed separately.

    Regression case to add:

    • Japanese romaji input: type s then a; terminal receives only さ, not sあ.
  4. Chachamaru127 commented on Jul 5, 2026

    @Chachamaru127
    Author

    Feasibility note after checking platform APIs and the current mobile stack:

    This is fixable on the mobile app side. It is not something the desktop/PTY side can reconstruct after the fact, because by then intermediate text such as s or base kana such as つ has already been sent as terminal bytes.

    Findings:

    • React Native TextInput exposes onChangeText, onKeyPress, and onSubmitEditing, but it does not provide a documented cross-platform composition lifecycle equivalent to web compositionstart / compositionend.
    • The current live-input implementation in mobile/app/h/[hostId]/session/[worktreeId].tsx sends every onChangeText value through terminal.send, then clears the native field with setNativeProps({ text: '' }). That is hostile to Japanese IME pre-edit state.
    • Android's IME model explicitly separates setComposingText(...) from commitText(...); a mobile terminal input view can intercept/track composition and only forward committed text.
    • iOS multistage input requires UITextInput support and marked text tracking (markedTextRange / marked text). A native UIKit input view can avoid forwarding marked text until it is committed.
    • Orca Mobile is already an Expo dev-client app with local native module precedent (mobile/packages/expo-two-way-audio), so adding a small native input view/module is within the current app architecture.

    Recommended fix shape:

    1. Keep the existing buffered input as the short-term IME-safe fallback.
    2. Replace the hidden live TextInput capture surface with a dedicated native IME-aware terminal input view.
    3. That view should emit separate JS events for:
      • committedText: safe to send to terminal.send
      • composingText/currentMarkedText: display/debug only, not sent
      • enter/submit: terminal Enter only when it is not an IME confirmation
      • special keys/backspace/accessory keys: existing byte mapping path
    4. Add regression cases for:
      • s + a -> terminal receives only さ, not sあ
      • つ + small-kana modifier -> terminal receives only っ, not つ or ^_^
      • か + dakuten -> terminal receives only が
      • IME 確定 does not send terminal Enter

    So the answer is: yes, fixable, but robustly fixing the default direct-input terminal mode probably requires native iOS/Android work rather than only changing JS onChangeText timing.

  5. added theissue type on Jul 12, 2026
  6. nwparker commented on Jul 27, 2026

    @nwparker
    Contributor

    Repro attempt blocked (environment)

    Japanese flick/romaji IME on Orca Mobile terminal requires the mobile app. Not available here. Not labeling cannot_repro (env blocked).

  7. brennanb2025 commented on Jul 30, 2026

    @brennanb2025
    Contributor

    Partial fix is up in #11450 (CI green, awaiting merge) — flagging the limit up front rather than implying this closes the issue.

    What it fixes: kana flick input. Composition is now held off the PTY until it commits, so flick-entered kana no longer leaks partial characters into the terminal.

    What it does not fix: romaji input. That path isn't correctable in JS — the composition events the OS delivers don't carry enough information to reconstruct intent, so it needs a native-side change. This issue should stay open for the romaji half after #11450 lands.

  8. nwparker commented on Aug 4, 2026

    @nwparker
    Contributor

    Hey! Working on this. Sorry for delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions