File tree Expand file tree Collapse file tree
apps/mobile/src/features/terminal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -522,6 +522,12 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
522522 isVisible : state . isVisible ,
523523 } ) ) ;
524524 const isAccessoryVisible = keyboardState . isVisible && ! isAccessoryDismissed ;
525+ // Android's terminal owns an EditText; turning off autoFocus also clears its native focus.
526+ const terminalAutoFocus =
527+ Platform . OS === "android"
528+ ? ! isAccessoryDismissed &&
529+ ( ! SHOWCASE_ENABLED || keyboardFocusRequest > 0 || keyboardState . isVisible )
530+ : ! SHOWCASE_ENABLED ;
525531 const terminalBottomInset =
526532 ( keyboardState . isVisible ? keyboardState . height : 0 ) +
527533 ( isAccessoryVisible ? TERMINAL_ACCESSORY_HEIGHT : 0 ) ;
@@ -1110,6 +1116,7 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
11101116 } , [ ] ) ;
11111117
11121118 const handleShowKeyboard = useCallback ( ( ) => {
1119+ setIsAccessoryDismissed ( false ) ;
11131120 setKeyboardFocusRequest ( ( current ) => current + 1 ) ;
11141121 } , [ ] ) ;
11151122 const handleRetryEnvironment = useCallback ( ( ) => {
@@ -1333,7 +1340,7 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
13331340 } }
13341341 />
13351342 < TerminalSurface
1336- autoFocus = { ! SHOWCASE_ENABLED }
1343+ autoFocus = { terminalAutoFocus }
13371344 buffer = { terminalSurfaceBuffer }
13381345 fontSize = { fontSize }
13391346 isRunning = { isRunning }
You can’t perform that action at this time.
0 commit comments