MCPcopy Create free account
hub / github.com/codeaashu/claude-code / handleHistoryUp

Function handleHistoryUp

src/components/PromptInput/PromptInput.tsx:924–943  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

922 // Footer nav is NOT here — when a pill is selected, TextInput focus=false so
923 // these never fire. The Footer keybinding context handles ↑/↓ instead.
924 function handleHistoryUp() {
925 if (suggestions.length > 1) {
926 return;
927 }
928
929 // Only navigate history when cursor is on the first line.
930 // In multiline inputs, up arrow should move the cursor (handled by TextInput)
931 // and only trigger history when at the top of the input.
932 if (!isCursorOnFirstLine) {
933 return;
934 }
935
936 // If there's an editable queued command, move it to the input for editing when UP is pressed
937 const hasEditableCommand = queuedCommands.some(isQueuedCommandEditable);
938 if (hasEditableCommand) {
939 void popAllCommandsFromQueue();
940 return;
941 }
942 onHistoryUp();
943 }
944 function handleHistoryDown() {
945 if (suggestions.length > 1) {
946 return;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected