Skip to content

feat(cli): show resume message when exiting session#17481

Closed
afarber wants to merge 2 commits intogoogle-gemini:mainfrom
afarber:16226-add-resume-message
Closed

feat(cli): show resume message when exiting session#17481
afarber wants to merge 2 commits intogoogle-gemini:mainfrom
afarber:16226-add-resume-message

Conversation

@afarber
Copy link
Contributor

@afarber afarber commented Jan 25, 2026

Summary

Display "Resume this session by running gemini --resume" when quitting via /quit or Ctrl+C, as requested by maintainer in #16226.

Details

Add sessionId field to HistoryItemQuit type and pass it through the quit flow:

  • quitCommand.ts now includes the sessionId in the quit message
  • SessionSummaryDisplay.tsx conditionally renders the resume hint below the stats box
  • Message uses theme colors for consistent styling

Related Issues

Closes #16226

How to Validate

  1. Run npm run build && npm run start
  2. Type some prompt, like asking when is sun down today
  3. Type /quit or press Ctrl+C twice
  4. Verify message "Resume this session by running gemini --resume" appears below the session stats box

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

@afarber afarber requested a review from a team as a code owner January 25, 2026 10:06
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @afarber, 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 helpful user experience enhancement to the CLI by providing clear instructions on how to resume a session after it has been terminated. By integrating the session ID into the quit process and updating the session summary display, users can now easily pick up where they left off, improving workflow continuity and reducing friction.

Highlights

  • Resume Message on Quit: Implemented a feature to display a 'Resume this session by running gemini --resume' message when a user quits the CLI session via /quit or Ctrl+C.
  • Session ID Integration: The sessionId is now passed through the quit flow, specifically added to the HistoryItemQuit type and included in the quit message generated by quitCommand.ts.
  • Conditional UI Rendering: The SessionSummaryDisplay.tsx component has been updated to conditionally render the resume hint below the session statistics box, utilizing theme colors for consistent styling.
  • Test Coverage: New test cases were added to SessionSummaryDisplay.test.tsx to ensure the resume message renders correctly when a sessionId is provided.
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 adds a helpful message for resuming a session when the user quits. The implementation is clean and follows existing patterns. I've found one potential issue with a hardcoded command name that might not work in all environments, which I've detailed in a specific comment. Otherwise, the changes look good and the tests are well-written.

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. 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! labels Jan 25, 2026
@afarber
Copy link
Contributor Author

afarber commented Jan 25, 2026

Hi @jacob314 please review my PR.

Here I have tested on Ubuntu 25.04. First I have asked "Which weekday is 1st of Feb", then pressed CTRL-C and finally the Resume this session by running gemini --resume message is printed:

image

@afarber afarber force-pushed the 16226-add-resume-message branch from 1a0b546 to 6a66bab Compare January 26, 2026 08:33
@jackwotherspoon
Copy link
Contributor

I am going to close this in favor of the first PR that was opened: #16285

In general we want to foster a positive open-source community. 😄 I am going to help get the first PR opened for this landed.

@afarber really appreciate the PR here and the contributions to Gemini CLI.

But in the future let's just add a comment on the existing PR like "maybe we should add a test for this" or "what about X edge case?". This way the original PR author can take the feedback and iterate instead of creating a new PR for the same issue.

Hope this makes sense, again I love your contributions!

@afarber
Copy link
Contributor Author

afarber commented Jan 26, 2026

No problem, frankly speaking I noticed the original PR too late when I already started testing my own fix.

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.

Add a prompt before exiting using ctrl c

2 participants