Skip to content

Comments

feat: prompt users to run /terminal-setup with yes/no#16235

Open
ishaanxgupta wants to merge 20 commits intogoogle-gemini:mainfrom
ishaanxgupta:ishaan/terminalsetup
Open

feat: prompt users to run /terminal-setup with yes/no#16235
ishaanxgupta wants to merge 20 commits intogoogle-gemini:mainfrom
ishaanxgupta:ishaan/terminalsetup

Conversation

@ishaanxgupta
Copy link
Contributor

@ishaanxgupta ishaanxgupta commented Jan 9, 2026

Summary

This change introduces an opt‑in prompt in the interactive CLI that asks users, once, if they’d like to run the /terminal-setup command when it would actually help them (e.g., in VS Code / Cursor / Windsurf / Antigravity terminals that don’t yet have the multiline keybindings configured and don’t support Kitty/modifyOtherKeys).
Existing users who have already configured their terminal are not prompted.

The prompt -

  • appears when it’s actually useful (no Kitty/modifyOtherKeys, no existing matching keybindings).
  • Respect users who have already configured their terminal or who decline the prompt.

Related Issues

Closes #16005

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker
image image

collaborated with @ved015

Co-authored-by: Vedant Mahajan <Vedant.04.mahajan@gmail.com>
@ishaanxgupta ishaanxgupta requested a review from a team as a code owner January 9, 2026 09:47
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ishaanxgupta, 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 significantly improves the user experience for the interactive CLI by implementing a smart, one-time prompt. It guides users to configure essential multiline input keybindings via the /terminal-setup command. The system intelligently assesses the user's terminal environment and existing configurations to ensure the prompt is relevant and non-intrusive, enhancing usability for those who need it without bothering those who don't.

Highlights

  • Opt-in Prompt for Terminal Setup: The interactive CLI now introduces a one-time opt-in prompt, asking users if they wish to run /terminal-setup to configure multiline input keybindings.
  • Intelligent Prompting Logic: The prompt is displayed only when relevant: in specific terminal environments (VS Code, Cursor, Windsurf, Antigravity) where multiline keybindings are not yet configured and Kitty/modifyOtherKeys are not supported.
  • User Preference Respect: The system respects users who have already configured their terminal or those who decline the prompt, ensuring they are not bothered again through persistent state tracking.
  • New shouldPromptForTerminalSetup Utility: A new asynchronous function has been added to intelligently determine if the prompt is necessary based on terminal capabilities and existing keybinding configurations.
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.

Copy link
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 helpful one-time prompt for users in certain terminals to configure multiline input, which improves the interactive CLI experience. The implementation correctly uses persistent state to ensure the prompt is only shown once and handles asynchronous operations safely within a useEffect hook. The logic for determining when to show the prompt is sound. My feedback focuses on improving code quality and maintainability by addressing code duplication and enhancing error handling in the newly added utility functions, aligning with established error handling guidelines. These changes will make the code easier to maintain and debug in the future.

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/ux labels Jan 9, 2026
@bdmorgan bdmorgan removed the area/ux label Jan 10, 2026
@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Jan 10, 2026
@ishaanxgupta
Copy link
Contributor Author

@jacob314 @scidomino could you please review this and suggest any changes if needed

@ishaanxgupta ishaanxgupta marked this pull request as draft January 14, 2026 12:58
@ishaanxgupta ishaanxgupta marked this pull request as ready for review January 16, 2026 15:23
@ishaanxgupta
Copy link
Contributor Author

@scidomino this PR is ready for review
I have tried to keep the Appcontainer less bloated,modularized terminalsetup.ts and used map instead of switch

Copy link
Collaborator

@scidomino scidomino left a comment

Choose a reason for hiding this comment

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

When I tested this it wouldn't update my settings. it would immediately execute the

return () => {
  cancelled = true;
};

so even if I select "yes" it doesn't make modifications because it thinks it's canceled.

@ishaanxgupta
Copy link
Contributor Author

When I tested this it wouldn't update my settings. it would immediately execute the

return () => {
  cancelled = true;
};

so even if I select "yes" it doesn't make modifications because it thinks it's canceled.

Ah, I am really sorry this shouldn't happen.

@scidomino
Copy link
Collaborator

@ishaanxgupta ok. Let me know when you've fixed it and I'll review again.

@ishaanxgupta ishaanxgupta marked this pull request as draft January 21, 2026 05:46
@ishaanxgupta ishaanxgupta marked this pull request as ready for review January 21, 2026 18:03
Remove comment about setting terminal setup prompt state.
@ishaanxgupta
Copy link
Contributor Author

@scidomino I checked the PR, the cancelled flag was being set immediately when the component re-rendered or unmounted, which happened before the async operations completed. This caused the flow to exit early even when you clicked "Yes".
Fixed this and checked the working on local

@scidomino
Copy link
Collaborator

@ishaanxgupta I think you didn't push your changes to github. none of the commits in the last 5 days did anything other than add and remove comments. And when I run the code, it still fails as I described above.

@jacob314 jacob314 added the help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! label Jan 22, 2026
@scidomino
Copy link
Collaborator

Closing because it's been 7 days with no response. Feel free to reopen when you're ready for review.

@ishaanxgupta
Copy link
Contributor Author

hi @scidomino really sorry for that, could you please reopen this one?

@scidomino scidomino reopened this Feb 19, 2026
@scidomino
Copy link
Collaborator

Reopened. Please fix and ping me when it's ready for review.

@ishaanxgupta
Copy link
Contributor Author

Reopened. Please fix and ping me when it's ready for review.

Sure

@scidomino
Copy link
Collaborator

Note that others are interested in this issue so please let's get this in by monday.

@ved015
Copy link
Contributor

ved015 commented Feb 20, 2026

hi @scidomino
We were working on this issue so i tried testing it again on local and it seems to work fine for me

WhatsApp.Video.2026-02-20.at.08.58.37.mp4

@scidomino
Copy link
Collaborator

These lint errors are weird. I'm going to try rebasing this to see if it fixes things.

@scidomino
Copy link
Collaborator

Actually, the lint check is a legitimate failure:

Error:   99:21  error  Unsafe type assertion: type 'Keybinding' is more narrow than the original type  @typescript-eslint/no-unsafe-type-assertion

Please fix.

@scidomino
Copy link
Collaborator

In the future, please make sure npm run preflight passes.

@ved015
Copy link
Contributor

ved015 commented Feb 23, 2026

Actually, the lint check is a legitimate failure:

Error:   99:21  error  Unsafe type assertion: type 'Keybinding' is more narrow than the original type  @typescript-eslint/no-unsafe-type-assertion

Please fix.

@scidomino fixed the errors checked on local pls have a look

@scidomino
Copy link
Collaborator

Had you run npm run preflight you would know that the tests are still failing:


Running ESLint...

> @google/gemini-cli@0.30.0-nightly.20260210.a2174751d lint
> eslint . --cache


/Users/sciortino/src/gemini-cli/packages/cli/src/ui/utils/terminalSetup.ts
  403:11  error  Unsafe assignment of an `any` value  @typescript-eslint/no-unsafe-assignment

✖ 1 problem (1 error, 0 warnings)

*** gpkg: This tool is configured to use Corp Airlock for package installs: http://go/corp-airlock

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 help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remind users to run /terminal-setup

5 participants