Skip to content

fix: enable iOS autocorrect on non-direct terminal entry (#4606)#4699

Open
sudoeren wants to merge 3 commits into
stablyai:mainfrom
sudoeren:fix/ios-non-direct-terminal-autocorrect
Open

fix: enable iOS autocorrect on non-direct terminal entry (#4606)#4699
sudoeren wants to merge 3 commits into
stablyai:mainfrom
sudoeren:fix/ios-non-direct-terminal-autocorrect

Conversation

@sudoeren
Copy link
Copy Markdown
Contributor

@sudoeren sudoeren commented Jun 5, 2026

Resolves #4606.

Problem

On iPhone, the iOS keyboard's autocorrect bar was suppressed on the non-direct (buffered) terminal command input. Users typing a command in the buffered bar saw no autocorrect suggestions, even though iOS would normally offer them.

Root Cause

mobile/app/h/[hostId]/session/[worktreeId].tsx had autoCorrect={false} hard-coded on the buffered command <TextInput> (line 4303). The live/direct <TextInput> further up the same ternary (line 4275–4292) already pins autoCorrect={false} + spellCheck={false} — correctly, since live input forwards raw bytes to the PTY and must not be spell-corrected.

The buffered bar in contrast collects a full line and then calls terminal.send on submit, so autocorrect is safe to enable and is what the user expects from an iOS keyboard.

Fix

Removed the autoCorrect={false} prop on the buffered <TextInput>. React Native defaults autoCorrect to true on iOS and false on Android, which is exactly what the issue asks for ("On iPhone the text entry should enable auto correct"). The live/direct <TextInput> is untouched.

Diff

--- a/mobile/app/h/[hostId]/session/[worktreeId].tsx
+++ b/mobile/app/h/[hostId]/session/[worktreeId].tsx
@@ -4300,7 +4300,6 @@ export default function SessionScreen() {
                   placeholder="Type a command…"
                   placeholderTextColor={colors.textMuted}
                   autoCapitalize="none"
-                  autoCorrect={false}
                   returnKeyType="send"
                   editable={canSend}
                   onSubmitEditing={() => void handleSend()}

Testing

Added mobile/src/terminal/session-terminal-entry-autocorrect.test.ts (2 tests):

  • Live (direct) input still has autoCorrect={false} + spellCheck={false} — guards the live branch against accidental removal.
  • Buffered (non-direct) input has neither autoCorrect={false} nor autoCorrect={true} nor spellCheck — guards the iOS-default behavior the issue depends on.

The tests read the rendered source rather than mounting the 5k-line screen, matching the convention used by terminal-viewport-refit.test.ts and other mobile source-invariant tests (no React Native render-test infrastructure in this package).

  • pnpm test (mobile) — new 2/2 pass; fix-sanity-checked by reverting the prop and confirming the buffered test fails.
  • pnpm lint (mobile) — clean
  • tsc --noEmit -p tsconfig.json (mobile) — clean

Notes

  • iOS-only behavioral change. Android was already autocorrect-off and stays that way.
  • The live (direct) input path — where raw PTY bytes must not be altered by iOS — is unchanged. Existing autoCorrect={false} + spellCheck={false} + keyboardType="ascii-capable" on lines 4283–4286 are kept.

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.

[Bug]: iOS non direct terminal entry text should enable auto correct in keyboard

2 participants