init claude-code

This commit is contained in:
2026-04-01 17:32:37 +02:00
commit 73b208c009
1902 changed files with 513237 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import type { HistoryMode } from 'src/hooks/useArrowKeyHistory.js'
import type { PromptInputMode } from 'src/types/textInputTypes.js'
export function prependModeCharacterToInput(
input: string,
mode: PromptInputMode,
): string {
switch (mode) {
case 'bash':
return `!${input}`
default:
return input
}
}
export function getModeFromInput(input: string): HistoryMode {
if (input.startsWith('!')) {
return 'bash'
}
return 'prompt'
}
export function getValueFromInput(input: string): string {
const mode = getModeFromInput(input)
if (mode === 'prompt') {
return input
}
return input.slice(1)
}
export function isInputModeCharacter(input: string): boolean {
return input === '!'
}