Skip to content

feat(cli) Scrollbar for input prompt#21992

Merged
jacob314 merged 2 commits intomainfrom
input_prompt_scroll
Apr 3, 2026
Merged

feat(cli) Scrollbar for input prompt#21992
jacob314 merged 2 commits intomainfrom
input_prompt_scroll

Conversation

@jacob314
Copy link
Copy Markdown
Contributor

@jacob314 jacob314 commented Mar 11, 2026

Issues: background color for the input prompt
Option to hide the scrollbar doesn't really work.

To test, create a large input prompt. Verify that if you are in alternate buffer or mouse mode (ctrl-S) the input prompt is scrollable.
Fixes #21423

Video:
https://screencast.googleplex.com/cast/NDkyNzkwODg5OTQ1NDk3NnxmM2U5MTY2Yy0yNg

image

@jacob314 jacob314 requested review from a team as code owners March 11, 2026 07:11
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Mar 11, 2026

Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant usability enhancement to the CLI's input prompt by implementing a scrollable interface for multi-line inputs. Previously, long inputs might have been difficult to navigate; now, a scrollbar appears automatically when the input exceeds the visible area, allowing users to easily review and edit extensive commands or text. This change is configurable via a new ui.scrollableInputPrompt setting, providing flexibility for user preferences. The underlying rendering mechanism has been modernized to support this functionality, ensuring a smoother and more intuitive user experience.

Highlights

  • Scrollable Input Prompt Feature: Introduced a new feature that enables a scrollbar for the CLI input prompt when it contains multiple lines, improving usability for long inputs.
  • New Configuration Setting: Added ui.scrollableInputPrompt as a boolean setting, defaulting to true, allowing users to control the visibility of the scrollbar.
  • Refactored Input Rendering: The InputPrompt component was refactored to utilize a new ScrollableList component for rendering input lines, providing the underlying scrolling mechanism.
  • Enhanced Text Buffer Logic: The useTextBuffer hook was updated to manage the visual scroll row based on cursor position and viewport height, ensuring the cursor remains visible during input.
  • Comprehensive Testing: New tests were added to validate the scrolling behavior of large inputs, alongside updates to existing tests to align with the new rendering architecture.
Changelog
  • docs/cli/settings.md
    • Documented the new ui.scrollableInputPrompt setting in the CLI settings guide.
  • docs/reference/configuration.md
    • Added a detailed description and default value for the ui.scrollableInputPrompt setting in the configuration reference.
  • packages/cli/src/config/settingsSchema.ts
    • Registered the scrollableInputPrompt setting within the application's configuration schema.
  • packages/cli/src/ui/components/InputPrompt.test.tsx
    • Expanded test coverage to include scenarios for scrolling large inputs and updated mock buffer properties for consistency.
  • packages/cli/src/ui/components/InputPrompt.tsx
    • Implemented the ScrollableList component to render input lines, enabling scroll functionality, and integrated the ui.scrollableInputPrompt setting.
  • packages/cli/src/ui/components/snapshots/InputPrompt.test.tsx.snap
    • Updated snapshot tests to reflect the new rendering structure and scrollable behavior.
  • packages/cli/src/ui/components/shared/ScrollableList.tsx
    • Modified the ScrollableList component to accept new props for scroll management, background color, and scrollbar thumb color.
  • packages/cli/src/ui/components/shared/VirtualizedList.tsx
    • Enhanced the VirtualizedList component to support a targetScrollIndex for controlled scrolling and dynamic container height.
  • packages/cli/src/ui/components/shared/text-buffer.ts
    • Refactored the useTextBuffer hook to automatically adjust the visual scroll row based on cursor position and viewport, and added viewportHeight to the TextBuffer interface.
  • schemas/settings.schema.json
    • Added the scrollableInputPrompt property to the UI section of the global settings schema.
Activity
  • The pull request was created by jacob314, introducing the scrollbar feature for the CLI input prompt.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

