diff options
| author | fuyou <[email protected]> | 2025-08-10 06:26:43 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-09 22:26:43 +0000 |
| commit | 0dea7233b65b480466e4da62db9127205b57a6d0 (patch) | |
| tree | dba8b2d92d3b914873f7eea78cdb2cd39c91f038 /packages/cli/src/ui/App.tsx | |
| parent | 34434cd4aad088fe001708ff4685d7c97be099eb (diff) | |
feat(cli) - enhance input UX with double ESC clear (#4453)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
| -rw-r--r-- | packages/cli/src/ui/App.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 7ee9405f..a52236f8 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -190,6 +190,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { const [ideContextState, setIdeContextState] = useState< IdeContext | undefined >(); + const [showEscapePrompt, setShowEscapePrompt] = useState(false); const [isProcessing, setIsProcessing] = useState<boolean>(false); useEffect(() => { @@ -224,6 +225,11 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { const openPrivacyNotice = useCallback(() => { setShowPrivacyNotice(true); }, []); + + const handleEscapePromptChange = useCallback((showPrompt: boolean) => { + setShowEscapePrompt(showPrompt); + }, []); + const initialPromptSubmitted = useRef(false); const errorCount = useMemo( @@ -1055,6 +1061,8 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { <Text color={Colors.AccentYellow}> Press Ctrl+D again to exit. </Text> + ) : showEscapePrompt ? ( + <Text color={Colors.Gray}>Press Esc again to clear.</Text> ) : ( <ContextSummaryDisplay ideContext={ideContextState} @@ -1105,6 +1113,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { commandContext={commandContext} shellModeActive={shellModeActive} setShellModeActive={setShellModeActive} + onEscapePromptChange={handleEscapePromptChange} focus={isFocused} vimHandleInput={vimHandleInput} placeholder={placeholder} |
