diff options
| author | Jacob Richman <[email protected]> | 2025-06-06 13:44:11 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-06 13:44:11 -0700 |
| commit | 2f54aa888a4df9ac730f32d3d542371cfab070af (patch) | |
| tree | fc9588b4d71a0e391a2a12b0c7de37200b43327a | |
| parent | 21acdee0a03a84e20831434b40613ed352b7f566 (diff) | |
feat(ui): add cursor to empty input prompt (#800)
| -rw-r--r-- | packages/cli/src/ui/components/InputPrompt.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index 4d71e612..64b41466 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -39,7 +39,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ onClearScreen, config, slashCommands, - placeholder = 'Type your message or @path/to/file', + placeholder = ' Type your message or @path/to/file', height = 10, focus = true, widthFraction, @@ -349,7 +349,14 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ </Text> <Box flexGrow={1} flexDirection="column"> {buffer.text.length === 0 && placeholder ? ( - <Text color={Colors.Gray}>{placeholder}</Text> + focus ? ( + <Text> + {chalk.inverse(placeholder.slice(0, 1))} + <Text color={Colors.Gray}>{placeholder.slice(1)}</Text> + </Text> + ) : ( + <Text color={Colors.Gray}>{placeholder}</Text> + ) ) : ( linesToRender.map((lineText, visualIdxInRenderedSet) => { const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow; |
