MCPcopy Index your code
hub / github.com/codeaashu/claude-code / handleKeyDown

Function handleKeyDown

src/hooks/useHistorySearch.ts:262–268  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

260 // This is a conditional behavior that doesn't fit the keybinding model
261 // well (backspace only cancels when query is empty)
262 const handleKeyDown = (e: KeyboardEvent): void => {
263 if (!isSearching) return
264 if (e.key === 'backspace' && historyQuery === '') {
265 e.preventDefault()
266 handleCancel()
267 }
268 }
269
270 // Backward-compat bridge: PromptInput doesn't yet wire handleKeyDown to
271 // <Box onKeyDown>. Subscribe via useInput and adapt InputEvent →

Callers 1

useHistorySearchFunction · 0.70

Calls 2

preventDefaultMethod · 0.80
handleCancelFunction · 0.50

Tested by

no test coverage detected