({
debug,
ideSelection,
toolPermissionContext,
setToolPermissionContext,
apiKeyStatus,
commands,
agents,
isLoading,
verbose,
messages,
onAutoUpdaterResult,
autoUpdaterResult,
input,
onInputChange,
mode,
onModeChange,
stashedPrompt,
setStashedPrompt,
submitCount,
onShowMessageSelector,
onMessageActionsEnter,
mcpClients,
pastedContents,
setPastedContents,
vimMode,
setVimMode,
showBashesDialog,
setShowBashesDialog,
onExit,
getToolUseContext,
onSubmit: onSubmitProp,
onAgentSubmit,
isSearchingHistory,
setIsSearchingHistory,
onDismissSideQuestion,
isSideQuestionVisible,
helpOpen,
setHelpOpen,
hasSuppressedDialogs,
isLocalJSXCommandActive = false,
insertTextRef,
voiceInterimRange,
}: Props)
| 223 | const MIN_INPUT_VIEWPORT_LINES = 3; |
| 224 | |
| 225 | function PromptInput({ |
| 226 | debug, |
| 227 | ideSelection, |
| 228 | toolPermissionContext, |
| 229 | setToolPermissionContext, |
| 230 | apiKeyStatus, |
| 231 | commands, |
| 232 | agents, |
| 233 | isLoading, |
| 234 | verbose, |
| 235 | messages, |
| 236 | onAutoUpdaterResult, |
| 237 | autoUpdaterResult, |
| 238 | input, |
| 239 | onInputChange, |
| 240 | mode, |
| 241 | onModeChange, |
| 242 | stashedPrompt, |
| 243 | setStashedPrompt, |
| 244 | submitCount, |
| 245 | onShowMessageSelector, |
| 246 | onMessageActionsEnter, |
| 247 | mcpClients, |
| 248 | pastedContents, |
| 249 | setPastedContents, |
| 250 | vimMode, |
| 251 | setVimMode, |
| 252 | showBashesDialog, |
| 253 | setShowBashesDialog, |
| 254 | onExit, |
| 255 | getToolUseContext, |
| 256 | onSubmit: onSubmitProp, |
| 257 | onAgentSubmit, |
| 258 | isSearchingHistory, |
| 259 | setIsSearchingHistory, |
| 260 | onDismissSideQuestion, |
| 261 | isSideQuestionVisible, |
| 262 | helpOpen, |
| 263 | setHelpOpen, |
| 264 | hasSuppressedDialogs, |
| 265 | isLocalJSXCommandActive = false, |
| 266 | insertTextRef, |
| 267 | voiceInterimRange, |
| 268 | }: Props): React.ReactNode { |
| 269 | const mainLoopModel = useMainLoopModel(); |
| 270 | // A local-jsx command (e.g., /mcp while agent is running) renders a full- |
| 271 | // screen dialog on top of PromptInput via the immediate-command path with |
| 272 | // shouldHidePromptInput: false. Those dialogs don't register in the overlay |
| 273 | // system, so treat them as a modal overlay here to stop navigation keys from |
| 274 | // leaking into TextInput/footer handlers and stacking a second dialog. |
| 275 | const isModalOverlayActive = useIsModalOverlayActive() || isLocalJSXCommandActive; |
| 276 | const [isAutoUpdating, setIsAutoUpdating] = useState(false); |
| 277 | const [exitMessage, setExitMessage] = useState<{ |
| 278 | show: boolean; |
| 279 | key?: string; |
| 280 | }>({ show: false }); |
| 281 | const [cursorOffset, setCursorOffset] = useState<number>(input.length); |
| 282 | // Track the last input value set via internal handlers so we can detect |
nothing calls this directly
no test coverage detected