Download packages/cli/src/ui/contexts/InputContext.tsx from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/contexts/InputContext.tsx
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/contexts/InputContext.tsx
-
curl -L -o InputContext.tsx https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/contexts/InputContext.tsx
708 Bytes
| /** | |
| * @license | |
| * Copyright 2026 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { createContext, useContext } from 'react'; | |
| import type { TextBuffer } from '../components/shared/text-buffer.js'; | |
| export interface InputState { | |
| buffer: TextBuffer; | |
| userMessages: string[]; | |
| shellModeActive: boolean; | |
| showEscapePrompt: boolean; | |
| copyModeEnabled: boolean | undefined; | |
| inputWidth: number; | |
| suggestionsWidth: number; | |
| } | |
| export const InputContext = createContext<InputState | null>(null); | |
| export const useInputState = () => { | |
| const context = useContext(InputContext); | |
| if (!context) { | |
| throw new Error('useInputState must be used within an InputProvider'); | |
| } | |
| return context; | |
| }; | |