Size Change: +3.23 kB (+0.01%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-P2SQW7I7.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-PWZO3PH4.js 0 B -3.15 MB (removed) 🏆
./bundle/core-W7DS4R63.js 0 B -45.1 kB (removed) 🏆
./bundle/devtoolsService-VR7WH6N7.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-PWYY3XZG.js 0 B -1.63 MB (removed) 🏆
./bundle/oauth2-provider-AGQWXG4J.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-32KQVOJI.js 3.15 MB +3.15 MB (new file) 🆕
./bundle/chunk-Y3B7OKIC.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/core-HM6ZGDNM.js 45.1 kB +45.1 kB (new file) 🆕
./bundle/devtoolsService-KCAIKT6J.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-IGTYIJIX.js 1.63 MB +1.63 MB (new file) 🆕
./bundle/oauth2-provider-PG5L6C5I.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./bundle/bundled/third_party/index.js 8 MB
./bundle/chunk-34MYV7JD.js 2.45 kB
./bundle/chunk-5AUYMPVF.js 858 B
./bundle/chunk-5PS3AYFU.js 1.18 kB
./bundle/chunk-664ZODQF.js 124 kB
./bundle/chunk-DAHVX5MI.js 206 kB
./bundle/chunk-IUUIT4SU.js 56.5 kB
./bundle/chunk-RJTRUG2J.js 39.8 kB
./bundle/chunk-SU4IS2NT.js 1.96 MB
./bundle/devtools-36NN55EP.js 696 kB
./bundle/dist-T73EYRDX.js 356 B
./bundle/events-XB7DADIJ.js 418 B
./bundle/gemini.js 550 kB
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB
./bundle/memoryDiscovery-UJWZC5BA.js 980 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB
./bundle/src-QVCVGIUX.js 47 kB
./bundle/tree-sitter-7U6MW5PS.js 274 kB
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB

compressed-size-action

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a scrollable input prompt, a great usability improvement for handling multi-line inputs. The implementation refactors the InputPrompt to use a new ScrollableList component, which is a solid architectural change.

My review has identified a few issues:

  • A critical bug where the default value for the new scrollableInputPrompt setting is inconsistent across the codebase.
  • Two instances of a React anti-pattern where state is updated directly during the render cycle in text-buffer.ts and VirtualizedList.tsx. While this may be an attempt to avoid UI lag, it violates React's principles and can lead to maintainability issues. I've suggested refactoring these to use useEffect.

Comment thread packages/cli/src/config/settingsSchema.ts Outdated
Comment thread packages/cli/src/ui/components/shared/VirtualizedList.tsx
Comment thread packages/cli/src/ui/components/shared/text-buffer.ts
@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label Mar 11, 2026
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 19, 2026
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Mar 26, 2026

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383).

We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'.

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community!

@gemini-cli gemini-cli Bot closed this Mar 26, 2026
@jacob314 jacob314 reopened this Apr 3, 2026
@gemini-cli gemini-cli Bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. and removed status/need-issue Pull requests that need to have an associated issue. labels Apr 3, 2026
@jacob314 jacob314 force-pushed the input_prompt_scroll branch from 17526ea to 7badb2d Compare April 3, 2026 18:17
@jacob314 jacob314 enabled auto-merge April 3, 2026 20:04
Issues: background color for the input prompt
Option to hide the scrollbar doesn't really work.

fix: resolve build and test errors after rebase

docs: regenerate settings docs and schema
@jacob314 jacob314 force-pushed the input_prompt_scroll branch from 7badb2d to d837207 Compare April 3, 2026 20:05
@jacob314 jacob314 added this pull request to the merge queue Apr 3, 2026
Merged via the queue into main with commit d5a5995 Apr 3, 2026
27 checks passed
@jacob314 jacob314 deleted the input_prompt_scroll branch April 3, 2026 22:42
jacob314 added a commit that referenced this pull request Apr 4, 2026
jacob314 added a commit that referenced this pull request Apr 4, 2026
afanty2021 pushed a commit to afanty2021/gemini-cli that referenced this pull request Apr 4, 2026
jacob314 added a commit that referenced this pull request Apr 6, 2026
jacob314 added a commit that referenced this pull request Apr 6, 2026
warrenzhu25 pushed a commit to warrenzhu25/gemini-cli that referenced this pull request Apr 9, 2026
HaleTom pushed a commit to HaleTom/gemini-cli that referenced this pull request Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add scrollbar to the input prompt when it exceeds the available height

2 participants