diff --git a/mobile/app/h/[hostId]/session/[worktreeId].tsx b/mobile/app/h/[hostId]/session/[worktreeId].tsx index 76eac77ec55..8bce0d73332 100644 --- a/mobile/app/h/[hostId]/session/[worktreeId].tsx +++ b/mobile/app/h/[hostId]/session/[worktreeId].tsx @@ -4899,8 +4899,6 @@ export default function SessionScreen() { autoCorrect={autocompleteEnabled} spellCheck={autocompleteEnabled} smartInsertDelete={false} - // Why: Android's default keyboard is required for CJK IME - // composition; iOS can still use ASCII when autocomplete is off. keyboardType={getTerminalCommandKeyboardType( Platform.OS, autocompleteEnabled diff --git a/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts b/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts new file mode 100644 index 00000000000..412e9db664a --- /dev/null +++ b/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts @@ -0,0 +1,14 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' + +const sessionRouteSource = readFileSync( + new URL('../../app/h/[hostId]/session/[worktreeId].tsx', import.meta.url), + 'utf8' +) + +describe('terminal iOS IME keyboard', () => { + it('does not force terminal inputs onto the ASCII-only iOS keyboard', () => { + expect(sessionRouteSource).not.toContain("'ascii-capable'") + expect(sessionRouteSource).not.toContain('"ascii-capable"') + }) +}) diff --git a/mobile/src/terminal/terminal-keyboard-type.test.ts b/mobile/src/terminal/terminal-keyboard-type.test.ts index 697fc4a7347..a6fa0bdd784 100644 --- a/mobile/src/terminal/terminal-keyboard-type.test.ts +++ b/mobile/src/terminal/terminal-keyboard-type.test.ts @@ -14,9 +14,9 @@ describe('terminal keyboard type', () => { expect(getTerminalCommandKeyboardType('android', true)).toBe('default') }) - it('keeps the iOS ASCII keyboard when terminal autocomplete is disabled', () => { - expect(getTerminalLiveInputKeyboardType('ios')).toBe('ascii-capable') - expect(getTerminalCommandKeyboardType('ios', false)).toBe('ascii-capable') + it('keeps iOS IME keyboards available for terminal input', () => { + expect(getTerminalLiveInputKeyboardType('ios')).toBe('default') + expect(getTerminalCommandKeyboardType('ios', false)).toBe('default') expect(getTerminalCommandKeyboardType('ios', true)).toBe('default') }) }) diff --git a/mobile/src/terminal/terminal-keyboard-type.ts b/mobile/src/terminal/terminal-keyboard-type.ts index 71bf5042930..ed1b8173346 100644 --- a/mobile/src/terminal/terminal-keyboard-type.ts +++ b/mobile/src/terminal/terminal-keyboard-type.ts @@ -1,20 +1,17 @@ export type TerminalKeyboardPlatform = 'android' | 'ios' | 'web' | 'windows' | 'macos' -export type TerminalKeyboardType = 'ascii-capable' | 'default' +export type TerminalKeyboardType = 'default' +// Why: default keyboards keep non-Latin IMEs selectable; ASCII-only keyboards hide them. +// Parameters stay for call-site stability while autocomplete no longer changes the keyboard. export function getTerminalLiveInputKeyboardType( - platform: TerminalKeyboardPlatform + _platform: TerminalKeyboardPlatform ): TerminalKeyboardType { - // Why: Android CJK IMEs need the normal system keyboard; password-style - // input types suppress composition and break Chinese terminal input. - return platform === 'ios' ? 'ascii-capable' : 'default' + return 'default' } export function getTerminalCommandKeyboardType( - platform: TerminalKeyboardPlatform, - autocompleteEnabled: boolean + _platform: TerminalKeyboardPlatform, + _autocompleteEnabled: boolean ): TerminalKeyboardType { - if (autocompleteEnabled) { - return 'default' - } - return platform === 'ios' ? 'ascii-capable' : 'default' + return 'default' }