- Replaces the rsync command in the build_package.sh script with a
Node.js script (copy_files.cjs) to handle copying necessary files
(e.g., .md, .json, .sb) during the build process.
- Addresses an issue where the build would fail on systems
that do not have rsync installed (e.g., some Windows environments or
minimal Linux distributions) by using a Node.js script, providing a
cross-platform solution as Node.js is already a project dependency.
- Updates the ESLint configuration to correctly lint .cjs files as
CommonJS modules.
Fixes https://github.com/google-gemini/gemini-cli/issues/387
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename.
The fix involves:
- Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`.
- Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object.
- Expanding the `FileDiff` interface in `tools.ts` to include `fileName`.
Additionally, this commit enhances the diff rendering by:
- Adding syntax highlighting based on file extension in `DiffRenderer.tsx`.
- Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`.
- Added lots of tests for all the above.
Fixes https://b.corp.google.com/issues/418125982
This commit addresses several code review comments primarily focused on improving the rendering and stability of the CLI UI.
Key changes include:
- Passing `isPending` and `availableTerminalHeight` props to `MarkdownDisplay` to enable more intelligent rendering of content, especially for pending messages and code blocks.
- Adjusting height calculations in `ToolGroupMessage` and `ToolMessage` to more accurately reflect available space.
- Refining the logic in `App.tsx` for measuring and utilizing terminal height, including renaming `footerRef` to `mainControlsRef` for clarity.
- Ensuring consistent prop drilling for `isPending` and `availableTerminalHeight` through `HistoryItemDisplay`, `GeminiMessage`, and `GeminiMessageContent`.
- In `MarkdownDisplay`, when `isPending` is true and content exceeds `availableTerminalHeight`, the code block will now be truncated with a "... generating more ..." message. If there's insufficient space even for the
message, a simpler "... code is being written ..." will be shown.
This commit introduces several changes to better manage terminal height and prevent UI tearing, especially when displaying long tool outputs or when the pending history item exceeds the available terminal height.
- Calculate and utilize available terminal height in `App.tsx`, `HistoryItemDisplay.tsx`, `ToolGroupMessage.tsx`, and `ToolMessage.tsx`.
- Refresh the static display area in `App.tsx` when a pending history item is too large, working around an Ink bug (see https://github.com/vadimdemedes/ink/pull/717).
- Truncate long tool output in `ToolMessage.tsx` and indicate the number of hidden lines.
- Refactor `App.tsx` to correctly measure and account for footer height.
Fixes https://b.corp.google.com/issues/414196943
- This commit refactors the Markdown rendering logic within the CLI UI.
The existing `MarkdownRenderer.tsx` class-based component has been
replaced with a new functional component `MarkdownDisplay.tsx`.
- The `MarkdownDisplay` component is a React.memoized component for
improved performance and maintains the same core Markdown parsing
and rendering capabilities.
- The `WriteFileTool` had a validation method named `validateParams`.
- However, its `shouldConfirmExecute` method was attempting to call
`this.validateToolParams`, which would have invoked the placeholder
implementation from `BaseTool` instead of `WriteFileTool`'s own,
more specific validation.
- This commit renames `WriteFileTool`'s `validateParams` to
`validateToolParams`, correctly overriding the `BaseTool` method.
- Internal calls within `WriteFileTool` now correctly use
`this.validateToolParams`, ensuring its specific validation logic is used.
- Adds tests to verify the validation logic within `WriteFileTool`.
Fixes https://b.corp.google.com/issues/417883702
Signed-off and authored by: Gemini
"My code may not be perfect, but at least it is not trying to take over the world... yet."
- Did not update details that impact GC execution. Meaning packages are still named gemini-code (for now) and things that import them still import them as gemini-code.
New keybindings in the main input prompt (when auto-suggestions are not active):
- `Ctrl+L`: Clears the entire screen.
- `Ctrl+A`: Moves the cursor to the beginning of the current input line.
- `Ctrl+E`: Moves the cursor to the end of the current input line.
- `Ctrl+P`: Navigates to the previous command in the input history.
- `Ctrl+N`: Navigates to the next command in the input history.
In the multiline text editor (e.g., when editing a previous message):
- `Ctrl+K`: Deletes text from the current cursor position to the end of the line ("kill line right").
- When larger confirmations were shown and then declined you'd typicaly get large chunks of content flickering upon typing or sending a subsequent request. This was primarily due to us leaving the latest confirmation as "updateable" / pending. This changeset addresses that by flushing any pending confirmation to the static container.
Part of https://b.corp.google.com/issues/414196943